[Ajuda] Flood do capeta
#9

PHP код:
new IsFlooding[MAX_PLAYERS];
new 
Flooder[MAX_PLAYERS];
new 
szPlayerChatMsg[MAX_PLAYERS][128]; 
PHP код:
public OnPlayerText(playeridtext[])
{
    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"60000false"i"playerid);
        return 
0;
    }
    else
    {
        
SetTimerEx("SemFlood"2000false"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;

Vocк pode dar uma olhadinha aqui tambйm...

https://sampforum.blast.hk/showthread.php?tid=300361
Reply


Messages In This Thread
Flood do capeta - by nasser - 13.01.2017, 21:47
Re: Flood do capeta - by HeisenGiromB - 13.01.2017, 21:48
Re: Flood do capeta - by nasser - 13.01.2017, 21:50
Re: Flood do capeta - by BobbMarley - 13.01.2017, 21:51
Re: Flood do capeta - by IlanZ - 13.01.2017, 21:58
Re: Flood do capeta - by Whoo - 13.01.2017, 22:01
Re: Flood do capeta - by BobbMarley - 13.01.2017, 22:03
Re: Flood do capeta - by B4dSh33p - 14.01.2017, 00:16
Re: Flood do capeta - by JhefTFJ - 14.01.2017, 01:05
Re: Flood do capeta - by nasser - 14.01.2017, 11:38

Forum Jump:


Users browsing this thread: 2 Guest(s)