Invalid IP Adress
#1

I've made this command , but i don't know why this don't works ...

pawn Код:
if(strcmp(cmd, "/banip", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 1338)
      {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp))
            {
            SendClientMessage(playerid,COLOR_WHITE,"USAGE: /banip [IP]");
            return 1;
            }
            new INVALID;
            for(new i = 0 , j = strlen(string); i < j; i++)
            {
                if(string[i] == '.')
                INVALID++;
            }
            if(INVALID != 3)
            {
                SendClientMessage(playerid,COLOR_YELLOW,"That is not a valid IP address.");
                return 1;
            }
            if(strlen(string[0]) > 18)
            {
                SendClientMessage(playerid,COLOR_YELLOW,"That is not a valid length for a IP address.");
                return 1;
            }
            new name[24];
            new banipstring[64];
            GetPlayerName(playerid,name,sizeof(name));
            format(banipstring,sizeof(banipstring),"banip %s",string);
            format(string,sizeof(string),"[BAN-IP] Name: %s || IP: %d",name,banipstring);
            SendClientMessage(playerid,COLOR_WHITE,string);
            print(string);
            SendRconCommand(banipstring);
            return 1;
        }
        else
        {
          SendClientMessage(playerid,COLOR_WHITE,ADMIN_TEXT);
          return 1;
        }
    }
/banip 5.555.555.555 => This is not a valid ip adress
Reply


Messages In This Thread
Invalid IP Adress - by Danut - 11.03.2009, 18:07
Re: Invalid IP Adress - by MenaceX^ - 11.03.2009, 18:14
Re: Invalid IP Adress - by Danut - 11.03.2009, 18:19
Re: Invalid IP Adress - by MenaceX^ - 11.03.2009, 18:21

Forum Jump:


Users browsing this thread: 1 Guest(s)