22.01.2017, 17:29
(
Последний раз редактировалось PeanutButter; 22.01.2017 в 20:05.
)
I'm trying to make a countdown timer but for some reason the timer won't stop.
The timer doesn't stop and just keeps printing 0
PHP код:
new counter = 4;
new CountTimer;
PHP код:
CountTimer = SetTimer("CountDown", 1000, true);
PHP код:
forward CountDown();
public CountDown()
{
foreach(Joiners, i)
{
printf("counter = %i", counter);
new countstr[128];
if(counter != 0)
{
format(countstr, sizeof(countstr), "Game starts in: %i", counter);
GameTextForPlayer(i, countstr, 1000, 4);
counter--;
}
else
{
GameTextForPlayer(i, "START!", 1000, 4);
KillTimer(CountTimer);
}
}
return 1;
}