Guest User

AntiAimbot - v0.2 By Scriptery.

a guest
Mar 8th, 2017
5,547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. /* ANTI AIMBOT by Scriptery v0.2
  2. UPDATES:
  3. - bug fixes, to keep the target without press KEY_AIM, anti cheat send fake warnings.
  4.  
  5. if you find a bug, contact me in PM.
  6. Next update: Detect renko, and stabilization anticheat for kick player
  7. */
  8. #include <a_samp>
  9.  
  10. new SilentAimCount[MAX_PLAYERS],ProAimCount[MAX_PLAYERS],TintaApasata[MAX_PLAYERS];
  11.  
  12. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  13. {
  14. new string[200];
  15. if(weaponid != 38 && weaponid > 18 && weaponid < 34 && hittype == 1)
  16. {
  17. new Float:cood[6],Float:DistantaAim,armaaim[128];
  18. GetPlayerPos(hitid,cood[0],cood[1],cood[2]);
  19. DistantaAim = GetPlayerDistanceFromPoint(playerid,cood[0],cood[1],cood[2]);
  20. GetWeaponName(weaponid,armaaim,sizeof(armaaim));
  21.  
  22. if(GetPlayerTargetPlayer(playerid) == INVALID_PLAYER_ID && DistantaAim > 1 && DistantaAim < 31 && TintaApasata[playerid] == 1)
  23. {
  24. SilentAimCount[playerid]++;
  25. if(SilentAimCount[playerid] >= 10)
  26. {
  27. SilentAimCount[playerid] = 0;
  28. format(string, sizeof(string), "Warning: %s(%d) possible use Silent Aim cheat with %s (Distance: %i meters)", GetName(playerid),playerid, armaaim, floatround(DistantaAim));
  29. SendToAdmins(string);
  30. }
  31. return 1;
  32. }
  33. GetPlayerLastShotVectors(playerid, cood[0],cood[1],cood[2], cood[3],cood[4],cood[5]);
  34. if(!IsPlayerInRangeOfPoint(hitid, 3.0, cood[3],cood[4],cood[5]))
  35. {
  36. ProAimCount[playerid]++;
  37. if(ProAimCount[playerid] >= 5)
  38. {
  39. ProAimCount[playerid] = 0;
  40. format(string, sizeof(string), "Warning: %s(%d) possible use ProAim cheat with: %s (Distance: %i meters)", GetName(playerid),playerid,armaaim, floatround(DistantaAim));
  41. SendToAdmins(string);
  42. }
  43. }
  44. }
  45. return 1;
  46. }
  47.  
  48. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  49. {
  50. if(newkeys & KEY_HANDBRAKE && !IsPlayerInAnyVehicle(playerid)) TintaApasata[playerid] = 1;
  51. else if(oldkeys & KEY_HANDBRAKE) TintaApasata[playerid] = 0;
  52. return 1;
  53. }
  54.  
  55. public OnFilterScriptInit()
  56. {
  57. print("Anti aimbot by Scriptery loaded !");
  58. return 1;
  59. }
  60. stock SendToAdmins(string2[])
  61. {
  62. for(new i; i < MAX_PLAYERS; i++)
  63. {
  64. if(IsPlayerConnected(i) && IsPlayerAdmin(i))
  65. {
  66. SendClientMessage(i,0xE60000FF,string2);
  67. }
  68. }
  69. }
  70. stock GetName(playerid)
  71. {
  72. new Name[MAX_PLAYER_NAME];
  73. GetPlayerName(playerid, Name, sizeof(Name));
  74. return Name;
  75. }
  76. /*
  77. public OnPlayerSpawn(playerid)
  78. {
  79. SetPlayerPos(playerid,0,0,3);
  80. GivePlayerWeapon(playerid,24,999);
  81. GivePlayerWeapon(playerid,30,999);
  82. return 1;
  83. }
  84. */
Advertisement
Add Comment
Please, Sign In to add comment