[Ajuda] Anti Flood Nгo funciona?
#1

Nгo sei oq deu, mas o anti flood do meu gm parou de funcionar... tipo nao estб dando a mensagem que foi calado ou outras mensagens do anti flood (no total 3 msgs), vejam o onplayertext:

pawn Код:
if(Flooder[playerid] == 1)
    {
        SendClientMessage(playerid, -1, "{FF0000}[ERRO]{FFFFFF} Vocк estб calado e nгo pode usar o chat !");
        return 0;
    }
    IsFlooding[playerid]++;
    if(!IsPlayerAdmin(playerid))
    {
        if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text,  false))
        {
            SendClientMessage(playerid, -1, "{FF0000}[ERRO]{FFFFFF} Nгo repita a mesma mensagem!");
            format(szPlayerChatMsg[playerid], 128, "%s", text);
            return 0;
        }
    }
    if(IsFlooding[playerid] >= 3)
    {
        IsFlooding[playerid] = 0;
        Flooder[playerid] = 1;
        SendClientMessage(playerid, -1, "{FF0000}[INFO]{FFFFFF} Vocк foi calado por 1 minuto. Motivo: Flood !");
        SetTimerEx("LiberarChat", 60000, false, "i", playerid);
        return 0;
    }
    else
    {
        SetTimerEx("SemFlood", 2000, false, "i", playerid);
    }
OnPlayerText
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(mute[playerid]==1)
    {
        SendClientMessage(playerid, red, "[x] Voce estб calado e nгo pode falar no chat.");
        return 0;
    }
    if(strlen(text) >= 63)
    {
        SendClientMessage(playerid,red,"[x] Seu texto nгo foi enviado pois estб muito grande.");
        return 0;
    }
    if(EstaAFK[playerid] == 0)
    {
        TFora[playerid] = SetTimerEx("Fora", 60000, 1, "i", playerid);
        EstaAFK[playerid] = 1;
        return 1;
    }
    else if(EstaAFK[playerid] == 1)
        {
            KillTimer(TFora[playerid]);
            TFora[playerid] = SetTimerEx("Fora", 60000, 1, "i", playerid);
            EstaAFK[playerid] = 1;
            return 1;
        }
    if(Flooder[playerid] == 1)
    {
        SendClientMessage(playerid, -1, "{FF0000}[ERRO]{FFFFFF} Vocк estб calado e nгo pode usar o chat !");
        return 0;
    }
    IsFlooding[playerid]++;
    if(!IsPlayerAdmin(playerid))
    {
        if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text,  false))
        {
            SendClientMessage(playerid, -1, "{FF0000}[ERRO]{FFFFFF} Nгo repita a mesma mensagem!");
            format(szPlayerChatMsg[playerid], 128, "%s", text);
            return 0;
        }
    }
    if(IsFlooding[playerid] >= 3)
    {
        IsFlooding[playerid] = 0;
        Flooder[playerid] = 1;
        SendClientMessage(playerid, -1, "{FF0000}[INFO]{FFFFFF} Vocк foi calado por 1 minuto. Motivo: Flood !");
        SetTimerEx("LiberarChat", 60000, false, "i", playerid);
        return 0;
    }
    else
    {
        SetTimerEx("SemFlood", 2000, false, "i", playerid);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)