22.07.2012, 13:47
pawn Код:
public OnPlayerText(playerid, text[])
{
if(Flooder[playerid] == 1)
{
SendClientMessage(playerid, -1, "{FF4500}| ANTI-FLOOD | Vocк estб calado.");
return 0;
}
IsFlooding[playerid]++;
if(!IsPlayerAdmin(playerid))
{
if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text, false))
{
SendClientMessage(playerid, -1, "{FF4500}| ANTI-FLOOD | Nгo repita a mesma mensagem");
format(szPlayerChatMsg[playerid], 128, "%s", text);
return 0;
}
}
if(IsFlooding[playerid] >= 3)
{
IsFlooding[playerid] = 0;
Flooder[playerid] = 1;
format(String, sizeof(String), "{FF4500}| ANTI-FLOOD | O jogador %s foi calado por 45 segundos.", PlayerName(playerid));
SendClientMessageToAll(-1, String);
SetTimerEx("LiberarChat", 45000, false, "i", playerid);
return 0;
}
else
{
SetTimerEx("SemFlood", 2000, false, "i", playerid);
}
GetPlayerName(playerid,nome,24);
format(String, sizeof(String), "%s [%d]: {FFFFFF}%s", nome, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), String);
return 0;
}