GetPlayerIP - get the range
#1

Код:
public OnPlayerConnect(playerid)
{	  
        ....
        new string[128]; 
        format(string, sizeof(string), "playersacc/%s.cer", plname);
        new IPz[16];
        GetPlayerIp(playerid, IPz, sizeof(IPz));
	if(!strcmp(IPz, "197.75.1*") && !fexist(string))
	{
		    SendClientMessage(playerid, REDz, "Your Ip is range banned ;O");
		    Kick(playerid);
	}
        return 1;
}
This is to check the Range of an IP of a player that connects to a server, if this one is not registered he gets kicked because he can't play with this IP.
But it just doesn't work, does anybody know what I've done wrong please? :S
Reply
#2

You can use

!strcmp(IPz, "197.75.1", false, 8 )

as it will only check the first 8 characters. That means, it will detect if the IP starts with your string.
Reply
#3

Yeah man, thanks it worked :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)