BanIP
#1

So, I've made this command, but when I /banip, it sends that "Admin %s has banned IP ( [%s ) when I don't have a "[" in sight. Any ideas?

EDIT: Also sent "Banned IP [insertIPhere" in RCON.

pawn Код:
if(strcmp(cmd, "/banip", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GREY, "  <| USAGE: /banip [ip] |>");
                return 1;
            }
            if(PlayerStats[playerid][pAdmin] >= 6)
            {
                new ip;
                ip = strval(tmp);
                format(string, sizeof(string), "banip %s", ip);
                SendRconCommand(string);
                SendRconCommand("reloadbans");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "  <| Admin %s has banned IP: ( %s ) |>", sendername, ip);
                SendClientMessageToAll(COLOR_LIGHTRED, string);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "  <| You must be an Administrator to use this command! |>");
                return 1;
            }
        }
        return 1;
    }
Reply


Messages In This Thread
BanIP - by TyThaBomb - 18.04.2012, 00:01
Re: BanIP - by PrawkC - 18.04.2012, 00:22
Re: BanIP - by TyThaBomb - 18.04.2012, 02:03
Re: BanIP - by SuperViper - 18.04.2012, 02:08
Re: BanIP - by TyThaBomb - 18.04.2012, 02:22

Forum Jump:


Users browsing this thread: 1 Guest(s)