Speeding up timer
#1

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
Reply
#2

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);
Reply
#3

It's working great now.. ******, that helped too, thanks. Solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)