#include <a_samp>
forward Flood(playerid);
forward Flood2(playerid);
new AFlood[MAX_PLAYERS],nMsg[MAX_PLAYERS][128],Mute[MAX_PLAYERS];
public Flood(playerid) AFlood[playerid] = 0;
public Flood2(playerid){Mute[playerid] = 0, AFlood[playerid] = 0;SendClientMessage(playerid, 0xFF0000, "( ANTI - FLOOD ) Vocк jб pode usar o chat novamente..");}
public OnFilterScriptInit(){print("Anti - Flood Carregado");return 1;}
public OnFilterScriptExit(){print("Anti - Flood Descarregado");return 1;}
public OnPlayerConnect(playerid){Mute[playerid] = 0,AFlood[playerid] = 0;return 1;}
public OnPlayerText(playerid, text[])
{
if(strlen(text) == strlen(nMsg[playerid]) && !strcmp(nMsg[playerid], text, false)){SendClientMessage(playerid, -1, "( ANTI - FLOOD ) Nгo repita a mesma mensagem!");return 0;}
if(Mute[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "( ANTI - FLOOD ) Vocк nгo pode digitar no chat enquanto estiver mutado..");
AFlood[playerid]++;
if(AFlood[playerid] == 2) SetTimerEx("Flood", 2500, 0 , "i" , playerid);
else if(AFlood[playerid] == 3) return SendClientMessage(playerid, 0xFF0000 , "( ANTI - FLOOD ) Nгo faзa flood ou vocк pode ser mutado.."), 0;
else if(AFlood[playerid] == 4)
{
SendClientMessage(playerid, 0xFF0000AA, "( ANTI - FLOOD ) Vocк foi mutado por 30 Segundos.");
Mute[playerid] = 1;
SetTimerEx("Flood2", 30000 , 0 , "i", playerid);
return 0;
}
return 0;
}
#include <a_samp>
forward Flood(playerid);
new AFlood[MAX_PLAYERS],nMsg[MAX_PLAYERS][128];
public Flood(playerid) AFlood[playerid] = 0;
public OnFilterScriptInit(){print("Anti - Flood Carregado");return 1;}
public OnFilterScriptExit(){print("Anti - Flood Descarregado");return 1;}
public OnPlayerConnect(playerid){AFlood[playerid] = 0;return 1;}
public OnPlayerText(playerid, text[])
{
if(strlen(text) == strlen(nMsg[playerid]) && !strcmp(nMsg[playerid], text, false)){SendClientMessage(playerid, -1, "( ANTI - FLOOD ) Nгo repita a mesma mensagem!");return 0;}
AFlood[playerid]++;
if(AFlood[playerid] == 2) SetTimerEx("Flood", 2500, 0 , "i" , playerid);
else if(AFlood[playerid] == 3) return SendClientMessage(playerid, 0xFF0000 , "( ANTI - FLOOD ) Nгo faзa flood ou vocк pode ser kickado..");
else if(AFlood[playerid] == 4)
{
SendClientMessage(playerid, 0xFF0000AA, "( ANTI - FLOOD ) Vocк foi kickado por fazer flood..");
Kick(playerid);
return 0;
}
return 0;
}
#include <a_samp>
new
gFloodStamp[MAX_PLAYERS],
gFloodCount[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
if(gFloodStamp[playerid] > 0)
{
if(gettime() >= gFloodStamp[playerid])
{
gFloodStamp[playerid] = 0;
gFloodCount[playerid] = 0;
}
else
{
gFloodCount[playerid]++;
if(gFloodCount[playerid] == 3)
{
return Kick(playerid), 0;
}
}
}
gFloodStamp[playerid] = gettime() + 3; // 3 segundos pra falar
return 1;
}
Flood para mim, й escrever varias vezes a mesma coisa, o seu script ai se o cara escrever 3 vezes palavras diferentes vai receber o aviso! Mas nгo deixa de ser funcional, Bom trabalho!
|