break; or another way
#1

I'm doing a timer of 20 seconds, which will be repeated until seconds gets 1, and wont happen anymore since 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?
Reply


Messages In This Thread
break; or another way - by blackwave - 01.03.2011, 19:51
Re: break; or another way - by JaTochNietDan - 01.03.2011, 19:58
Re: break; or another way - by blackwave - 01.03.2011, 20:23
Re: break; or another way - by JaTochNietDan - 01.03.2011, 20:41

Forum Jump:


Users browsing this thread: 6 Guest(s)