/ban Command problem
#1

So, when i use /ban on someone, then after a while when someone joins a server, he gets automatically kicked, saying: You are banned from this server, they both (the one who is banned and the one who has got unfairly kicked) have different ips, i don't know what to do so..

pawn Код:
COMMAND:ban(playerid, params[])
{
    new id, reason[60], Message8[128], PNAME8[MAX_PLAYER_NAME],PNAME9[MAX_PLAYER_NAME];

    if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, 0xFF0000AA, "You Are Not An Administrator!");
    if (sscanf(params, "us[60]", id, reason)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /ban <playerid/partname> <reason>");
    if (strlen(reason) < 0 || strlen(reason) == 0) return SendClientMessage(playerid, 0xFF0000AA,"No Reason Given!");
    if (strlen(reason) <= 5 || strlen(reason) >= 25) return SendClientMessage(playerid, 0xFF0000AA,"Invalid Reason!");
    if (id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "Player Not Connected");
    if(PlayerInfo[playerid][pAdmin] <= PlayerInfo[id][pAdmin]) return SendClientMessage(playerid, COLOR_RED,"You cannot use this command on higher level or in an admin with your lvl!");
    GetPlayerName(playerid, PNAME9, MAX_PLAYER_NAME);
    GetPlayerName(id, PNAME8, MAX_PLAYER_NAME);
    if(PlayerInfo[playerid][pAdmin] > 0)
    {
          switch(PlayerInfo[playerid][pAdmin])
          {
          case 1: AdmRank = "Trial Moderator";
          case 2: AdmRank = "Moderator";
          case 3: AdmRank = "Master Moderator";
          case 4: AdmRank = "Trial Administrator";
          case 5: AdmRank = "Administrator";
          case 6: AdmRank = "Master Administrator";
          case 7: AdmRank = "Head Administrator";
          case 8: AdmRank = "Trusted Administrator";
          case 9: AdmRank = "Co-Owner";
          case 10: AdmRank = "Owner";
          }
          format(Message8, sizeof (Message8), "You Have Been Banned By The %s %s (%d).",AdmRank ,PNAME9 ,playerid);
          SendClientMessage(id, 0xFFC400AA, "If You Feel That You Are Wrongly Banned Feel Free To Post An Appeal In Forum: lsgangwars.createaforum.com");
          format(Message8, sizeof (Message8), "The {FF0000}%s {FFAE00}%s (%d) Has Banned %s (%d) | Reason: %s.",AdmRank ,PNAME9 ,playerid, PNAME8, id, reason);
          SendClientMessageToAll(0xFFAE00AA, Message8);
          SetPVarString(id, "BanReason",reason);
          SetTimerEx("BanExDelay", false, 1000, "i",id);
          Info[id][Banned] = 1;
    }
    foreach(Player, i)
    {
         if(PlayerInfo[i][pAdmin] > 0)
         {
            format(Message8, sizeof(Message8), "[ADM] The {FF0000}%s {FF5900}%s (%d) Has Banned %s (%d) | Reason: %s.",AdmRank, PNAME9, playerid, PNAME8, id, reason), SendClientMessage(i, 0xFF5900FF, Message8);
            print(Message8);
         }
    }
    return 1;
}
forward BanExDelay(playerid);
public BanExDelay(playerid)
{
    new reason[60];
    GetPVarString(playerid, "BanReason",reason, sizeof(reason));
    BanEx(playerid, reason);
    return 1;
}
plz help me.
Reply


Messages In This Thread
/ban Command problem - by Youssef221 - 26.01.2015, 13:28
Re: /ban Command problem - by ATGOggy - 26.01.2015, 14:30
Re: /ban Command problem - by Youssef221 - 26.01.2015, 15:00
Re: /ban Command problem - by ATGOggy - 26.01.2015, 15:17
Re: /ban Command problem - by Youssef221 - 26.01.2015, 15:19
Re: /ban Command problem - by denNorske - 26.01.2015, 15:23
Re: /ban Command problem - by Youssef221 - 26.01.2015, 15:24
Re: /ban Command problem - by ATGOggy - 26.01.2015, 15:34
Re: /ban Command problem - by Youssef221 - 26.01.2015, 18:24

Forum Jump:


Users browsing this thread: 3 Guest(s)