Posts: 6,129
Threads: 36
Joined: Jan 2009
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.