Advertisement
Guest User

Untitled

a guest
May 11th, 2016
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. if inGame() and isPlaying() then
  2. SDSA_IsActivated = not SDSA_IsActivated
  3. local SDSA_FoundTarget = false
  4. local SDSA_TargetDir = Vector3()
  5. local CurAngle = ThisPtr._ext_camera:position()
  6. local FinAngle = MyUnitBase.unit:movement():m_head_pos()
  7. local CalcX = FinAngle.y - CurAngle.y
  8. local CalcY = FinAngle.x - CurAngle.x
  9. if SDSA_IsActivated then
  10. managers.hud:show_hint( { text = "AIMBOT ON" } )
  11. else
  12. managers.hud:show_hint( { text = "AIMBOT OFF" } )
  13. end
  14.  
  15. if mvector3 then
  16. local SDST_Orig_mvector3_spread = mvector3.spread
  17. function mvector3.spread(Direction, Spread)
  18. if SDSA_IsActivated and SDSA_FoundTarget and
  19. if CalcY < 0 then CalcY = CalcY * -1 end
  20. if CalcX < 0 then CalcX = CalcX * -1 end
  21. if CalcY > 180 then CalcY = 360 - CalcY end
  22. if CalcX > 180 then CalcX = 360 - CalcX end
  23. if CalcX <= 5/2 && CalcY <=5*0.4 then
  24. mvector3.set(Direction, SDSA_TargetDir)
  25. SDSA_FoundTarget = false
  26. return SDST_Orig_mvector3_spread(Direction, 0)
  27. else
  28. return SDST_Orig_mvector3_spread(Direction, Spread)
  29. end
  30. end
  31. end
  32.  
  33. function SDSA_SilverAim(ThisPtr, t, input)
  34. if SDSA_IsActivated and managers and managers.enemy and ThisPtr._ext_camera and ThisPtr._equipped_unit and ThisPtr._equipped_unit:base() and not ThisPtr:_is_reloading() and not ThisPtr:_changing_weapon() and not ThisPtr:_is_meleeing() and not ThisPtr._use_item_expire_t and not ThisPtr:_interacting() and not ThisPtr:_is_throwing_grenade() then
  35. for k, MyUnitBase in pairs(managers.enemy:all_enemies()) do
  36. if MyUnitBase.unit and alive(MyUnitBase.unit) and not MyUnitBase.is_converted and not isHostage(MyUnitBase.unit) and MyUnitBase.unit:movement() and MyUnitBase.unit:movement():m_head_pos() then
  37. local MyEye = Vector3()
  38. local MyTarget = Vector3()
  39. mvector3.set(MyEye, ThisPtr._ext_camera:position())
  40. mvector3.set(MyTarget, MyUnitBase.unit:movement():m_head_pos())
  41. if not World:raycast("ray", MyEye, MyTarget, "slot_mask", managers.slot:get_mask("AI_visibility"), "ray_type", "ai_vision") then
  42. local MyRay = World:raycast("ray", MyEye, MyTarget, "slot_mask", ThisPtr._equipped_unit:base()._bullet_slotmask, "ignore_unit", ThisPtr._equipped_unit:base()._setup.ignore_units)
  43. if MyRay and MyRay.unit and MyRay.body then
  44. if MyRay.unit:character_damage() and MyRay.unit:character_damage().is_head and MyRay.unit:character_damage():is_head(MyRay.body) or (MyRay.unit:base() and MyRay.unit:base()._tweak_table == "tank") then
  45. mvector3.set(SDSA_TargetDir, MyTarget)
  46. mvector3.subtract(SDSA_TargetDir, MyEye)
  47. SDSA_FoundTarget = true
  48. break
  49. end
  50. end
  51. end
  52. end
  53. end
  54. end
  55. end
  56.  
  57. if PlayerStandard then
  58. local SDSP_Orig_PlayerStandard_check_action_primary_attack = PlayerStandard._check_action_primary_attack
  59.  
  60. function PlayerStandard:_check_action_primary_attack(t, input)
  61. if SDSA_IsActivated then
  62. SDSA_SilverAim(self, t, input)
  63. return SDSP_Orig_PlayerStandard_check_action_primary_attack(self, t, input)
  64. else
  65. return SDSP_Orig_PlayerStandard_check_action_primary_attack(self, t, input)
  66. end
  67. end
  68. end
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement