[Ajuda]Arrumar sistema de contagem
#2

pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

new Counting;

dcmd_count(playerid, params[])
{
    if (!strlen(params)) return SendClientMessage(playerid, 0xafafafff, " Use: /Cont [Quantia]");

    if (!strlen(params) > 9) return SendClientMessage(playerid, 0xafafafff, " A contagem sу pode ser feita atй 9");

    if (!IsNumeric(params)) return SendClientMessage(playerid, 0xafafafff, " A [quantia] й a quantidade numйrica!");

    if (strval(params) < 1) return SendClientMessage(playerid, 0xafafafff, " A contagem nгo aceita Zero!");

    if (Counting) return SendClientMessage(playerid, 0xafafafff, " ");
   
    Counting = true;

    new ii = strval(params);

    do
    {
        SetTimerEx("CountDown", (strval(params) - ii) * 1000, false, "i", ii);
       
        ii --;
    }
    while (ii != -1);

    SendClientMessage(playerid, 0xffe600ff, "*** Countdown brB ***"); //Amarelo
   
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(count, 5, cmdtext);

    return 0;
}

forward CountDown(num);

public CountDown(num)
{
    new str[2];

    if (num)
    {
        format(str, sizeof(str), "%i", num);
       
        GameTextForAll(str, 1001, 4); //
    }
    else
    {
        GameTextForAll("~g~Go Go Go", 3000, 4); //VERDE
       
        Counting = false;
    }
}

IsNumeric(const string[]) //By [_brB_]Clan http://www.clanbrb.forumeiros.com ([_brB_]Sonic)
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
Reply


Messages In This Thread
[No subject] - by [BGSL]Manoel Ski - 29.04.2011, 17:44
Re: [Ajuda]Arrumar sistema de contagem - by Macintosh - 29.04.2011, 17:48
Re: [Ajuda]Arrumar sistema de contagem - by [BGSL]Manoel Ski - 29.04.2011, 17:50
Re: [Ajuda]Arrumar sistema de contagem - by The Knight - 29.04.2011, 17:56
Re: [Ajuda]Arrumar sistema de contagem - by Macintosh - 29.04.2011, 17:57
Re: [Ajuda]Arrumar sistema de contagem - by The Knight - 29.04.2011, 18:06
Re: [Ajuda]Arrumar sistema de contagem - by TheGarfield - 29.04.2011, 18:46
Re: [Ajuda]Arrumar sistema de contagem - by [BGSL]Manoel Ski - 29.04.2011, 18:54
Re: [Ajuda]Arrumar sistema de contagem - by The Knight - 29.04.2011, 18:54
Re: [Ajuda]Arrumar sistema de contagem - by [BGSL]Manoel Ski - 29.04.2011, 19:30

Forum Jump:


Users browsing this thread: 1 Guest(s)