Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ui_ref, ui_new_slider, ui_new_checkbox, ui_get, ui_set, client_set_event_callback, entity_get_prop, globals_maxplayers, entity_is_enemy, entity_is_alive, entity_is_dormant, client_userid_to_entindex, ui_is_menu_open = ui.reference, ui.new_slider, ui.new_checkbox, ui.get, ui.set, client.set_event_callback, entity.get_prop, globals.maxplayers, entity.is_enemy, entity.is_alive, entity.is_dormant, client.userid_to_entindex, ui.is_menu_open
- local ui_playerlist = ui_ref("PLAYERS", "Players", "Player list")
- local ui_resetall = ui_ref("PLAYERS", "Players", "Reset all")
- local ui_bodyaim = ui_ref("PLAYERS", "Adjustments", "Override prefer body aim")
- local ui_checkbox = ui_new_checkbox("RAGE", "Other", "Body aim if slow-walking")
- local ui_slider = ui_new_slider("RAGE", "Other", "Slow-walk threshold", 1, 250, 100)
- client_set_event_callback("paint", function(c)
- if ui_get(ui_checkbox) or ui_is_menu_open() then
- for i = 1, globals_maxplayers() do
- if not entity_is_dormant(i) and entity_is_enemy(i) and entity_is_alive(i) then
- ui_set(ui_playerlist, i)
- velocity = { entity_get_prop(i, "m_vecVelocity") }
- velocity2d = math.sqrt(velocity[1]^2 + velocity[2]^2)
- if velocity2d <= ui_get(ui_slider) and velocity2d >= 1 then
- ui_set(ui_bodyaim, "On")
- else
- ui_set(ui_bodyaim, "-")
- end
- end
- end
- end
- end)
- client_set_event_callback("cs_game_disconnected", function(c)
- ui_set(ui_resetall, true)
- end)
- client_set_event_callback("game_newmap", function(c)
- ui_set(ui_resetall, true)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement