Timer solution ? - 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: Timer solution ? (
/showthread.php?tid=443281)
Timer solution ? -
NeroX98 - 11.06.2013
Hi guyz
I have 5-6 timers that are really important but they are causing HARD lag on the server...
My timers code (It's under OnGameModeInIt):
Код:
for(new i; i != GetMaxPlayers(); i++)
{
SetTimerEx("Speedo", 100, true, "d", i);
SetTimerEx("HPWCGLAD", 150000, true, "d", i);
SetTimerEx("BolnicaTimerce", 1000, true, "d", i);
SetTimerEx("exptimer", 60000, true, "d", i);
SetTimerEx("ExpUpdate", 100, true, "d", i);
SetTimerEx("RandomMessage", 8000, true, "d", i);
}
With this code i start 50 times (because my server is 50 slots) 6 timers, so that is 6*50 = 300 timers...
But if i create one timer with SetTimer under ongamemodeinit and no the timer public if i use foreach, the timer would stop counting sometimes for some players...
SOLUTION ?!?!?!
Re: Timer solution ? -
NeroX98 - 11.06.2013
Okay, i'll try to find the bug
Any idea how to find it
?
And i forgot to ask (just to be sure
)
When i create timer with SetTimer and the timer code should look like this (for all players)
??
Код:
public Speedo()
{
foreach(new playerid : Player)
{
// MY CODE
}
}