unbanip problem
#1

Well i made unbanip for players but it wont work for some reason, i ban someone and use it and when he says he logged in it says hes still banned
pawn Код:
CMD:unbanip(playerid,params[])
{
    if(PlayerData[playerid][AdminLevel] < 2) return 0;
    format(str,sizeof(str),"unbanip %s",Ip);
    SendRconCommand(str);
    SendRconCommand("reloadbans");
    return 1;
}
pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] > 2)
    {
        if(sscanf(params, "us", ID, Reason)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /ban [ID] [reason]");
        if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red, "ERROR: That user is not connected!");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        if(PlayerData[playerid][AdminLevel] < 5 && PlayerData[ID][AdminLevel] > 4) return SendClientMessage(playerid,red,"ERROR: You cannot ban over level 5 admins!");
        GetPlayerName(ID, pname, sizeof(pname));
        format(str, sizeof(str), "Administartor %s has banned %s from the server for: %s",Nam,pname, Reason);
        SendClientMessageToAll(0xFF9900AA, str);
        SendClientMessage(ID,0xFF0000FF,"Banned Wrongfully?? Go to http://www.vercettirp.smfnew.com to make a ban appeal!");
        SendClientMessage(playerid,0xFF9900AA,str);
        GetPlayerIp(ID,tmp3,sizeof(tmp3));
        MessageToAdmins(orange,tmp3);
        Ban(ID);
    }
    else return SendClientMessage(playerid,-1,"SERVER: Unknown command.");
    return 1;
}
Reply
#2

Copy here your ban command
Reply
#3

pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] > 2)
    {
        if(sscanf(params, "us", ID, Reason)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /ban [ID] [reason]");
        if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red, "ERROR: That user is not connected!");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        if(PlayerData[playerid][AdminLevel] < 5 && PlayerData[ID][AdminLevel] > 4) return SendClientMessage(playerid,red,"ERROR: You cannot ban over level 5 admins!");
        GetPlayerName(ID, pname, sizeof(pname));
        format(str, sizeof(str), "Administartor %s has banned %s from the server for: %s",Nam,pname, Reason);
        SendClientMessageToAll(0xFF9900AA, str);
        SendClientMessage(ID,0xFF0000FF,"Banned Wrongfully?? Go to http://www.vercettirp.smfnew.com to make a ban appeal!");
        SendClientMessage(playerid,0xFF9900AA,str);
        GetPlayerIp(ID,tmp3,sizeof(tmp3));
        MessageToAdmins(orange,tmp3);
        Ban(ID);
    }
    else return SendClientMessage(playerid,-1,"SERVER: Unknown command.");
    return 1;
}
Reply
#4

And public Ban...
Reply
#5

i dont have public ban -_- i only need help with unbanip
Reply
#6

Sorry, my mistake...
pawn Код:
CMD:unbanip(playerid,params[])
{
    new Ip[16];
    if(PlayerData[playerid][AdminLevel] < 2) return 0;
    if(sscanf(params, "s[16]", Ip)) return SendClientMessage(playerid, COLOR_GREY, "/unbanip ip");
    format(str,sizeof(str),"unbanip %s",Ip);
    SendRconCommand(str);
    SendRconCommand("reloadbans");
    return 1;
}
Reply
#7

pawn Код:
CMD:unbanip(playerid,params[])
{
    new Ip[16];
    if(PlayerData[playerid][AdminLevel] < 2) return 0;
    if(sscanf(params,"s[16]",Ip)) return SendClientMessage(playerid,0xFFFF6CFF,"USAGE: /unbanip <ip>");
    format(str,sizeof(str),"unbanip %s",Ip);
    SendRconCommand(str);
    SendRconCommand("reloadbans");
    return 1;
}
EDIT: Too late
Reply
#8

i keep getting USAGE: /unbanip <ip>
Reply
#9

Try

pawn Код:
if(sscanf(params,"s[16]+1",Ip)) return SendClientMessage(playerid,0xFFFF6CFF,"USAGE: /unbanip <ip>");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)