UNBAN IP COMMAND
#1

pawn Code:
CMD:unbanip(playerid,params[])
{
    new dformat[50],Float:ip;
    if(APlayerData[playerid][PlayerLevel] < 3) return SendClientMessage(playerid,0xff0000ff,"You have to be admin LVL 3 at least");
    if(sscanf(params,"f",ip)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /unbanip [ip]");
    format(dformat,sizeof(dformat),"unbanip %f",ip);
    SendRconCommand(dformat);
    return 1;
}
Why it doesnt works?
Reply
#2

Because IP isn't a floating-point value .


It should solve your problem :


pawn Code:
CMD:unbanip(playerid,params[])
{
    new dformat[50],ip[16];
    if(APlayerData[playerid][PlayerLevel] < 3) return SendClientMessage(playerid,0xff0000ff,"You have to be admin LVL 3 at least");
    if(sscanf(params,"s",ip)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /unbanip [ip]");
    format(dformat,sizeof(dformat),"unbanip %s",ip);
    SendRconCommand(dformat);
    return 1;
}

I hope that i have helped .
Reply
#3

pawn Code:
CMD:unbanip(playerid,params[])
{
    new ip[32], dformat[64];
    if(APlayerData[playerid][PlayerLevel] < 3) return SendClientMessage(playerid,0xff0000ff,"You have to be admin LVL 3 at least");
    if(sscanf(params,"s[32]",ip)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /unbanip [ip]");
    format(dformat,sizeof dformat,"unbanip %s",ip);
    SendRconCommand(dformat);
    return 1;
}
Reply
#4

Damet how a stupid mistake xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)