My unban cmd won't work somehow
#1

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;
}
Reply
#2

One second, I think I found the error.
Reply
#3

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

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

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

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

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.
Reply
#8

Which part isn't unbanning?

The player file ban?
The samp.ban?
Reply
#9

None
Reply
#10

Bump ;(
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)