Portal SAMP
[Pedido] Anti-BOT - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Pedido] Anti-BOT (/showthread.php?tid=640)



Anti-BOT - Enila182 - 12/01/2021

Olá tudo bem? Alguem ai pode disponibilizar ANTI-BOT?
Varios jogadores entram (não se registram) e consegue entrar com varias contas ao mesmo tempo, dando fake kill em geral

- Ja tenho sistema de MAX_IP
- Ja tenho sistema de anti-fake kill 

mesmo assim não detem eles!


RE: Anti-BOT - Silva - 13/01/2021

Código PHP:
#if !defined varGet
#define varGet(%0)      getproperty(0,%0)
#endif


#if !defined varSet
#define varSet(%0,%1) setproperty(0, %0, %1)
#endif

stock botGetIP[24];

#define IsPlayerBot(%0)\
            
GetPlayerPing(%0) == 65535 && (gettime() - varGet((GetPlayerIp(%0botGetIPsizeof botGetIP), botGetIP)) > 5)

hook OnPlayerConnect(playerid)
{

    if(
IsPlayerNPC(playerid)) return false;
    static 
playerip[24];
    
GetPlayerIp(playeridplayerip24);
    if(
gettime() - varGet(playerip) < 2)
    {
        
strcat(playerip"di_S");
        if(
gettime() - varGet(playerip) < 3)
        {
            return 
false;
        }
        
printf("%d Entrou em menos de 2 segundos"playerid);
        
GetPlayerIp(playeridplayerip20);
        
varSet(playeripgettime());
        
strcat(playerip"x");
        static 
timers ;
        
timers varGet(playerip);
        
varSet(playerip1timers);
        if(
timers 2)
        {
            
playerip[strlen(playerip) - 2] = 0;
            
printf("BOT: ID -> %d IP -> %s"playeridplayerip);
            
BanEx(playerid"Bot Connect");
        }
    }
    return 
varSet(playeripgettime());
}


hook OnPlayerDisconnect(playeridreason)
{
    if(
reason == 2)
    {
        static 
playerip[20];
        
GetPlayerIp(playeridplayerip20);
        
strcat(playerip"di_S");
        
varSet(playeripgettime());
    }
    return 
1;