SA-MP Forums Archive
/unbanip command not working. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /unbanip command not working. (/showthread.php?tid=98058)



/unbanip command not working. - _Vortex - 18.09.2009

Hey, I made a unban ip command, and it's not removeing the IP from samp.ban..

Here's the code:

pawn Код:
dcmd_unbanip(playerid,params[])
{
    new ip[21], string[128];
    if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_RED,"You must be level 3 to unban someone!");
    if(sscanf(params, "s", ip)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /unbanip [ip]");

    format(string, sizeof(string), "unbanip %s", ip);
    SendRconCommand(string);
    SendClientMessage(playerid,COLOR_LIGHTGREEN,"IP unbanned.");
    return 1;
}
Any ideas?


Re: /unbanip command not working. - Mikep. - 18.09.2009

Why use sscanf? I see no point.

pawn Код:
dcmd_unbanip(playerid,params[])
{
  new string[128];
  if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_RED,"You must be level 3 to unban someone!");
  if(!strlen(params)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /unbanip [ip]");
  format(string, sizeof(string), "unbanip %s", params);
  SendRconCommand(string);
  SendRconCommand("reloadbans");
  SendClientMessage(playerid,COLOR_LIGHTGREEN,"IP unbanned.");
  return 1;
}
Also you have to reloadbans to reload samp.ban.


Re: /unbanip command not working. - _Vortex - 18.09.2009

Quote:
Originally Posted by Mikep.
Why use sscanf? I see no point.

pawn Код:
dcmd_unbanip(playerid,params[])
{
  new string[128];
  if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_RED,"You must be level 3 to unban someone!");
  if(!strlen(params)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /unbanip [ip]");
  format(string, sizeof(string), "unbanip %s", params);
  SendRconCommand(string);
  SendRconCommand("reloadbans");
  SendClientMessage(playerid,COLOR_LIGHTGREEN,"IP unbanned.");
  return 1;
}
Also you have to reloadbans to reload samp.ban.
Thanks