Timers.. - 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: Timers.. (
/showthread.php?tid=589848)
Timers.. -
karemmahmed22 - 23.09.2015
Hi, I made 2 timers for reaction tests, It works without any bugs but the problem is, after 7-8 hours of starting the timer, it gets bugged and i have to restart gamemode or restart server, thats sucks so, i tried to make command to fix the timers when they got bugged, but it doesn't do anything. the timers still being bugged after i use the command
Heres the command
PHP код:
dcmd_rt(playerid, params[])
{
#pragma unused params
ResetTimers();
SendClientMessage(playerid, COLOR_AQUA, "SERVER: Timers resetted.");
return 1;
}
ResetTimers()
{
KillTimer(xReactionTimer);
KillTimer(gRandomMessageTimer);
xReactionTimer = SetTimer("xReactionTest", TIME, 1);
gRandomMessageTimer = SetTimer("OnRandomMessageChange", 360000, true);
return 1;
}
It returns "SERVER: Timers resetted" but infact, it didn't.
However, heres the code on gamemodeinit:-
PHP код:
xReactionTimer = SetTimer("xReactionTest", TIME, 1);
gRandomMessageTimer = SetTimer("OnRandomMessageChange", 360000, true);
Anyway to fix this?
Re: Timers.. -
DoDler - 23.09.2015
can you show us xReactionTest, OnRandomMessageChange callbacks
Re: Timers.. -
Stanford - 23.09.2015
I somehow feel that this bug relates to your VPS or something..
Re: Timers.. -
karemmahmed22 - 23.09.2015
:/ Idk what the hell is that, its server hosted by ultra h, paid server
Re: Timers.. -
rappy93 - 23.09.2015
Most likely your server is running out of resources after a while (7-8 hours) and the timers don't get executed. Try monitoring your resource usage when you have 7-8 hours uptime and see if the CPU or the RAM are being exhausted.
Re: Timers.. -
karemmahmed22 - 23.09.2015
the timer gets executed but the problem is, it spams the chat with reaction tests
like 17-18 reaction every 13-14 seconds, :/
I believe its something in timer intervals
Re: Timers.. -
karemmahmed22 - 24.09.2015
bump