SA-MP Forums Archive
unban cmd help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: unban cmd help (/showthread.php?tid=459903)



unban cmd help - efrim123 - 25.08.2013

Hello Everyone,
i have made a ban command
but i cant make a unban command
because i dont know how can someone
script me a unban command please??
and if you can make it zcmd please cause i use zcmd for this

if yes Thanks.

Regratz efrim142,


Re: unban cmd help - CrazyChoco - 25.08.2013

If you know how you made your Ban, Then just fod the oppesite of it.


Re: unban cmd help - xXSPRITEXx - 25.08.2013

Код:
CMD:unbanip(playerid,params[])
{
    new ip[32], dformat[64];
    if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,0xff0000ff,"You have to be admin LVL 3 at least");
    if(sscanf(params,"s[32]",ip)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /unbanip [ip]");
    format(dformat,sizeof dformat,"unbanip %s",ip);
    SendRconCommand(dformat);
    return 1;
}



Re: unban cmd help - efrim123 - 25.08.2013

i need a normal unban
and plus i tested my ban command but its only kicks me
so can you give me a ban and unban command


Re: unban cmd help - PrinceKumar - 25.08.2013

Why u don't search for it on ****** or samp search you will get better unban n ban cmd(s)


Re: unban cmd help - efrim123 - 25.08.2013

i searched but its too hard to find a good one
when i found one that looks ok it only kicks the player and not ban him


Re: unban cmd help - Dragonsaurus - 25.08.2013

To make an unban command, we need more info about saving system and variables you use, or just use unbanip command, which is easier and can be found by searching. BTW here is the code for ban command:
pawn Код:
CMD:ban(playerid, params[])
{
     if(IsPlayerAdmin(playerid))
     {
          new player1, reason[128];
          if(sscanf(params, "us[128]", player1, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /ban [Player ID] [Reason]")
          new playername[MAX_PLAYER_NAME];
          new adminname [MAX_PLAYER_NAME];
          if(IsPlayerConnected(player1))
          {
               GetPlayerName(player1, playername, sizeof(playername));
               GetPlayerName(playerid, adminname, sizeof(adminname));
               format(string,sizeof(string),"%s has been banned by administrator %s [Reason: %s]",playername,adminname,reason);
               SendClientMessageToAll(0xFF0000FF,string);
               print(string);
               new ip[24];
               GetPlayerIP(player1, ip, sizeof(ip))
               format(string, sizeof(string), "banip %s", ip);
               SendRconCommand(string);
               format(string, sizeof(string), "You are banned by administrator %s [Reason: %s]", adminname, reason);
               BanEx(player1, string);
          }
          else SendClientMessage(playerid, red, "ERROR: Player is not connected");
     }
     else SendClientMessage(playerid, red, "ERROR: You have to be admin to use this command!");
     return 1;
}



Re: unban cmd help - efrim123 - 25.08.2013

I fixed all the errors but when i ban myself then i relog and i aint banned it is auto unbanning me


Re: unban cmd help - Konstantinos - 25.08.2013

Quote:
Originally Posted by efrim123
Посмотреть сообщение
i searched but its too hard to find a good one
when i found one that looks ok it only kicks the player and not ban him
They kick instead of banning because if the banned player comes back, he will be able to see the reason he was banned and more information. If they used the Ban function, the banned player would only see "You are banned from that server." message.


Re: unban cmd help - efrim123 - 25.08.2013

so how do i make it that after i am getting banned i cant rejoin and type my password??