25.05.2015, 21:47
Hey everyone! I have one thing to ask. I'm not running any short-interval timers in my script. I've done so far this:
So when player gets tazed, he will be controllable again in 5 seconds. I've done the same thing with setting the player in the prison:
So my question is this: Should I create one timer globally with interval of a second and check for everything there (if the time has passes to send player out of jail), or should I keep everything this way so I'll have, let's say, maybe ~10 timers running at the same time so I can check for only specific players instead of running foreach loop.
If you could spare few minutes and write down your opinion on this, I would be very grateful.
Thanks in advance. Kindly regards!
pawn Code:
SetTimerEx("OnTazeEnd", 5000, false, "d", playerb);
pawn Code:
SetTimerEx("SendToJail", 5000, false, "d", playerb);
// Under SendToJail
SetTimerEx("SendOutOfJail", 60000, false, "d", playerid);
If you could spare few minutes and write down your opinion on this, I would be very grateful.
Thanks in advance. Kindly regards!