Advertisement
Guest User

Pitch Bruteforce

a guest
Jan 17th, 2019
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.38 KB | None | 0 0
  1. local userid_to_entindex = client.userid_to_entindex
  2. local set_var = ui.set
  3. local get_player_name = entity.get_player_name
  4. local get_local_player = entity.get_local_player
  5. local console_cmd = client.exec
  6. local ui_get = ui.get
  7. local missedshots = 0
  8. local hitshots = 0
  9. local shotsfired = 0
  10. local Enemies_idx = 0
  11.  
  12. local Pitch_Enable = ui.reference("PLAYERS", "Adjustments", "Force Pitch")
  13. local Force_Pitch = ui.reference("PLAYERS", "Adjustments", "Force Pitch Value")
  14. local Apply = ui.reference("PLAYERS", "Adjustments", "Apply to all")
  15. local Bruteforce_Pitch = ui.new_checkbox("RAGE", "Other", "Pitch Bruteforce")
  16. local brute_afterx = ui.new_slider("rage", "other", "Bruteforce pitch after x misses", 1, 5)
  17. local plist_ref = ui.reference("PLAYERS", "Players", "player list")
  18. local plist_resetall_ref  = ui.reference("PLAYERS", "Players", "Reset all")
  19. local maxmisses = ui_get(brute_afterx)
  20. local doublemiss = ui_get(brute_afterx) * 2
  21. local maxmiss = ui_get(brute_afterx) * 3
  22. --handle shots
  23. local function on_aim_fire(ctx)
  24.     shotsfired = shotsfired + 1
  25. end
  26.  
  27. local function on_aim_hit(e)
  28.     if ui_get( Bruteforce_Pitch ) then
  29.          if e.headshot and e.health <= 0 then
  30.             missedshots = 0
  31.             shotshit = shotshit + 1
  32.          end
  33.          else if e.headshot and e.health > 0 then
  34.             shotshit = shotshit + 1
  35.           end
  36.      end
  37. end
  38.  
  39. local function on_aim_miss(e)
  40.     if ui_get( Bruteforce_Pitch ) then
  41.         if missedshots == 0 then
  42.             set_var(plist_resetall_ref, true)
  43.         end
  44.         missedshots = missedshots + 1
  45.         if missedshots >= maxmisses then
  46.                 set_var(Pitch_Enable, true)
  47.                 set_var(Force_Pitch, -90)
  48.                 set_var(Apply, true)
  49.         end
  50.         if missedshots >= doublemiss then
  51.                 set_var(Pitch_Enable, true)
  52.                 set_var(Force_Pitch, 90)
  53.                 set_var(Apply, true)
  54.         end
  55.         if missedshots == maxmiss then missedshots = 0 end
  56.     end
  57. end
  58.  
  59. local function resetshots()
  60.     shotsfired = 0
  61.     missedshots = 0
  62.     hitshots = 0
  63. end
  64.  
  65. local function on_cs_game_disconnected()
  66.     set_var(plist_resetall_ref, true)
  67.     resetshots()
  68. end
  69.  
  70. local function on_round_prestart()
  71.     set_var(plist_resetall_ref, true)
  72.     resetshots()
  73. end
  74.  
  75. client.set_event_callback("aim_hit", on_aim_hit)
  76. client.set_event_callback('aim_miss', on_aim_miss)
  77. client.set_event_callback("aim_fire", on_aim_fire)
  78. client.set_event_callback("round_prestart", on_round_prestart)
  79. client.set_event_callback("cs_game_disconnected", on_cs_game_disconnected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement