Advertisement
DetonaSampOficial

[FILTERSCRIPT] Anti aimbot lógico

Jun 4th, 2016
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. /*
  2. ARQUIVO BAIXADO NA DETONA SAMP
  3. TUDO PARA SEU SERVIDOR SAMP
  4. www.detonasampoficial.blogspot.com.br
  5. */
  6. // Anti aimbot lógico
  7. // Créditos: Biel_COP (lógica/código) e zDanTee_TraaP (testes)
  8. // Acesse o servidor RPG mais bem elaborado do SA-MP Brasil: ip.cidadesocial.com ;)
  9.  
  10. #include a_samp.inc // include nativa do SA-MP
  11.  
  12. #define Total_Players 100 // Edite ao seu gosto
  13. #define Criar_Logs 1 // 0 = não, 1 = sim
  14. #define Arquivo_Logs "Players usando aimbot.txt" // Arquivo que salvará as logs, caso a opção de salvamento esteja ativada
  15.  
  16. // Função criada por Biel_COP, para a include bCini8 (não postada no fórum SA-MP, até o momento)
  17.  
  18. #if Criar_Logs
  19.  
  20. #define bCini8_Log(%0,%1) new File:bCini8_Archive = fopen(%0,io_append); fwrite(bCini8_Archive,%1) && fclose(bCini8_Archive)
  21.  
  22. #endif
  23.  
  24. new Tiros_Aimbot[Total_Players],Caminhando_Aimbot[Total_Players],Correndo_Aimbot[Total_Players],Funcionamento_Anti_Aimbot[Total_Players],Fala_Aimbot[128];
  25.  
  26. // Funções públicas
  27.  
  28. public OnPlayerConnect(playerid)
  29. {
  30. Tiros_Aimbot[playerid] = 0;
  31. Caminhando_Aimbot[playerid] = 0;
  32. Correndo_Aimbot[playerid] = 0;
  33. }
  34. public OnPlayerWeaponShot(playerid,weaponid,hittype,hitid,Float:fX,Float:fY,Float:fZ)
  35. {
  36. if(!IsPlayerInAnyVehicle(playerid) && IsPlayerConnected(hitid))
  37. {
  38. if(hittype == BULLET_HIT_TYPE_PLAYER)
  39. {
  40. if(Velocidade_Player(hitid) && Caminhando_Aimbot[hitid] < gettime())
  41. {
  42. ++Tiros_Aimbot[playerid];
  43.  
  44. if(Correndo_Aimbot[hitid] < gettime()) // Se o player estiver andando
  45. {
  46. if(Tiros_Aimbot[playerid] >= 10)
  47. {
  48. if(!Funcionamento_Anti_Aimbot[playerid])
  49. {
  50. Usando_Aimbot(playerid);
  51. }
  52. return 0;
  53. }
  54. }
  55. else // Se o player estiver correndo
  56. {
  57. if(Tiros_Aimbot[playerid] >= 5)
  58. {
  59. if(!Funcionamento_Anti_Aimbot[playerid])
  60. {
  61. Usando_Aimbot(playerid);
  62. }
  63. return 0;
  64. }
  65. }
  66. }
  67. else
  68. {
  69. Tiros_Aimbot[playerid] = 0;
  70. }
  71. }
  72. }
  73. else
  74. {
  75. Tiros_Aimbot[playerid] = 0;
  76. }
  77. return 1;
  78. }
  79. new Tecla[Total_Players][3];
  80.  
  81. public OnPlayerUpdate(playerid)
  82. {
  83. GetPlayerKeys(playerid,Tecla[playerid][0],Tecla[playerid][1],Tecla[playerid][2]);
  84.  
  85. if(Tecla[playerid][0] & KEY_WALK)
  86. {
  87. Caminhando_Aimbot[playerid] = gettime()+1;
  88. }
  89. if(Tecla[playerid][0] & KEY_SPRINT)
  90. {
  91. Correndo_Aimbot[playerid] = gettime()+1;
  92. }
  93. return 1;
  94. }
  95. Zerar_Funcionamento_Anti_Aimbot(playerid);
  96.  
  97. public Zerar_Funcionamento_Anti_Aimbot(playerid)
  98. {
  99. Funcionamento_Anti_Aimbot[playerid] = 0;
  100. }
  101. // Funções que não são do tipo 'public'
  102.  
  103. Nome(playerid)
  104. {
  105. new Nome_Player[21];
  106.  
  107. GetPlayerName(playerid,Nome_Player,sizeof(Nome_Player));
  108.  
  109. return Nome_Player;
  110. }
  111. Velocidade_Player(playerid)
  112. {
  113. new Float:Velocidade[3];
  114.  
  115. GetPlayerVelocity(playerid,Velocidade[0],Velocidade[1],Velocidade[2]);
  116.  
  117. return floatround(floatsqroot((Velocidade[0]*Velocidade[0])+(Velocidade[1]*Velocidade[1])+(Velocidade[2]*Velocidade[2]))*25);
  118. }
  119. Usando_Aimbot(playerid)
  120. {
  121. format(Fala_Aimbot,sizeof(Fala_Aimbot),"Player %s [%d] está provavelmente usando aimbot!",Nome(playerid),playerid);
  122. SendClientMessageToAll(0xDBD060AA,Fala_Aimbot);
  123.  
  124. Funcionamento_Anti_Aimbot[playerid] = 1;
  125. SetTimerEx("Zerar_Funcionamento_Anti_Aimbot",10000,0,"i",playerid);
  126.  
  127. #if Criar_Logs
  128.  
  129. Escrever_Log(Arquivo_Logs,Fala_Aimbot);
  130.  
  131. #endif
  132. }
  133. // Funções dependentes de definições
  134.  
  135. stock Escrever_Log(arquivo[],texto[])
  136. {
  137. new Horario[6],Fala[256];
  138.  
  139. getdate(Horario[0],Horario[1],Horario[2]);
  140. gettime(Horario[3],Horario[4],Horario[5]);
  141.  
  142. 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);
  143.  
  144. bCini8_Log(arquivo,Fala);
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement