Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. local ui_set_callback, ui_set_visible, globals_absoluteframetime, globals_frametime, globals_tickinterval, get_prop, ui_get, sqrt, sin, cos, get_local_player, get_all_players, get_player_name, get_screen_size, draw_text, client_console_cmd, client_delay_call, get_player_name, get_classname, get_local_player, globals_realtime, globals_tickcount = ui.set_callback, ui.set_visible, globals.absoluteframetime, globals.frametime, globals.tickinterval, entity.get_prop, ui.get, math.sqrt, math.sin, math.cos, entity.get_local_player, entity.get_players, entity.get_player_name, client.screen_size, client.draw_text, client.exec, client.delay_call, entity.get_player_name, entity.get_classname, entity.get_local_player, globals.realtime, globals.tickcount
  2. local table_insert, table_remove, math_floor, math_sqrt, math_min, math_abs = table.insert, table.remove, math.floor, math.sqrt, math.min, math.abs
  3. local entity_is_enemy, entity_is_alive, entity_is_dormant = entity.is_enemy, entity.is_alive, entity.is_dormant
  4. local ui_new_checkbox, ui_new_slider, ui_new_combobox, ui_new_multiselect = ui.new_checkbox, ui.new_slider, ui.new_combobox, ui.new_multiselect
  5. local getvar, setvar = client.get_cvar, client.set_cvar
  6.  
  7. --added
  8. local client_visible, client_trace_bullet, client_eye_position, entity_hitbox_position = client.visible , client.trace_bullet, client.eye_position, entity.hitbox_position
  9.  
  10.  
  11. local disable_oof = ui_new_checkbox("LUA", "A", "Disable AA OOF")
  12. local oof_yaw = ui_new_combobox("LUA", "A", "OOF Yaw", "180", "Spin", "Static", "180 Z", "Crosshair")
  13. local oof_pitch = ui_new_combobox("LUA", "A", "OOF Pitch", "Default", "Up", "Down", "Minimal", "Random")
  14. local oof_fakelag = ui_new_checkbox("LUA", "A", "OOF Fakelag")
  15. local oof_fov = ui_new_slider("LUA", "A", "FOV to enable", 0, 180)
  16. --added
  17. local oof_mode = ui_new_combobox("LUA", "A", "OOF Mode", "Nothing Special", "Vischeck", "Bullettrace Owner", "Bullettrace Enemy")
  18.  
  19. local yawaa, yaw_saa = ui.reference("AA", "Anti-aimbot angles", "Yaw")
  20. local pitchaa = ui.reference("AA", "Anti-aimbot angles", "Pitch")
  21. local fakelagaa = ui.reference("AA", "Fake lag", "Enabled")
  22. require ('vector3')
  23.  
  24. --hitbox indexes by sapphyrus
  25. --[[
  26. hitbox_head = 0,
  27. hitbox_neck = 1,
  28. hitbox_pelvis = 2,
  29. hitbox_spine_0 = 3,
  30. hitbox_spine_1 = 4,
  31. hitbox_spine_2 = 5,
  32. hitbox_spine_3 = 6,
  33. hitbox_leg_upper_L = 7,
  34. hitbox_leg_upper_R = 8,
  35. hitbox_leg_lower_L = 9,
  36. hitbox_leg_lower_R = 10,
  37. hitbox_ankle_L = 11,
  38. hitbox_ankle_R = 12,
  39. hitbox_hand_L = 13,
  40. hitbox_hand_R = 14,
  41. hitbox_arm_upper_L = 15,
  42. hitbox_arm_lower_L = 16,
  43. hitbox_arm_upper_R = 17,
  44. hitbox_arm_lower_R = 18,
  45. ]]--
  46.  
  47. local function runMenuThings()
  48. ui_set_visible(oof_yaw, ui_get(disable_oof))
  49. ui_set_visible(oof_pitch, ui_get(disable_oof))
  50. ui_set_visible(oof_fakelag, ui_get(disable_oof))
  51. ui_set_visible(oof_fov, ui_get(disable_oof))
  52. --added
  53. ui_set_visible(oof_mode, ui_get(disable_oof))
  54. end
  55.  
  56. runMenuThings()
  57.  
  58.  
  59. local function run_cmd()
  60. if not (ui_get(disable_oof)) then
  61. return
  62. end
  63.  
  64.  
  65.  
  66. local local_player = get_local_player()
  67.  
  68. if local_player == nil or not entity.is_alive(local_player) then
  69. return
  70. end
  71.  
  72. local v_origin_local = Vector3(get_prop(local_player, "m_vecAbsOrigin"))
  73. if v_origin_local.x == nil then
  74. return
  75. end
  76.  
  77. local players = get_all_players(true)
  78. --renamed
  79. local result = false
  80. local pitch, yaw, roll = client.camera_angles()
  81. local cam_angle = Vector3(pitch, yaw, 0)
  82.  
  83. local fov = ui_get(oof_fov)
  84.  
  85. for i=1, #players do
  86. local entindex = players[i]
  87. if entity_is_enemy(entindex) and entity_is_alive(entindex) and not entity_is_dormant(entindex) then
  88. local v_origin_enemy = Vector3(entity.get_prop(entindex, "m_vecOrigin"))
  89. local cur_fov = get_FOV(cam_angle, v_origin_local, v_origin_enemy)
  90. if cur_fov < fov then
  91. if ui_get(oof_mode) == "Nothing Special" then
  92. result = true
  93. elseif ui_get(oof_mode) == "Vischeck" then
  94. for j = 0, 18 do -- could be reduced to improve performance
  95. local hitbox_x, hitbox_y, hitbox_z = entity_hitbox_position(entindex, j)
  96. if client_visible(hitbox_x, hitbox_y, hitbox_z) then
  97. result = true
  98. break
  99. end
  100. end
  101. elseif ui_get(oof_mode) == "Bullettrace Owner" then
  102. local own_x, own_y, own_z = client_eye_position()
  103. for j = 0, 18 do -- could be reduced to improve performance
  104. local hitbox_x, hitbox_y, hitbox_z = entity_hitbox_position(entindex, j)
  105. local enemyhit, damage = client_trace_bullet(local_player, own_x, own_y, own_z, hitbox_x, hitbox_y, hitbox_z)
  106. if enemyhit ~= nil then
  107. result = true
  108. break
  109. end
  110. end
  111. elseif ui_get(oof_mode) == "Bullettrace Enemy" then
  112. local enemy_x, enemy_y, enemy_z = entity_hitbox_position(entindex, 0) --not sure if that works like eye pos for the enemy
  113. for j = 0, 18 do -- could be reduced to improve performance
  114. local hitbox_x, hitbox_y, hitbox_z = entity_hitbox_position(local_player, j)
  115. local ownerhit, damage = client_trace_bullet(entindex, enemy_x, enemy_y, enemy_z, hitbox_x, hitbox_y, hitbox_z)
  116. if ownerhit ~= nil then
  117. result = true
  118. break
  119. end
  120. end
  121. end
  122. -- didn't see a reason to store any of that information
  123. --fov = cur_fov
  124. --closestplayer = entindex
  125. end
  126. end
  127. end
  128.  
  129. if result then
  130. ui.set(yawaa, ui_get(oof_yaw))
  131. ui.set(fakelagaa, ui_get(oof_fakelag))
  132. ui.set(pitchaa, ui_get(oof_pitch))
  133. else
  134. ui.set(yawaa, "Off")
  135. ui.set(fakelagaa, false)
  136. ui.set(pitchaa, "Off")
  137. end
  138.  
  139. end
  140.  
  141.  
  142. ui.set_callback(disable_oof, function()
  143. runMenuThings()
  144. if not (ui_get(disable_oof)) then
  145. ui.set(yawaa, ui_get(oof_yaw))
  146. ui.set(fakelagaa, ui_get(oof_fakelag))
  147. ui.set(pitchaa, ui_get(oof_pitch))
  148. end
  149. end)
  150.  
  151. client.set_event_callback("run_command", run_cmd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement