14.02.2016, 08:44
Please tell me why this /unban cmd does not work. Whenever i try to unban a person it just says that the person cannot be unbanned because he is banned.
I did not make this cmd i am just a newbie scripter learning to script. I am just trying my hands on this script and trying to gain experience.
I did not make this cmd i am just a newbie scripter learning to script. I am just trying my hands on this script and trying to gain experience.
Код:
CMD:unban(playerid,parmas[]){ if(pInfo[playerid][pAdminLevel] >= 3) { new rename[MAX_PLAYER_NAME],pat[MAX_PLAYER_NAME+10],pati[MAX_PLAYER_NAME+10],ppf[100],adname[MAX_PLAYER_NAME]; if(sscanf(parmas,"s",rename) || isnull(parmas))return SendClientMessage(playerid, -1, "{FF0000}Wrong Usage || Usage : /removeban PlayerName"); format(pat,sizeof(pat),"Bans/%s.ini",rename); if(!fexist(pat)) { format(ppf,sizeof(ppf),"The user cannot be unbanned because there is user named as %s banned.",rename); SendClientMessage(playerid,-1,ppf); return 1; } INI_ParseFile(pat, "LoadIP_%s", .bExtra = true, .extra = playerid); format(pati,sizeof(pat),"IP/%s.ini",ppz); fremove(pati); format(pat,sizeof(pat),"Bans/%s.ini",rename); fremove(pat); format(ppf,sizeof(ppf),"The player %s has been un-banned.",rename); SendClientMessage(playerid,0x00FF00FF,ppf); GetPlayerName(playerid,adname,sizeof(adname)); format(pat,sizeof(pat),"%s has been unbanned by %s",rename,adname); new File:log=fopen("unban_log.txt",io_append); fwrite(log, pat); fwrite(log,"\r\n"); fclose(log); fdeleteline("BannedPlayers.txt", rename); } else SendClientMessage(playerid,-1,"{ff0000}You are not authorized to use this command"); return 1; }