Hello Here are bugged CMDs in my script, /unban wont unban the player and /unbanip dosent unban an IP
pawn Код:
dcmd_unban(playerid, params[])
{
new name[120], file[126],string[100], string2[100], playerIP[256];
if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pBanAppealer] == 1)
{
if (sscanf(params, "s", name)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /unban [Account Name]");
format(file,sizeof(file),"%s.ini",name);
if(!fexist(file))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid Player Account");
return 1;
}
else
{
format(file, sizeof(file), "%s.ini", name);
new File: hFile = fopen(file, io_append);
if(hFile)
{
new var[32];
playerIP = dini_Get(file, "IP");
format(var, 32, "Band=0");
format(var, 32, "PermBand=0");
format(var, 32, "Disabled=0");
format(var, 32, "Warnings=0");
fwrite(hFile, var);
fclose(hFile);
}
format(string, sizeof(string), "unbanip %s", playerIP);
SendRconCommand(string);
SendRconCommand("reloadbans");
SendClientMessage(playerid, COLOR_YELLOW, "Member Unbanned Successfully !");
format(string2, 256, "AdmCmd: %s has Unbanned Account Name '%s' and IP '%s'",PlayerName(playerid),name,playerIP);
ABroadCast(COLOR_LIGHTRED, string2, 1);
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not Authorized to use this.");
return 1;
}
}
pawn Код:
if(strcmp(cmd,"/unbanip",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pBanAppealer])
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"USAGE: /unbanip [IP Address]");
return 1;
}
format(string,sizeof(string),"unbanip %s",tmp);
SendRconCommand(string);
SendRconCommand("reloadbans");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd: %s has UnBanned IP Address: %s", sendername, tmp);
ABroadCast(COLOR_LIGHTRED,string,1);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not authorized to use that command !");
}
}
return 1;
}