anti command spam problem
#1

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;
}
Reply
#2

show your CommandSpamCount
Reply
#3

Код:
    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);
    }
??
Reply
#4

bump
Reply
#5

pawn Код:
new SpamCount[MAX_PLAYERS] = 0;

public OnPlayerCommandReceived(playerid, cmdtext[])
{
   if(pInfo[playerid][Jailed] == 1 && pInfo[playerid][pLevel] == 0) return SendClientMessage(playerid,red,"You can not use commands in Jail");
   if(pInfo[playerid][Logged] != 1) return 0;
   new pNAme[30], string[128];
   SpamCount++;
   if(SpamCount == 3)
   {
      GetPlayerName(playerid, pName, sizeof(pName));
      format(string, sizeof(string), "[Anti-Spam]: %s has been kicked for command spamming.", pName);
      SendClientMessageToAll(0xFFFFFFFF, KMessage);
      print(KMessage);
      Kick(playerid);
   }
   SetTimerEx("ResetCount", 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;
}

forward ResetCount(playerid);
public ResetCount(playerid)
{
   SpamCount[playerid] = 0;
   return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)