/unbanip command not working.
#1

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?
Reply
#2

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.
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)