SA-MP Forums Archive
My unban cmd won't work somehow - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: My unban cmd won't work somehow (/showthread.php?tid=465530)



My unban cmd won't work somehow - TonyII - 22.09.2013

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



Re: My unban cmd won't work somehow - DavidLuango - 22.09.2013

One second, I think I found the error.


Re: My unban cmd won't work somehow - TonyII - 22.09.2013

Quote:
Originally Posted by DavidLuango
Посмотреть сообщение
One second, I think I found the error.
Wich is?


Re: My unban cmd won't work somehow - Isolated - 22.09.2013

format(string, sizeof(string), "unbanip %s", BannedIP); Where did you find "BannedIP"?


Re: My unban cmd won't work somehow - TonyII - 22.09.2013

Quote:
Originally Posted by Isolated
Посмотреть сообщение
format(string, sizeof(string), "unbanip %s", BannedIP); Where did you find "BannedIP"?
It's a global string variable


Re: My unban cmd won't work somehow - jakejohnsonusa - 22.09.2013

When you attempt to unban the person does it display this message properly every time "AdmCmd: Admin_Name_Here has unbanned Name_Here" ?


Re: My unban cmd won't work somehow - TonyII - 22.09.2013

Quote:
Originally Posted by jakejohnsonusa
Посмотреть сообщение
When you attempt to unban the person does it display this message properly every time "AdmCmd: Admin_Name_Here has unbanned Name_Here" ?
Yea it does display the message.


Re: My unban cmd won't work somehow - jakejohnsonusa - 22.09.2013

Which part isn't unbanning?

The player file ban?
The samp.ban?


Re: My unban cmd won't work somehow - TonyII - 22.09.2013

None


Re: My unban cmd won't work somehow - TonyII - 25.09.2013

Bump ;(