Working anti-reconnect.
#8

Quote:
Originally Posted by Scottas
Посмотреть сообщение
probably there are some tools. After player disconnects, get timestamp and ip.When player connects, compare his IP, check time passed and if there is something wrong - kick him.
as far as I know, you can't get someone's IP when they disconnect.

Uh, a small idea i guess.. Dunno if It will help, not tested either xD

pawn Код:
#include <a_samp>
#include <foreach>

new PlayerIP[ MAX_PLAYERS ];

public OnPlayerConnect(playerid)
{
    new pIP[16];
    PlayerIP[ playerid ] = GetPlayerIp(playerid, pIP, sizeof(pIP));
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SetTimerEx("CheckIP", 1500, false, "i", playerid);
    return 1;
}

forward CheckIP(playerid);
public CheckIP(playerid)
{
    new pIP[16];
    foreach(Player, i)
    {
        GetPlayerIp(i, pIP, sizeof(pIP));
        if(strcmp(PlayerIP[ playerid ], pIP) == 0)
        {
            new pName[ MAX_PLAYER_NAME ];
            GetPlayerName(playerid, pName, sizeof(pName));
            printf("%s has used a 'reconnect' exploit/hack, kicking..", pName);
            Kick(playerid);
        }
    }
    return 1;
}
Not tested.. Increasing the timer might help( if something weird happens ), dunno :d
Reply


Messages In This Thread
Working anti-reconnect. - by tuuler - 17.07.2014, 17:29
Re: Working anti-reconnect. - by GeekSiMo - 17.07.2014, 17:30
Re: Working anti-reconnect. - by tuuler - 17.07.2014, 17:33
Re: Working anti-reconnect. - by GeekSiMo - 17.07.2014, 17:37
Re: Working anti-reconnect. - by tuuler - 17.07.2014, 17:38
Re: Working anti-reconnect. - by Scottas - 17.07.2014, 17:42
Re: Working anti-reconnect. - by tuuler - 17.07.2014, 17:44
Re: Working anti-reconnect. - by Kyance - 17.07.2014, 17:58
Re: Working anti-reconnect. - by Scottas - 17.07.2014, 18:04
Re: Working anti-reconnect. - by tuuler - 17.07.2014, 18:28

Forum Jump:


Users browsing this thread: 1 Guest(s)