GetPlayerIp - Getting it with strcmp?
#7

Quote:
Originally Posted by Zeex
Try this:

pawn Код:
if (strcmp(ip, "85.76", false, 5) == 0) // 5 means that strcmp compares only first 5 characters which are "85.76"
{
 Kick(playerid);
}
Quote:
Originally Posted by Freddo [BINMAN
]
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 );
    }
Then *.*.85.76 will also match, and *.85.76.* too

Position (optional) The offset to start searching from.

for strfind, it's starting from 0.
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)