22.09.2013, 19:01
Hey, it won't unban the player the player just stays banned. Here is the cmd.
pawn Код:
CMD:unban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}You aren't authorized to use this command.");
new string[128],name[24];
if(sscanf(params, "s[24]", name)) return SendClientMessage(playerid,COLOR_DARKRED,"[SERVER] {FFFFFF}USAGE: /unban [Firstname_Lastname] ");
new filestring[79];
format(filestring, sizeof(filestring), "/Users/%s.ini", name);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_DARKRED, "[SERVER] {FFFFFF}Invalid player name.");
else
{
INI_ParseFile(filestring, "LoadIP_%s");
format(string, sizeof(string), "unbanip %s", BannedIP);
SendRconCommand(string);
format(string, sizeof(string), "unban %s", name);
SendRconCommand(string);
SendRconCommand("reloadbans");
new INI:File = INI_Open(filestring);
INI_SetTag(File, "data");
INI_WriteInt(File, "Banned", 0);
INI_Close(File);
new done[78];
format(done, sizeof(done),"AdmCmd: %s has unbanned %s",RPN(playerid), name);
Admin(COLOR_ADMIN,done,2);
}
return 1;
}