break; or another way
#4

Quote:
Originally Posted by blackwave
Посмотреть сообщение
Break would breaks the timer when time variable be 0. But I've found a better way for that:
pawn Код:
public counter()
{
    new string[3];
    time--;
    format(string,sizeof(string),"%d",time);
    GameTextForAll(string,1000,5);
    if(time > 0)
    {
        SetTimer("counter",1000,false);
    }
    else
    {
        SetTimer("voting",2000,false);
    }
    return 1;
}
thx at all.
But you're not understanding actually, the timer isn't active when you are using break, so why would it break the timer? And like I said, this is not how break is used, it's used in loops. If you want to kill a timer that is actually active, you need to use a function like KillTimer, but again this isn't needed, since your timer isn't actually active when it hits 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: 2 Guest(s)