[AJUDA]Anti Flood que cala o player
#2

pawn Код:
//No Topo do GM:

new Comandos[MAX_PLAYERS][20];
new FloodComandos[MAX_PLAYERS];


//No comeзo do OnPlayerCommandText:

new ComandoAtual[20];
    new Parametro;
    ComandoAtual = strtok(cmdtext, Parametro);
    if(!strcmp(ComandoAtual, Comandos[playerid], true) && strlen(Comandos[playerid]))
    {
        FloodComandos[playerid]++;
        SendClientMessage(playerid, 0x33CCFFAA, "Proibido flood em comandos !");
        if(FloodComandos[playerid] == 3)
        {
            Comandos[playerid] = ("");
            FloodComandos[playerid] = 0;
            new STR[65];
            new NickName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, NickName, MAX_PLAYER_NAME);
            format(STR, 65, "%s Foi kickado por floodar nos comandos!", NickName);
            SendClientMessageToAll(0xFF0000AA, STR);
            Kick(playerid);
        }
        return 1;
    }
    else
    {
        FloodComandos[playerid] = 0;
    }
    format(Comandos[playerid], 20, "%s", ComandoAtual);



//E, se a funзгo strtok nгo estiver declarada, no Final do GM:

stock strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Crйditos 'rjjj' Adapte ele ao seu GameMode

Anti-Flood de falar
Se a pessoa falar 3 vezes a mesma coisa e kikada.
http://www.4shared.com/file/XCFPZAlJ/FSAntiFlood.html
Reply


Messages In This Thread
[AJUDA]Anti Flood que cala o player - by [STR]Matrix - 12.05.2012, 02:28
Re: [AJUDA]Anti Flood que cala o player - by ViictorDaay- - 12.05.2012, 02:29
Re: [AJUDA]Anti Flood que cala o player - by [STR]Matrix - 12.05.2012, 02:38
Re: [AJUDA]Anti Flood que cala o player - by zSuYaNw - 12.05.2012, 03:16

Forum Jump:


Users browsing this thread: 1 Guest(s)