GetPlayerIp - Getting it with strcmp?
#5

Quote:
Originally Posted by Jakku
I have a total blackout in GetPlayerIp. I wrote this:


pawn Код:
new ip[16];
 GetPlayerIp(playerid, ip, sizeof(ip));
 if(!strcmp(ip, "85.76.*.*")) {
 Kick();
 }

Somehow, it doesn't take effect. Maybe I have a wrong syntax with the IP or something?
You can't use wildcards in strcmp().

pawn Код:
new ip[32];
    GetPlayerIp(playerid, ip, sizeof(ip));
    if( strfind( ip, "85.76", true, 0 ) != -1 )
    {
      // They're on the 85.76.*.* range (we're checking the string (ip) from cell 0 to the last cell used in the substring.
        Kick( playerid );
    }
Reply


Messages In This Thread
GetPlayerIp - Getting it with strcmp? - by Jakku - 21.05.2010, 14:42
Re: GetPlayerIp - Getting it with strcmp? - by DJDhan - 21.05.2010, 14:45
Re: GetPlayerIp - Getting it with strcmp? - by Jakku - 21.05.2010, 14:47
Re: GetPlayerIp - Getting it with strcmp? - by WackoX - 21.05.2010, 14:48
Re: GetPlayerIp - Getting it with strcmp? - by Calgon - 21.05.2010, 14:49
Re: GetPlayerIp - Getting it with strcmp? - by Zeex - 21.05.2010, 15:05
Re: GetPlayerIp - Getting it with strcmp? - by Calgon - 21.05.2010, 15:32
Re: GetPlayerIp - Getting it with strcmp? - by ¤Adas¤ - 21.05.2010, 15:39
Re: GetPlayerIp - Getting it with strcmp? - by Zeex - 21.05.2010, 16:24
Re: GetPlayerIp - Getting it with strcmp? - by ¤Adas¤ - 21.05.2010, 18:06

Forum Jump:


Users browsing this thread: 1 Guest(s)