SA-MP Forums Archive
help limit ips - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help limit ips (/showthread.php?tid=655324)



help limit ips - nbx2000 - 18.06.2018

how to make a simple ips limiter


this code is bug
Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) {
        new server_IP[16];
        format(server_IP, 16, "127.0.0.1");

        if(strcmp(ConnIP,server_IP,true) != 0) {
            Ban(playerid); // Ban is the safest thing here, as if you kick, they can still flood you with endless connections
            return 0;
        }
    } 
    return 1;
}



Re: help limit ips - Calisthenics - 18.06.2018

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;
}



Re: help limit ips - nbx2000 - 19.06.2018

WILL ANYONE HAVE AN IPS QE LIMITER SERVE?


Re: help limit ips - Gameluner - 19.06.2018

Hi,

You can do a whitelist with an array.

Bye.


Re: help limit ips - GTLS - 19.06.2018

Stop using old scripts.

and search before you post here. - https://sampforum.blast.hk/showthread.php?tid=321533