countdown
#10

try this
pawn Код:
new Timer;//this one up of all
new C=0;//this one up of all


if(strcmp(cmd, "/cd", true) == 0)//this in onplayercommandtext
{
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /cd  [Time in seconds]");
        return 1;
    }
    new time;
    time = strval(tmp);
    Timer = SetTimer("CountDown",1000,1);
    C=time+1;
    return 1;
}

forward CD(time);//this where u want not in other callbacks
public CD(time)
{
    new string[128];
    C--;
    format(string,sizeof(string),"%d",C);
    GameTextForAll(string,1000,3);
    if(C <= 0)
    {
        GameTextForAll("GO",1000,3);
        KillTimer(Timer);
    }
}
Reply


Messages In This Thread
countdown - by omer5198 - 04.03.2011, 10:13
Re: countdown - by iJumbo - 04.03.2011, 10:14
Re: countdown - by Sasino97 - 04.03.2011, 11:41
Re: countdown - by iJumbo - 04.03.2011, 11:52
Re: countdown - by omer5198 - 04.03.2011, 12:20
Re: countdown - by iJumbo - 04.03.2011, 12:36
Re: countdown - by omer5198 - 04.03.2011, 15:23
Re: countdown - by alpha500delta - 04.03.2011, 15:29
Re: countdown - by omer5198 - 04.03.2011, 16:02
Re: countdown - by iJumbo - 04.03.2011, 16:16

Forum Jump:


Users browsing this thread: 1 Guest(s)