Countdown
#4

pawn Код:
new CountTimer;
new countamount=5;
CMD:count(playerid,params[])
{
    CountTimer = SetTimer("Count",1000,true);//Setting the timer, for the count down.
    return 1;
}

public Count()
{
    for (new i = 0; i != MAX_PLAYERS; ++i)
    {
        if (IsPlayerConnected(i))
        {
             TogglePlayerControllable(i, 0)
        }
    }
    new string[4];//Creating the string variable, where we will store the count down value.
    format(string,sizeof(string),"%i",countamount);//Formating it.
    GameTextForAll(string,1000,3);//Showing it to everyone.
    countamount--;//Counting less 1 to the count down variable.
    if(countamount == -1)
    {
        KillTimer(CountTimer);
        countamount=5;
        GameTextForAll("~g~~h~Go!",1000,3);}//It's -1,
        for (new i = 0; i != MAX_PLAYERS; ++i)
        {
            if (IsPlayerConnected(i))
            {
                TogglePlayerControllable(i,1)
            }
        }
    }
    return 1;
}
This is right, I think. You unfreezed the players when the timer started, and freezed them when it stopped.
Reply


Messages In This Thread
Countdown - by (_AcE_) - 23.10.2011, 18:45
Re: Countdown - by juraska - 23.10.2011, 18:52
Re: Countdown - by Rks25 - 23.10.2011, 19:14
Re: Countdown - by AeroBlast - 23.10.2011, 19:20
Re: Countdown - by ToPhrESH - 23.10.2011, 19:25

Forum Jump:


Users browsing this thread: 1 Guest(s)