02.08.2014, 10:14
Maybe try this?
pawn Код:
CMD:unban(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 3)
{
new File[50], string[128];
if(sscanf(params, "u[50]",File)) return SendClientMessage(playerid, COLOR_YELLOW, "-XSBot-: Correct Usage: /unban [Player Name]");
format(File, sizeof(File), "Users/%s.ini", params);
if(!fexist(File)) return SendClientMessage(playerid, COLOR_RED, "-XSBot-: This player is not registered.");
new Bnd;
new INI:File = INI_Open(File);
Bnd = INI_Int("Banned", Bnd);
if(Bnd == 0) return SendClientMessage(playerid, COLOR_RED, "-XSBot-: This player is not marked as banned, unable to proceed with unbanning.");
INI_WriteInt(File, "Banned", 0);
INI_Close(File);
format(string, sizeof(string), "%s has been unbanned by %s", File, GetName(playerid));
SaveIn("UnbanLog",string);
format(string, sizeof(string), "-XSBot-: {FF0000}%s {FFFF00}has been unbanned by %s{FFFF00}.", params, GetColorNameID(playerid));
SendClientMessageToAll(COLOR_YELLOW, string);
}
else return SendErrorMessage(playerid, ADMIN_ERROR);
return 1;
}