Which is better Per Player Timer or Global timer? (issue with timer) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Which is better Per Player Timer or Global timer? (issue with timer) (
/showthread.php?tid=608975)
Which is better Per Player Timer or Global timer? (issue with timer) -
Dokins - 07.06.2016
Several and randomly timers stop working in samp.
I use 1 global timer for all players using foreach however it seems that it suddenly stops working and won't run every minute.
It updates variables like
Jail time etc.
I've been having a lot of issues with timers including inaccuracies and I have to restart the server just to fix.
I have killed all timers ongamemodeexit
I don't think using per player timers is exactly efficient? I mean say I had 500 players online (not likely just saying) wouldn't that cause serious issue?
Thanks,
Grant
Re: Which is better Per Player Timer or Global timer? (issue with timer) -
Onfroi - 07.06.2016
Yes, use y_timers or try to use
gettime instead of timers anywhere you can, starting with that jail time
Re: Which is better Per Player Timer or Global timer? (issue with timer) - justice96 - 07.06.2016
global timer,
task dokinstimer[1000](){ return 1;}
Re: Which is better Per Player Timer or Global timer? (issue with timer) -
Vince - 07.06.2016
This has been discussed many, many times already and it was established that many timers with tiny bits of fast code would be better than one large timer with slow code. Timers are also roughly 20% too fast. If you want a true 1 second timer you should actually use something like 850 ms instead.
Re: Which is better Per Player Timer or Global timer? (issue with timer) -
Dokins - 07.06.2016
I see but would this cause my timers to mess up and ultimately stop working? My timer is actually about 25% slow but the other is accurate. When I use timer fix it appears not to work and a random timer stops I'm completely lost.
The code under the one minute timer is pretty big wouldn't this cause a lot of issues if I did per player?