Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local userid_to_entindex = client.userid_to_entindex
- local set_var = ui.set
- local get_player_name = entity.get_player_name
- local get_local_player = entity.get_local_player
- local console_cmd = client.exec
- local ui_get = ui.get
- local missedshots = 0
- local hitshots = 0
- local shotsfired = 0
- local Enemies_idx = 0
- local Pitch_Enable = ui.reference("PLAYERS", "Adjustments", "Force Pitch")
- local Force_Pitch = ui.reference("PLAYERS", "Adjustments", "Force Pitch Value")
- local Apply = ui.reference("PLAYERS", "Adjustments", "Apply to all")
- local Bruteforce_Pitch = ui.new_checkbox("RAGE", "Other", "Pitch Bruteforce")
- local brute_afterx = ui.new_slider("rage", "other", "Bruteforce pitch after x misses", 1, 5)
- local plist_ref = ui.reference("PLAYERS", "Players", "player list")
- local plist_resetall_ref = ui.reference("PLAYERS", "Players", "Reset all")
- local maxmisses = ui_get(brute_afterx)
- local doublemiss = ui_get(brute_afterx) * 2
- local maxmiss = ui_get(brute_afterx) * 3
- --handle shots
- local function on_aim_fire(ctx)
- shotsfired = shotsfired + 1
- end
- local function on_aim_hit(e)
- if ui_get( Bruteforce_Pitch ) then
- if e.headshot and e.health <= 0 then
- missedshots = 0
- shotshit = shotshit + 1
- end
- else if e.headshot and e.health > 0 then
- shotshit = shotshit + 1
- end
- end
- end
- local function on_aim_miss(e)
- if ui_get( Bruteforce_Pitch ) then
- if missedshots == 0 then
- set_var(plist_resetall_ref, true)
- end
- missedshots = missedshots + 1
- if missedshots >= maxmisses then
- set_var(Pitch_Enable, true)
- set_var(Force_Pitch, -90)
- set_var(Apply, true)
- end
- if missedshots >= doublemiss then
- set_var(Pitch_Enable, true)
- set_var(Force_Pitch, 90)
- set_var(Apply, true)
- end
- if missedshots == maxmiss then missedshots = 0 end
- end
- end
- local function resetshots()
- shotsfired = 0
- missedshots = 0
- hitshots = 0
- end
- local function on_cs_game_disconnected()
- set_var(plist_resetall_ref, true)
- resetshots()
- end
- local function on_round_prestart()
- set_var(plist_resetall_ref, true)
- resetshots()
- end
- client.set_event_callback("aim_hit", on_aim_hit)
- client.set_event_callback('aim_miss', on_aim_miss)
- client.set_event_callback("aim_fire", on_aim_fire)
- client.set_event_callback("round_prestart", on_round_prestart)
- client.set_event_callback("cs_game_disconnected", on_cs_game_disconnected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement