Hey!
#13
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.
Reply
Thanks given by:


Messages In This Thread
Hey! - by qaisjp - 06-11-2014, 07:50 AM
RE: Hey! - by worktycho - 06-11-2014, 08:35 AM
RE: Hey! - by FakeTruth - 06-11-2014, 02:00 PM
RE: Hey! - by xoft - 06-11-2014, 05:45 PM
RE: Hey! - by qaisjp - 06-12-2014, 05:29 AM
RE: Hey! - by xoft - 06-12-2014, 06:31 AM
RE: Hey! - by qaisjp - 06-13-2014, 12:53 AM
RE: Hey! - by FakeTruth - 06-12-2014, 08:17 PM
RE: Hey! - by bearbin - 06-13-2014, 01:00 AM
RE: Hey! - by FakeTruth - 06-13-2014, 01:28 AM
RE: Hey! - by bearbin - 06-13-2014, 01:48 AM
RE: Hey! - by worktycho - 06-13-2014, 01:56 AM
RE: Hey! - by qaisjp - 06-13-2014, 03:03 AM
RE: Hey! - by worktycho - 06-13-2014, 03:29 AM
RE: Hey! - by qaisjp - 06-13-2014, 04:32 AM
RE: Hey! - by worktycho - 06-13-2014, 04:41 AM
RE: Hey! - by qaisjp - 06-13-2014, 04:49 AM
RE: Hey! - by worktycho - 06-13-2014, 05:07 AM
RE: Hey! - by qaisjp - 06-13-2014, 06:07 AM



Users browsing this thread: 2 Guest(s)