01.03.2011, 19:51
I'm doing a timer of 20 seconds, which will be repeated until seconds gets 1, and wont happen anymore since 0.
I'm almost 100 % sure I'm not using break correctly, but I've used "continue" and "break" on other cases. Is there other way to kill this timer when the time variable gets 0?
pawn Код:
new time = 20;
public counter()
{
new string[3];
time--;
format(string,sizeof(string),"%d",time);
GameTextForAll(string,1000,5);
if(time == 0)
{
time = 20;
break; // Says it's out of the context. This is the error.
}
else
{
SetTimer("counter",1000,false); // Will repeat until time be higher than 0
}
return 1;
}
I'm almost 100 % sure I'm not using break correctly, but I've used "continue" and "break" on other cases. Is there other way to kill this timer when the time variable gets 0?