Unban IP Not working
#1

Okay, I made a /unbanacc command which allows you to unban someone ofc. I used the same function as /unbanip and that works but here is doesn't. Whats it doing? = Opening the users file searching for the pIP = xx.xx.xx.xx and then Sends a rcon command to unban the ip. It's just not working. It sends me the message of "unbanip xx.xx.xx.xx" but doesn't unban through the samp.ban file.
pawn Код:
CMD:unbanacc(playerid, params[])
{

    if(isnull(params)) {
        return SendClientMessage(playerid, -1, "Usage: /unbanacc [PlayerFile]");
    }

    new filename[MAX_PLAYER_NAME+18];
    format(filename, sizeof(filename), "/ZMA/Users/%s.ini", params);

    if(!fexist(filename)) {
        return SendClientMessage(playerid, -1, "That account doesn't exist!");
    }

    new
        File:file = fopen(filename, io_read),
        string[128],
        Name[20],
        Value[128],
        cash;

    while(fread(file, string)) {
        if(!sscanf(string, "p<=>s[20]s[128]", Name, Value)) {
            if(!strcmp(Name, "pIP ")) {
                cash = strval(Value);
                format(string, sizeof(string), "unbanip%s", cash);
                SendClientMessage(playerid, -1, string);
                SendRconCommand(string);
                SendRconCommand("reloadbans");
                break;
            }
        }
    }
    return true;
}
Reply


Messages In This Thread
Unban IP Not working - by Infinity90 - 21.02.2013, 21:31
Re: Unban IP Not working - by tyler12 - 21.02.2013, 21:34
Re: Unban IP Not working - by Infinity90 - 21.02.2013, 21:36
Re: Unban IP Not working - by Riddy - 22.02.2013, 11:50
Re: Unban IP Not working - by S0n1COwnsYou - 22.02.2013, 11:52
Re: Unban IP Not working - by mamorunl - 22.02.2013, 12:54

Forum Jump:


Users browsing this thread: 4 Guest(s)