UNBAN IP COMMAND - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: UNBAN IP COMMAND (
/showthread.php?tid=299352)
UNBAN IP COMMAND -
wumpyc - 25.11.2011
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?
Re: UNBAN IP COMMAND - rjjj - 25.11.2011
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

.
Re: UNBAN IP COMMAND -
HyperZ - 25.11.2011
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;
}
Re: UNBAN IP COMMAND -
wumpyc - 25.11.2011
Damet how a stupid mistake xD