[Tutorial] Player-timers
#2

While I do not disagree with the logic here, especially for very frequent ( or short ) timers, I am sceptical as to the efficiency of putting an entire scripts worth of timers under OnPlayerUpdate. Particularly for things which might be checked every 10 minutes or more.

I would be interested to know if it would still be more efficient to check unix time vs a variable 12,000 times, rather than doing one larger computation under a repeating 10 minute timer.

To put this in perspective, in my script I often use a repeating 1 minute timer to manipulate variables that have been set according to how many minutes I want the 'cooldown' period to be. Eg If I want to block a player from repairing a vehicle for 5 minutes, I will set 'repairtime[playerid]' to 5, and decrement it under the aforementioned 1 minute timer.

I consider this to be neater, and assume it is more efficient than a new SetTimerEx("function","d",playerid); for each player.

Tell me what you think.
Reply


Messages In This Thread
Player-timers - by Lenny the Cup - 12.10.2010, 10:36
Re: Player-timers - by Rachael - 12.10.2010, 11:03
Re: Player-timers - by Lenny the Cup - 12.10.2010, 11:22
Re: Player-timers - by Rachael - 12.10.2010, 11:43
Re: Player-timers - by Lenny the Cup - 12.10.2010, 11:50
Re: Player-timers - by playbox12 - 12.10.2010, 16:18
Re: Player-timers - by Lenny the Cup - 13.10.2010, 11:13
Re: Player-timers - by Lenny the Cup - 13.10.2010, 20:23
Re: Player-timers - by Slice - 13.10.2010, 20:29
Re: Player-timers - by RoBo - 14.10.2010, 17:37

Forum Jump:


Users browsing this thread: 1 Guest(s)