PHP код:
public OnPlayerText(playerid, text[])
{
if(Logado[playerid] == false)
{
SendClientMessage(playerid, Verde, "{3cff00}[TBD] {FFFFFF}Vocк deve spawnar para falar.");
return 0;
}
if(Muted[playerid] == 1)
{
SendClientMessage(playerid, BRANCO, "{3cff00}[TBD] {FFFFFF}Vocк nгo consegue falar, estб Calado!");
return 0;
}
if(ServerInfo[ChatLocked] == 1)
{
SendClientMessage(playerid, BRANCO, "{3cff00}[TBD] {FFFFFF}Vocк nгo consegue falar, o Chat estб bloqueado !");
return 0;
}
if(Flooder[playerid] == 1)
{
SendClientMessage(playerid, -1, "{00FF00}[TBD]{FFFFFF} Vocк estб calado e nгo pode usar o chat !");
return 0;
}
new findsub,subzeropos,subzero[50],sz[128];
format(sz,128,"%s",text);
while(subzeropos<=strlen(sz))
{
for(new d=0;d<MAX_PALAVRAS_SZ;d++)
{
findsub=strfind(sz,PPalavras[d],true,subzeropos);
if(findsub!=-1&&findsub==subzeropos)
{
strdel(sz,findsub,findsub+strlen(PPalavras[d]));
for(new h=0;h<strlen(PPalavras[d]);h++)
{
strcat(subzero,"The Brasil Drift, A Melhor do Brasil !");
}
strins(sz,subzero,findsub,256);
strdel(subzero,0,strlen(subzero));
}
}
subzeropos++;
}
IsFlooding[playerid]++;
if(!IsPlayerAdmin(playerid))
{
if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text, false))
{
SendClientMessage(playerid, -1, "{00FF00}[TBD]{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, "{00FF00}[TBD]{FF0000} Vocк foi calado por 1 minuto. {FFFFFF}[Motivo: Flood] !");
SetTimerEx("LiberarChat", 60000, false, "i", playerid);
return 0;
}
else
{
SetTimerEx("SemFlood", 2000, false, "i", playerid);
}
if(strfind(text, "189.", true) != -1 || strfind(text, "201.", true) != -1 || strfind(text, "200.", true) != -1 || strfind(text, "69.", true) != -1 || strfind(text, "187.", true) != -1
|| strfind(text, "64.", true) != -1 || strfind(text, "120.", true) != -1 || strfind(text, "165.", true) != -1 || strfind(text, "85.", true) != -1 || strfind(text, ":7771", true) != -1
|| strfind(text, ":7770", true) != -1 || strfind(text, "7777", true) != -1 || strfind(text, ":7776", true) != -1 || strfind(text, ":7777", true) != -1 || strfind(text, ":7778", true) != -1
|| strfind(text, ":7779", true) != -1 || strfind(text, "1.", true) != -1 || strfind(text, ".br", true) != -1 || strfind(text, ".net", true) != -1 || strfind(text, ".blogspot", true) != -1
|| strfind(text, ".forum", true) != -1 || strfind(text, ".wiki", true) != -1 || strfind(text, "wiki.", true) != -1 || strfind(text, ".info", true) != -1 || strfind(text, "www.", true) != -1
|| strfind(text, ".org", true) != -1 || strfind(text, ".tk", true) != -1 || strfind(text, "co.cc", true) != -1 || strfind(text, "http", true) != -1) {
kBan(playerid, "Divulgou");
Kickp(playerid);
}
if(pDados[playerid][Vip] > 0)
{
new string[168];
format(string, sizeof(string), "[ID:{FF0000}%d{FFFFFF}]{FF0000}[VIP]: {FFFFFF}%s", playerid, text);
SendPlayerMessageToAll(playerid, string);
SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
return 0;
}
if(pDados[playerid][Helper] > 0)
{
new string[168];
format(string, sizeof(string), "[ID:{FF0000}%d{FFFFFF}]{00FFF6}[HELP]: {FFFFFF}%s", playerid, text);
SendPlayerMessageToAll(playerid, string);
SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
return 0;
}
new string[168];
format(string, sizeof(string), "[ID:{FF0000}%d{FFFFFF}]: %s", playerid, text);
SendPlayerMessageToAll(playerid, string);
SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
new otherplayer;
if(AFK[playerid] == true) return SendClientMessage(playerid, VERMELHO, "{3cff00}[TBD] {FFFFFF}Antes de voltar a falar saia do modo AFK !");
if(pDados[otherplayer][pMuteTime] == 1) return SendClientMessage(playerid, VERMELHO, "{3cff00}[TBD] {FFFFFF}Antes de voltar a falar saia do modo AFK !");
return 0;
}
forward SemFlood(playerid);
public SemFlood(playerid)
{
IsFlooding[playerid] = 0;
return 1;
}
forward LiberarChat(playerid);
public LiberarChat(playerid)
{
Flooder[playerid] = 0;
SendClientMessage(playerid, -1, "{00FF00}[TBD] {FFFFFF}Vocк foi descalado, nгo faзa mais flood !");
return 1;
}