help limit ips
#1

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;
}
Reply
#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
#3

WILL ANYONE HAVE AN IPS QE LIMITER SERVE?
Reply
#4

Hi,

You can do a whitelist with an array.

Bye.
Reply
#5

Stop using old scripts.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)