Question about couple timers
#1

Would this be actualy wise to use?

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(!zareaupdate) zareaupdate = SetTimer("update_zarea",1000,4);
    if(!zoneupdate) zoneupdate = SetTimer("update_zones",1000,4);
    return 1;
}
Or it would be better to place the timers at OnGameModeInit?

The same question i have for a ping kicker, would it be better to use it
at OnPlayerUpdate or better set a timer that checks the ping?
I need to some advices from good scripters.
Thanks, regards.
Reply
#2

That code you posted - you should put it under OnGameModeInIt. Why? Because I think you use it as a global timer to update zones. If you put it under OnPlayerSpawn this will only work if players spawns, and only then timer will start - and then for every player who connects (you can find it buggy).

For the ping kicker. I think you should use a timer, 'cause OnPlayerUpdate is called pretty often, so you don't need it, since players ping is updated every few seconds.
(I might be wrong.)
Reply
#3

I would put both to OnGameModeInit.
Reply
#4

Alright thank you both.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)