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;
}