Callbacks = spaghetti code. Spaghetti code = vomit. The only place callbacks are appropriate are for events (onTick, onDead, but these aren't really callbacks) and for databasing (although databasing would be super cool if it was based around coroutines instead; read "how it works"). For us, everything "just works".
We list what scripts we want running in a specific order in a meta file. (example)
These scripts are run and whatever we ask for we are given immediately.
Anywhere and anytime.
Also I think the retrieval of a player by name should be case insensitive (or a boolean value to toggle the case sensitivity).
edit:
The netcode does not run parallel (or for some other reason) making it impossible for a person to leave midcode.
If the code I posted was in a timer/loop, even if the connection is dropped, for us, a player element will still exist until the next "tick". Then in the next tick the event is called.
I'm not 100% sure what the main loop is like for MTASA, I'll take a plunge into the code and ask around but this is how I think it goes:
netcode happens -> cpp calls magic events in lua vm -> more netcode updates
Or atleast:
netcode happens -> net code happens -> netcode happens
events called -> events called ->
But I'm probably wrong, because vehicles/objects/peds can be created instantaneously and immediately manipulated. I'll ask around.
We list what scripts we want running in a specific order in a meta file. (example)
These scripts are run and whatever we ask for we are given immediately.
Anywhere and anytime.
Also I think the retrieval of a player by name should be case insensitive (or a boolean value to toggle the case sensitivity).
edit:
The netcode does not run parallel (or for some other reason) making it impossible for a person to leave midcode.
If the code I posted was in a timer/loop, even if the connection is dropped, for us, a player element will still exist until the next "tick". Then in the next tick the event is called.
I'm not 100% sure what the main loop is like for MTASA, I'll take a plunge into the code and ask around but this is how I think it goes:
netcode happens -> cpp calls magic events in lua vm -> more netcode updates
Or atleast:
netcode happens -> net code happens -> netcode happens
events called -> events called ->
But I'm probably wrong, because vehicles/objects/peds can be created instantaneously and immediately manipulated. I'll ask around.