[FilterScript] Ant-Flood.
#1

PHP код:
#include <a_samp>
new Floodando[MAX_PLAYERS],
                       
TMutado[MAX_PLAYERS];
forward ParouFlood(playerid);
forward TempoMutado();
public 
OnFilterScriptInit() { SetTimer("TempoMutado",1000,true); return 1; }
public 
OnFilterScriptExit() return 1;
public 
OnPlayerConnect(playerid) { Floodando[playerid] = 0TMutado[playerid] = 0; return 1; }
public 
OnPlayerText(playeridtext[])
{
    if(
TMutado[playerid] > 0)
    {
        new 
string[60];
        
format(stringsizeof(string), "-AntFlood- Faltam %d segundos, para voce ser desmutado!"TMutado[playerid]);
        
SendClientMessage(playerid, -1string);
        return 
false;
    }
    
Floodando[playerid]++;
    if(
Floodando[playerid] == 3)
    {
        
Floodando[playerid] = 0;
        
TMutado[playerid] = 120;
        
SendClientMessage(playerid, -1"-AntFlood- Vocк foi mutado por 120 Segundos.!");
        return 
1;
    }
    else
    {
        
SetTimerEx("ParouFlood"3000false"i"playerid);
    }
    return 
1;
}
public 
TempoMutado()
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
TMutado[i] == 1)
        {
            
TMutado[i] = 0;
            
SendClientMessage(i, -1"-AntFlood- Vocк foi desmutado!");
            return 
1;
        }
        if(
TMutado[i] > 0)
        {
            
TMutado[i]--;
        }
    }
    return 
1;
}
public 
ParouFlood(playerid)
{
    
Floodando[playerid] = 0;
    return 
1;

#@# Creditos #@#
Dan
Parem de Dar -rep, eu nгo copiei porra nenhuma, A Ideia Eu Vi Ne Um Servidor e Resolvi traze-la.
Reply


Messages In This Thread
Ant-Flood. - by DanDRT - 03.02.2013, 16:23
Re: Ant-Flood. - by tonisantolia - 03.02.2013, 16:33
Re: Ant-Flood. - by @LucasVinicius - 03.02.2013, 19:43
Respuesta: Re: Ant-Flood. - by DanDRT - 03.02.2013, 19:53
Re: Ant-Flood. - by dPlaYer_ - 05.02.2013, 16:47
Re: Ant-Flood. - by DanDRT - 05.02.2013, 18:35
Re: Ant-Flood. - by DanDRT - 09.02.2013, 14:13
Re: Ant-Flood. - by davi54723 - 09.02.2013, 14:17
Re: Ant-Flood. - by Kuddy - 09.02.2013, 15:20
Re: Ant-Flood. - by DanDRT - 09.02.2013, 15:47

Forum Jump:


Users browsing this thread: 2 Guest(s)