13.03.2015, 16:36
when i enter game and when i spam there is not kick for spam commands?? help
Код:
public OnPlayerCommandReceived(playerid, cmdtext[]) { if(pInfo[playerid][Jailed] == 1 && pInfo[playerid][pLevel] == 0) { SendClientMessage(playerid,red,"You can not use commands in Jail"); return 0; } if(pInfo[playerid][Logged] == 1) { new TCount, KMessage[128]; TCount = GetPVarInt(playerid, "CommandSpamCount"); TCount++; SetPVarInt(playerid, "CommandSpamCount", TCount); if(TCount == 3) { GetPlayerName(playerid, KMessage, sizeof(KMessage)); format(KMessage, sizeof(KMessage), "[Anti-Spam]: %s has been kicked for command spamming.", KMessage); SendClientMessageToAll(0xFFFFFFFF, KMessage); print(KMessage); Kick(playerid); } SetTimerEx("ResetCommandCount", SpamLimit, false, "i", playerid); } if(ReadCommands == 1) { format(Cmdstr, sizeof(Cmdstr), ">>> %s(%d) Used command: %s", GetName(playerid),playerid,cmdtext); foreach(Player, i) { if(pInfo[i][pLevel] >= 1 && pInfo[i][pLevel] > pInfo[playerid][pLevel] && i != playerid) { SendClientMessage(i, Cmdcolor, Cmdstr); } } } return 1; }