06.05.2015, 09:57
I have a timer - http://i.imgur.com/4NKcsN2.jpg But i want to make it dynamic to countdown. Now it only shows and then disapears.
This is the code. And if you can help me to set it up on the top of the screen it will be very nice.
Код:
stock CountDown(playerid, time) { CountDownTime[playerid] = time; CTimer[playerid] = SetTimerEx("CountDownTimer", 1000, false, "i", playerid); return 0; } forward CountDownTimer(playerid); public CountDownTimer(playerid) { if(CountDownTime[playerid] > 1) { new timer[28]; format(timer, sizeof(timer), "%i Seconds", CountDownTime[playerid]); GameTextForPlayer(playerid, timer, 1000, 0); CountDownTime[playerid] -= 1; return 1; } else { GameTextForPlayer(playerid, "GOOOOO!!!!", 1000, 0); KillTimer(CTimer[playerid]); } return 1; }