help limit ips
#2

ConnIP is empty, holds the previous IP or changes value in another place. You need to get the IP directly.

pawn Код:
public OnPlayerConnect(playerid)
{
    new player_ip[16];
    GetPlayerIp(playerid, player_ip, 16);

    if (IsPlayerNPC(playerid) && strcmp(player_ip, "127.0.0.1"))
    {
        Ban(playerid); // Ban is the safest thing here, as if you kick, they can still flood you with endless connections
        return 0;
    }

    // ...
    return 1;
}
Reply


Messages In This Thread
help limit ips - by nbx2000 - 18.06.2018, 18:57
Re: help limit ips - by Calisthenics - 18.06.2018, 20:42
Re: help limit ips - by nbx2000 - 19.06.2018, 01:03
Re: help limit ips - by Gameluner - 19.06.2018, 03:47
Re: help limit ips - by GTLS - 19.06.2018, 06:27

Forum Jump:


Users browsing this thread: 1 Guest(s)