custom banlist
#3

forgot to add the whole code, so with the code below it works (because it search for 127.0.0.1 and my ip is also 127.0.0.1:

pawn Код:
public OnPlayerConnect(playerid)
{
    new idx;
    new IP[4][256];
    new str[128];
    GetPlayerIp(playerid,str,sizeof(str));
    IP[0] = strtok(str, idx, '.');
    IP[1] = strtok(str, idx, '.');
    IP[2] = strtok(str, idx, '.');
    IP[3] = strtok(str, idx, '.');
   
    if(!strcmp(IP[0],"127",false) && !strcmp(IP[1],"0",false) && !strcmp(IP[2],"0",false) && !strcmp(IP[3],"1",false))
    {
        new string[128];
        format(string,sizeof(string),"Your IP: %s is range banned!",str);
        SendClientMessage(playerid,_COLOR_RED,string);
Kick(playerid);
    }
return 1;
...
}
but when I change that it searchs for 127.0.*.* while my ip is 127.0.0.1, it doesn't work:

pawn Код:
public OnPlayerConnect(playerid)
{
    new idx;
    new IP[4][256];
    new str[128];
    GetPlayerIp(playerid,str,sizeof(str));
    IP[0] = strtok(str, idx, '.');
    IP[1] = strtok(str, idx, '.');
    IP[2] = strtok(str, idx, '.');
    IP[3] = strtok(str, idx, '.');
   
    if(!strcmp(IP[0],"127",false) && !strcmp(IP[1],"0",false) && !strcmp(IP[2],"*",false) && !strcmp(IP[3],"*",false))
    {
        new string[128];
        format(string,sizeof(string),"Your IP: %s is range banned!",str);
        SendClientMessage(playerid,_COLOR_RED,string);
Kick(playerid);
    }
return 1;
...
}
Reply


Messages In This Thread
custom banlist - by Ribber - 26.12.2010, 15:17
Re: custom banlist - by WillyP - 26.12.2010, 15:19
AW: custom banlist - by Ribber - 26.12.2010, 15:24
Re: custom banlist - by WillyP - 26.12.2010, 15:27
AW: custom banlist - by Ribber - 26.12.2010, 15:30
Re: custom banlist - by WillyP - 26.12.2010, 15:34
AW: custom banlist - by Ribber - 26.12.2010, 15:40
Re: custom banlist - by WillyP - 26.12.2010, 15:40
AW: Re: custom banlist - by Ribber - 26.12.2010, 15:46
Re: custom banlist - by WillyP - 26.12.2010, 15:49

Forum Jump:


Users browsing this thread: 1 Guest(s)