Speeding up 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: Speeding up timer (
/showthread.php?tid=517557)
Speeding up timer -
Battlezone - 05.06.2014
Is there a way to speed up a timer? I mean can I decrease the interval?
Well i have tried KillTimer but it didnt work..
Here is what i did :
Step 1:
pawn Код:
TESTTimer[playerid][TESTZONE] = SetTimer("TESTZONETimer", CountVar[TESTZONE], false);
Then when i want to get half the interval :
Step 2:
pawn Код:
CountVar[TEST] = floatround(floatdiv(CountVar[TESTZONE], 2), floatround_round);
KillTimer(TESTTimer[playerid][TESTZONE]);
TESTTimer[playerid][TESTZONE] = SetTimerEx("TESTZONETimer", CountVar[TEST], false, "i", playerid);
But it doesnt work, when it reaches step 2, the function is validated and the second timer doesnt work
Re: Speeding up timer -
Threshold - 05.06.2014
Not 100% sure on what you're trying to achieve, but this should work:
pawn Код:
CountVar[TEST] = CountVar[TESTZONE] / 2;
KillTimer(TESTTimer[playerid][TESTZONE]);
TESTTimer[playerid][TESTZONE] = SetTimerEx("TESTZONETimer", CountVar[TEST], false, "i", playerid);
Re: Speeding up timer -
Battlezone - 05.06.2014
It's working great now.. ******, that helped too, thanks.

Solved.