[AJUDA]Anti Flood que cala o player
#1

Galera eu queria tipo um anti flood que ele cala o player. esse anti flood eu queria para quando o player falar e quando ele execultar um comando.

Quando ele Floodar nos comandos:

( eu quero tipo assim quando o player digitace um comando 6 vezes em 6 segundos ele ficace proibido de execultar comandos por 10 segundos e se ele voltar a fazer denovo й adicionado + 10 segundos ao tempo " EX: Se ele floodar nos comandos 4 vezes o tempo vai ser 40 segundos e assim vai seguindo ". )

Quando ele Floodar nos textos:

( eu quero tipo assim quando o player falace 10 vezes em 10 segundo ele ficace proibido de falar e se ele voltar a fazer denovo й adicionado + 10 segundos ao tempo " EX: Se ele floodar nos textos 4 vezes o tempo vai ser 40 segundos e assim vai seguindo ". )

Quem conseguir ganha +REP Concerteza

Abraзos
Reply
#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
#3

Quote:
Originally Posted by ViictorDaay-
Посмотреть сообщение
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
Sim pow mais em vez da funзгo kick eu queria que calace o player por 10 segundos e se ele voltar a floodar fosse adicionado + 10 segundos ao tempo ( Isso ajuda a evitar novos tipos de B0TS e perda de players )
Reply
#4

Comando: (adicione no PlayerCommandText)
pawn Код:
static pSpammer[MAX_PLAYERS char];
static temp;
temp = pSpammer{playerid}
if(pSpammer{playerid} != 0 && gettime() - pSpammer{playerid} <  temp)
{
     format(string, sizeof(string),"FLOODI (%d s)", temp);
     SendClientMessage(playerid, -1, string);
     return true;
}

Chat: (adicione no OnPlayerText)
pawn Код:
static pSpammer[MAX_PLAYERS char];
static temp;
temp = pSpammer{playerid}
if(pSpammer{playerid} != 0 && gettime() - pSpammer{playerid} <  temp)
{
     format(string, sizeof(string),"(CHAT) FLOODI (%d s)", temp);
     SendClientMessage(playerid, -1, string);
     return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)