[FS] Anti aimbot logico por Biel_COP

Uma coisa que vem aterrorizando quaisquer servidores de SA-MP, após a versão da mudança do lag compensation, são os aimbots.

Já há várias formas de se burlar/detectar aimbot, como detectar se o player está mirando para o outro ou não, se o modo 'TARGET' de tal player é o player atingido, e etc.

Porém, sempre há novos e novos aimbots, que estão cada vez mais burlando estes códigos.

Hoje, vim aqui apresentar o 'anti aimbot lógico', que utiliza a lógica de um combate sem cheaters/programas ilegais, e não um simples sistema de bloqueio, vendo se o player está ou não mirando para o outro (coisa que já é possível burlar, infelizmente).

A lógica é a seguinte:

Se o player conseguir, por ventura, acertar 5 disparos SEGUIDOS no outro player, correndo, é provável aimbot.
Se o player conseguir, por ventura, acertar 10 disparos SEGUIDOS no outro player, andando, é provável aimbot.

Levando na base de um combate sem 'hackers', não é nem um pouco fácil obter sucesso em fazer qualquer um dos feitos citados acima.

Foto dos testes (prestem atenção no chat)





Créditos

Biel_COP - lógica/código
zDanTee_TraaP - testes.


Código:
// Anti aimbot lógico
// Créditos: Biel_COP (lógica/código) e zDanTee_TraaP (testes)
// Acesse o servidor RPG mais bem elaborado do SA-MP Brasil: ip.cidadesocial.com ;)

#include a_samp.inc // include nativa do SA-MP

#define Total_Players 100 // Edite ao seu gosto
#define Criar_Logs 1 // 0 = não, 1 = sim
#define Arquivo_Logs "Players usando aimbot.txt" // Arquivo que salvará as logs, caso a opção de salvamento esteja ativada

// Função criada por Biel_COP, para a include bCini8 (não postada no fórum SA-MP, até o momento)

#if Criar_Logs

 #define bCini8_Log(%0,%1) new File:bCini8_Archive = fopen(%0,io_append); fwrite(bCini8_Archive,%1) && fclose(bCini8_Archive)

#endif

new Tiros_Aimbot[Total_Players],Caminhando_Aimbot[Total_Players],Correndo_Aimbot[Total_Players],Funcionamento_Anti_Aimbot[Total_Players],Fala_Aimbot[128];

// Funções públicas

public OnPlayerConnect(playerid)
{
 Tiros_Aimbot[playerid] = 0;
 Caminhando_Aimbot[playerid] = 0;
 Correndo_Aimbot[playerid] = 0;
}
public OnPlayerWeaponShot(playerid,weaponid,hittype,hitid,Float:fX,Float:fY,Float:fZ)
{
 if(!IsPlayerInAnyVehicle(playerid) && IsPlayerConnected(hitid))
 {
     if(hittype == BULLET_HIT_TYPE_PLAYER)
     {
   if(Velocidade_Player(hitid) && Caminhando_Aimbot[hitid] < gettime())
   {
    ++Tiros_Aimbot[playerid];

    if(Correndo_Aimbot[hitid] < gettime()) // Se o player estiver andando
    {
        if(Tiros_Aimbot[playerid] >= 10)
        {
                     if(!Funcionamento_Anti_Aimbot[playerid])
      {
       Usando_Aimbot(playerid);
         }
         return 0;
     }
    }
    else // Se o player estiver correndo
    {
        if(Tiros_Aimbot[playerid] >= 5)
        {
                     if(!Funcionamento_Anti_Aimbot[playerid])
      {
       Usando_Aimbot(playerid);
         }
         return 0;
     }
    }
   }
   else
   {
       Tiros_Aimbot[playerid] = 0;
   }
  }
 }
 else
 {
     Tiros_Aimbot[playerid] = 0;
 }
 return 1;
}
new Tecla[Total_Players][3];

public OnPlayerUpdate(playerid)
{
 GetPlayerKeys(playerid,Tecla[playerid][0],Tecla[playerid][1],Tecla[playerid][2]);

 if(Tecla[playerid][0] & KEY_WALK)
 {
  Caminhando_Aimbot[playerid] = gettime()+1;
 }
 if(Tecla[playerid][0] & KEY_SPRINT)
 {
  Correndo_Aimbot[playerid] = gettime()+1;
 }
 return 1;
}
Zerar_Funcionamento_Anti_Aimbot(playerid);

public Zerar_Funcionamento_Anti_Aimbot(playerid)
{
 Funcionamento_Anti_Aimbot[playerid] = 0;
}
// Funções que não são do tipo 'public'

Nome(playerid)
{
 new Nome_Player[21];

 GetPlayerName(playerid,Nome_Player,sizeof(Nome_Player));

 return Nome_Player;
}
Velocidade_Player(playerid)
{
 new Float:Velocidade[3];

 GetPlayerVelocity(playerid,Velocidade[0],Velocidade[1],Velocidade[2]);

 return floatround(floatsqroot((Velocidade[0]*Velocidade[0])+(Velocidade[1]*Velocidade[1])+(Velocidade[2]*Velocidade[2]))*25);
}
Usando_Aimbot(playerid)
{
    format(Fala_Aimbot,sizeof(Fala_Aimbot),"Player %s [%d] está provavelmente usando aimbot!",Nome(playerid),playerid);
 SendClientMessageToAll(0xDBD060AA,Fala_Aimbot);

 Funcionamento_Anti_Aimbot[playerid] = 1;
 SetTimerEx("Zerar_Funcionamento_Anti_Aimbot",10000,0,"i",playerid);

 #if Criar_Logs

  Escrever_Log(Arquivo_Logs,Fala_Aimbot);

 #endif
}
// Funções dependentes de definições

stock Escrever_Log(arquivo[],texto[])
{
 new Horario[6],Fala[256];

 getdate(Horario[0],Horario[1],Horario[2]);
 gettime(Horario[3],Horario[4],Horario[5]);

 format(Fala,sizeof(Fala),"%d/%d/%d, às %d:%d:%d - %s\r\n",Horario[2],Horario[1],Horario[0],Horario[3],Horario[4],Horario[5],texto);

 bCini8_Log(arquivo,Fala);
}


0 Comentários:

Postar um comentário








FACEBOOK UNIDADE SAMP