unban command ingame doesnt work!
#1

Hey, I have a /unban command, it work good, it says, that I succesfully unbanned the players ip, but when te player try to join the server, he got a message that he is still banned..

Whats wrong?

pawn Код:
CMD:unban(playerid, params[])
{
    new str[128], ip[16];
    if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_ORANGE, "You are not logged in, please login first.");
    if(PlayerAcc[playerid][Admin] == 0) return SendClientMessage(playerid, -1,""orange"Sorry, only admins level 5+ can do that command.");
    if(PlayerAcc[playerid][Admin] >= 5)
    {
        if(sscanf(params, "s[16]", ip)) return SendClientMessage(playerid, COLOR_ORANGE, "You must be type: /unban <ip>");
        if(!stringContainsIP(ip)) return SendClientMessage(playerid, COLOR_RED, "You didn't put a ip!");
        SendClientMessageToAll(COLOR_YELLOW, str);
        format(str, sizeof(str), "You have been unbanned succesfully the ip '%s'", ip);
        SendClientMessage(playerid, COLOR_YELLOW, str);
        strdel(ip, strlen(ip)-2, strlen(ip));
        format(ip, sizeof(ip), "%s", ip);
        format(str, sizeof(str), "unbanip %s", ip);
        SendRconCommand(str);
        SendRconCommand("reloadbans");
    }
    else return ErrorMessages(playerid, 7);
    return 1;
}
Reply
#2

Debug it.

Easy way:

pawn Код:
sscanf(params, "s[16]", ip);
format(str, sizeof(str), "unbanip %s", ip);
SendRconCommand(str);
SendRconCommand("reloadbans");
Reply
#3

Ahh I must be delete this one:
Quote:

format(ip, sizeof(ip), "%s", ip);

and I must be replace it with:
Quote:

sscanf(params, "s[16]", ip);

?
Reply
#4

No no no.

pawn Код:
strdel(ip, strlen(ip)-2, strlen(ip));
format(ip, sizeof(ip), "%s", ip);
What is it? Delete it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)