06.09.2010, 20:48
(
Последний раз редактировалось Hiddos; 07.09.2010 в 06:10.
)
pawn Код:
forward CountDown(seconds);
public CountDown(seconds)
{
if(seconds == 0)
{
//All your code for when the timer reaches 0
return; //THIS IS ESSENTIAL TO WORK!!!
}
SetTimerEx("CountDown", 1000, 0, "d", seconds-1);
new minutes;
while(seconds < 59)
{
seconds -= 60;
minutes++;
}
new string[8];
if(seconds < 10) format(string, sizeof string, "%d:0%d" minutes, seconds);
else format(string, sizeof string, "%d:%d" minutes, seconds);
TextDrawSetString(<YOUR TEXTDRAW ID>, string);
}
pawn Код:
CountDown(<seconds>);
pawn Код:
CountDown(8*60); //8 times 60 is 8 minutes

