/countdown bug
#5

Nah, this one is way better... i use it in sLK clan server.

pawn Код:
forward CountDown(num);

new CountRunning =0;
pawn Код:
dcmd_cd(playerid, params[])
{
    if (!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cd [time]");
    else if(CountRunning) return SendClientMessage(playerid, COLOR_RED, "There is already a countdown running.");
    else if(!IsNumeric(params)) return SendClientMessage(playerid, COLOR_RED, "The [amount] param must be numerical");
    else if (strval(params) < 1) return SendClientMessage(playerid, COLOR_RED, "The count has to be greater than zero");
    else if (strval(params) > 10) return SendClientMessage(playerid, COLOR_RED, "The count can't be higher than 10!");
    else
    {
        CountRunning = 1;

        new ii = strval(params);

        do
        {
            SetTimerEx("CountDown", (strval(params) - ii) * 1000, false, "i", ii);

            ii --;
        }
        while (ii != -1);

        SendClientMessage(playerid, COLOR_WHITE, "***CountDown Started***");
    }
    return 1;
}

pawn Код:
public CountDown(num)
{
    new str[2];

    if (num)
    {
        format(str, sizeof(str), "%i", num);

        GameTextForAll(str, 1001, 5);
    }
    else
    {
        GameTextForAll("~g~Go", 3000, 5);

        CountRunning = 0;
    }
}
I think it was written by Donny_K
Reply


Messages In This Thread
/countdown bug - by shoru93 - 29.11.2009, 19:55
Re: /countdown bug - by LarzI - 29.11.2009, 20:41
Re: /countdown bug - by shoru93 - 29.11.2009, 21:13
Re: /countdown bug - by LarzI - 29.11.2009, 21:22
Re: /countdown bug - by Outbreak - 29.11.2009, 21:29
Re: /countdown bug - by diesulke - 29.11.2009, 21:43
Re: /countdown bug - by LarzI - 29.11.2009, 21:51
Re: /countdown bug - by shoru93 - 29.11.2009, 21:55
Re: /countdown bug - by lolumadd - 29.11.2009, 22:00
Re: /countdown bug - by Outbreak - 29.11.2009, 22:01

Forum Jump:


Users browsing this thread: 1 Guest(s)