public OnPlayerCommandText(playerid, cmdtext[]) { return 0; } public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if((gettime() - Spamming[playerid]) <= 2 && Spamming[playerid]) { return SendClientMessage(playerid, -1, "[ANTI-FLOOD] COMMAND! Wait a while to use commands again."); } Spamming[playerid] = gettime(); return 1; }
public OnPlayerText(playerid, text[]) { // anti FLOOD if((gettime() - Spamming[playerid]) <= 2 && Spamming[playerid]) { return SendClientMessage(playerid, -1, "[ANTI-FLOOD] TEXT! Wait a while to talk again."); } Spamming[playerid] = gettime(); // anti AD new ver_string[128]; strmid(ver_string, text, 0, strlen(text)); if(FindIpPattern(playerid,ver_string)) { new string[128]; format(string,sizeof(string),"AdmCmd: %s was KICKED from the server. Reason: AD.", PlayerName(playerid)); SendClientMessageToAll(COLOR_LIGHTRED, string); Kick(playerid); return 0; } // MSG new string[128]; if(fmembro[playerid] > 0) { new facdocara[32]; strcat(facdocara, FactionInfo[fmembro[playerid]][facname]); format(string, sizeof(string), "[%s]%s(ID:%i): %s", facdocara, PlayerName(playerid), playerid, text); } else { format(string, sizeof(string), "%s(ID:%i): %s", PlayerName(playerid), playerid, text); } ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); new AnimTime = strlen(text) * 220; ApplyAnimation(playerid, "PED", "IDLE_CHAT",4.1,1,1,1,1,1); SetTimerEx("LimparAnim", AnimTime, false, "i", playerid); return 0; }
SendClientMessage(playerid, -1, "[ANTI-FLOOD] COMMAND! Wait a while to use commands again.");
return 0;
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if((gettime() - Spamming[playerid]) <= 2 && Spamming[playerid])
{
SendClientMessage(playerid, -1, "[ANTI-FLOOD] COMMAND! Wait a while to use commands again.");
return 0;
}
Spamming[playerid] = gettime();
return 1;
}
Vocк deve retornar 0 em ambos os casos.
PHP код:
PHP код:
|