31.05.2015, 11:12
Use [+code+] [/code] to add code in your thread (Remove the + from the tag)
I am guessing that you want to stop the countdown.
Instead of creating a timer every one second, create one timer for the whole process.
Make a global variable timerid and start the timer using the code given above when you want to start.
Then use KillTimer(timerid); to stop the countdown
Код:
forward countdownforddo(playerid); public countdownforddo(playerid) { if(CountDown==71) GameTextForPlayer(playerid,"~y~Starting...",1000,1 ); CountDown--; if(CountDown==0) { GameTextForPlayer(playerid,"~r~YOU LOSE!",1000,1); CountDown = -1; return 0; } else { new text[7]; format(text,sizeof(text),"~g~%d",CountDown); GameTextForPlayer(playerid,text,1000,1); } SetTimer("countdownforddo",1000,0); return 0; }
Instead of creating a timer every one second, create one timer for the whole process.
Код:
timerid = SetTimer("countdownforddo",1000,true);
Then use KillTimer(timerid); to stop the countdown