Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. /* anti pro-aim
  2.  
  3. get shotted pos
  4. get bullet pos
  5. if bullet pos HITS shotted
  6. get shotted pos
  7. if shotted pos != bullet pos */
  8.  
  9. #include <a_samp>
  10. #include <izcmd>
  11.  
  12. #define HOLDING(%0) \
  13. ((newkeys & (%0)) == (%0))
  14.  
  15. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  16. {
  17.  
  18. if(hitid != INVALID_PLAYER_ID && IsPlayerConnected(hitid))
  19. {
  20. print("hitid != INVALID_PLAYER_ID");
  21.  
  22. new Float:hitid_X, Float:hitid_Y, Float:hitid_Z;
  23. GetPlayerPos(playerid, Float:hitid_X, Float:hitid_Y, Float:hitid_Z);
  24.  
  25. new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
  26. GetPlayerLastShotVectors(playerid, Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ);
  27.  
  28. static msg[128];
  29. static msg2[128];
  30.  
  31. format(msg, sizeof(msg), "hitid pos: %f %f %f", Float:hitid_X, Float:hitid_Y, Float:hitid_Z);
  32. format(msg2, sizeof(msg2), "vector pos: %f %f %f %f %f %f", Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ);
  33. SendClientMessage(playerid, -1, msg);
  34. SendClientMessage(playerid, -1, msg2);
  35.  
  36. if(!IsPlayerInRangeOfPoint(hitid, Float:3.0, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ))
  37. {
  38. SendClientMessage(playerid, -1, "aimbot detected");
  39. SendClientMessageToAll(-1, "a player is aimbotting, pro aim");
  40. }
  41.  
  42. static msg3[128];
  43. new Float:cood[6],Float:DistantaAim;
  44. GetPlayerPos(hitid,cood[0],cood[1],cood[2]);
  45. DistantaAim = GetPlayerDistanceFromPoint(playerid,cood[0],cood[1],cood[2]);
  46.  
  47. if(GetPlayerTargetPlayer(playerid) == INVALID_PLAYER_ID && DistantaAim > 1.00 && DistantaAim < 50.00)
  48. {
  49.  
  50. {
  51. SendClientMessageToAll(-1, "a player is aimbotting, silent aim");
  52. }
  53. }
  54.  
  55. format(msg3, sizeof(msg3), "distance: %f", DistantaAim);
  56. SendClientMessage(playerid, -1, msg3);
  57. }
  58. }
  59.  
  60. public OnPlayerSpawn(playerid)
  61. {
  62. SetSpawnInfo(playerid, 1, 1, Float:53, Float:10, Float:52, Float:1, 1, 1, 1, 1, 1, 1);
  63. SetPlayerPos(playerid, 23, 30, 43);
  64. AddStaticVehicle(451, 25, 30, 45, 1, 1, 1);
  65. AddStaticVehicle(451, 25, 35, 45, 1, 1, 1);
  66. GivePlayerWeapon(playerid, 24, 9999);
  67. GivePlayerWeapon(playerid, 25, 9999);
  68. GivePlayerWeapon(playerid, WEAPON_M4, 9999);
  69. SetPlayerHealth(playerid, 999999);
  70. return 1;
  71. }
  72.  
  73. CMD:m4(playerid, params[])
  74. {
  75. GivePlayerWeapon(playerid, WEAPON_M4, 9999);
  76. return 1;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement