[Pedido] Anti flood
#10

pawn Код:
#include <a_samp>

new IsFlooding[MAX_PLAYERS];
new Flooder[MAX_PLAYERS];
new szPlayerChatMsg[MAX_PLAYERS][128];

public OnGameModeInit()
{
    print("\n--------------------------------------");
    print(" FilterScript Ant-Flood BY: [LF]PlaYer");
    print("--------------------------------------\n");
    return 1;
}


public OnPlayerText(playerid, text[])
{
    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;
}

forward SemFlood(playerid);
public SemFlood(playerid)
{
    IsFlooding[playerid] = 0;
    return 1;
}

forward LiberarChat(playerid);
public LiberarChat(playerid)
{
    Flooder[playerid] = 0;
    SendClientMessage(playerid, -1, "Vocк foi descalado, nгo faзa mais flood !");
    return 1;
}
/* Nгo retire os creditos Criador: [LF]PlaYer  
Com Ajuda de rjjj */


Sу editar conforme seu game mode para ficar melhor =P.
Reply


Messages In This Thread
Anti flood - by ThiagoMK - 12.07.2013, 22:48
Re: Anti flood - by Gii - 12.07.2013, 22:53
Re : Re: Anti flood - by ThiagoMK - 12.07.2013, 23:08
Re: Anti flood - by [THs]ShadoW - 12.07.2013, 23:12
Re: Re : Re: Anti flood - by Gii - 12.07.2013, 23:12
Re: Re : Re: Anti flood - by BieeelEvolution - 12.07.2013, 23:12
Re: Anti flood - by maikonk - 12.07.2013, 23:16
Re : Anti flood - by ThiagoMK - 13.07.2013, 01:25
Re: Anti flood - by Saw_BR - 13.07.2013, 02:33
Re: Anti flood - by Saw_BR - 13.07.2013, 02:35

Forum Jump:


Users browsing this thread: 2 Guest(s)