Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --local variables for API. Automatically generated by https://github.com/simpleavaster/gslua/blob/master/authors/sapphyrus/generate_api.lua
- local client_latency, client_log, client_draw_rectangle, client_draw_circle_outline, client_userid_to_entindex, client_draw_gradient, client_set_event_callback, client_screen_size, client_draw_text, client_visible = client.latency, client.log, client.draw_rectangle, client.draw_circle_outline, client.userid_to_entindex, client.draw_gradient, client.set_event_callback, client.screen_size, client.draw_text, client.visible
- local client_visible, client_exec, client_draw_circle, client_delay_call, client_world_to_screen, client_draw_hitboxes, client_get_cvar, client_draw_line, client_camera_angles, client_draw_debug_text, client_random_int, client_random_float = client.visible, client.exec, client.draw_circle, client.delay_call, client.world_to_screen, client.draw_hitboxes, client.get_cvar, client.draw_line, client.camera_angles, client.draw_debug_text, client.random_int, client.random_float
- local entity_get_local_player, entity_is_enemy, entity_get_player_name, entity_get_all, entity_set_prop, entity_get_player_weapon, entity_hitbox_position, entity_get_prop, entity_get_players, entity_get_classname = entity.get_local_player, entity.is_enemy, entity.get_player_name, entity.get_all, entity.set_prop, entity.get_player_weapon, entity.hitbox_position, entity.get_prop, entity.get_players, entity.get_classname
- local globals_mapname, globals_tickcount, globals_realtime, globals_absoluteframetime, globals_tickinterval, globals_curtime, globals_frametime, globals_maxplayers = globals.mapname, globals.tickcount, globals.realtime, globals.absoluteframetime, globals.tickinterval, globals.curtime, globals.frametime, globals.maxplayers
- local ui_new_slider, ui_new_combobox, ui_reference, ui_set_visible, ui_new_color_picker, ui_set_callback, ui_set, ui_new_checkbox, ui_new_hotkey, ui_new_button, ui_new_multiselect, ui_get = ui.new_slider, ui.new_combobox, ui.reference, ui.set_visible, ui.new_color_picker, ui.set_callback, ui.set, ui.new_checkbox, ui.new_hotkey, ui.new_button, ui.new_multiselect, ui.get
- local math_ceil, math_tan, math_correctRadians, math_fact, math_log10, math_randomseed, math_cos, math_sinh, math_random, math_huge, math_pi, math_max, math_atan2, math_ldexp, math_floor, math_sqrt = math.ceil, math.tan, math.correctRadians, math.fact, math.log10, math.randomseed, math.cos, math.sinh, math.random, math.huge, math.pi, math.max, math.atan2, math.ldexp, math.floor, math.sqrt
- local math_sqrt, math_deg, math_atan, math_fmod, math_acos, math_pow, math_abs, math_min, math_sin, math_frexp, math_log, math_tanh, math_exp, math_modf, math_cosh, math_asin, math_rad = math.sqrt, math.deg, math.atan, math.fmod, math.acos, math.pow, math.abs, math.min, math.sin, math.frexp, math.log, math.tanh, math.exp, math.modf, math.cosh, math.asin, math.rad
- local table_maxn, table_foreach, table_sort, table_remove, table_foreachi, table_move, table_getn, table_concat, table_insert = table.maxn, table.foreach, table.sort, table.remove, table.foreachi, table.move, table.getn, table.concat, table.insert
- --end of local variables
- local show_angles_reference = ui.new_multiselect("VISUALS", "Other ESP", "Show Anti-aimbot angles", "Real", "Fake", "LBY", "Camera")
- local real_length_reference = ui.new_slider("VISUALS", "Other ESP", "Real Distance / Color", 10, 80, 30, true, "u")
- local real_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "Real Color", 28, 132, 255, 220)
- local fake_length_reference = ui.new_slider("VISUALS", "Other ESP", "Fake Distance / Color", 10, 80, 30, true, "u")
- local fake_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "Fake Color", 0, 164, 52, 220)
- local lby_length_reference = ui.new_slider("VISUALS", "Other ESP", "LBY Distance / Color", 10, 80, 30, true, "u")
- local lby_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "LBY Color", 255, 0, 0, 220)
- local camera_length_reference = ui.new_slider("VISUALS", "Other ESP", "Camera Distance / Color", 10, 80, 30, true, "u")
- local camera_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "Camera Color", 255, 255, 255, 220)
- local boxSize = 30
- local length = 40
- local debug = false
- local function debug_log(message)
- if debug then
- client.log(message)
- end
- end
- local function contains(table, val)
- for i=1,#table do
- if table[i] == val then
- return true
- end
- end
- return false
- end
- local function on_show_angles_change()
- local value = ui_get(show_angles_reference)
- ui_set_visible(real_length_reference, contains(value, "Real"))
- ui_set_visible(real_color_reference, contains(value, "Real"))
- ui_set_visible(fake_length_reference, contains(value, "Fake"))
- ui_set_visible(fake_color_reference, contains(value, "Fake"))
- ui_set_visible(lby_length_reference, contains(value, "LBY"))
- ui_set_visible(lby_color_reference, contains(value, "LBY"))
- ui_set_visible(camera_length_reference, contains(value, "Camera"))
- ui_set_visible(camera_color_reference, contains(value, "Camera"))
- end
- ui_set_callback(show_angles_reference, on_show_angles_change)
- local function on_paint(ctx)
- local local_player = entity_get_local_player()
- if local_player == nil then
- return
- end
- if entity_get_prop(local_player, "m_lifeState") ~= 0 then
- return
- end
- local value = ui_get(show_angles_reference)
- if value == {} then
- return
- end
- local locationX, locationY, locationZ = entity_get_prop(local_player, "m_vecOrigin")
- if locationX then
- debug_log("ingame + drawing")
- local worldX, worldY = client_world_to_screen(ctx, locationX, locationY, locationZ)
- if worldX == nil or worldY == nil then return end
- local lbyYaw = entity_get_prop(entity_get_local_player(), "m_flLowerBodyYawTarget")
- if contains(value, "Real") then
- local real_r, real_g, real_b, real_a = ui_get(real_color_reference)
- local real_distance = ui_get(real_length_reference)
- local headX, headY, headZ = entity_hitbox_position(local_player, 0)
- local deltaX, deltaY = headX-locationX, headY-locationY
- local realYaw = math_deg(math_atan2(deltaY, deltaX))
- local additional = lbyYaw > realYaw and -10 or 20
- if math_abs(lbyYaw-realYaw) > 15 then
- realYaw = realYaw + additional
- end
- locationXReal = locationX + math_cos(math_rad(realYaw)) * real_distance
- locationYReal = locationY + math_sin(math_rad(realYaw)) * real_distance
- local worldXReal, worldYReal = client_world_to_screen(ctx, locationXReal, locationYReal, locationZ)
- if worldXReal ~= nil then
- debug_log("drawing real with colors " .. real_r .. ", " .. real_g .. ", " .. real_b .. ", " .. real_a)
- client_draw_line(ctx, worldX, worldY, worldXReal, worldYReal, real_r, real_g, real_b, real_a)
- client_draw_text(ctx, worldXReal, worldYReal, real_r, real_g, real_b, real_a, "c-", 0, "REAL")
- end
- end
- if contains(value, "Fake") then
- local fake_r, fake_g, fake_b, fake_a = ui_get(fake_color_reference)
- local fake_distance = ui_get(fake_length_reference)
- local _, fakeYaw, _ = entity_get_prop(entity_get_local_player(), "m_angEyeAngles")
- locationXFake = locationX + math_cos(math_rad(fakeYaw)) * fake_distance
- locationYFake = locationY + math_sin(math_rad(fakeYaw)) * fake_distance
- local worldXFake, worldYFake = client_world_to_screen(ctx, locationXFake, locationYFake, locationZ)
- if worldXFake ~= nil then
- client_draw_line(ctx, worldX, worldY, worldXFake, worldYFake, fake_r, fake_g, fake_b, fake_a)
- client_draw_text(ctx, worldXFake, worldYFake, fake_r, fake_g, fake_b, fake_a, "c-", 0, "FAKE")
- end
- end
- if contains(value, "LBY") then
- local lby_r, lby_g, lby_b, lby_a = ui_get(lby_color_reference)
- local lby_distance = ui_get(lby_length_reference)
- locationXLBY = locationX + math_cos(math_rad(lbyYaw)) * lby_distance
- locationYLBY = locationY + math_sin(math_rad(lbyYaw)) * lby_distance
- local worldXLBY, worldYLBY = client_world_to_screen(ctx, locationXLBY, locationYLBY, locationZ)
- if worldXLBY ~= nil then
- client_draw_line(ctx, worldX, worldY, worldXLBY, worldYLBY, lby_r, lby_g, lby_b, lby_a)
- client_draw_text(ctx, worldXLBY, worldYLBY, lby_r, lby_g, lby_b, lby_a, "c-", 0, "LBY")
- end
- end
- if contains(value, "Camera") then
- local camera_r, camera_g, camera_b, camera_a = ui_get(camera_color_reference)
- local camera_distance = ui_get(camera_length_reference)
- local _, cameraYaw = client_camera_angles()
- locationXCamera = locationX + math_cos(math_rad(cameraYaw)) * camera_distance
- locationYCamera = locationY + math_sin(math_rad(cameraYaw)) * camera_distance
- local worldXCamera, worldYCamera = client_world_to_screen(ctx, locationXCamera, locationYCamera, locationZ)
- if worldXCamera ~= nil then
- client_draw_line(ctx, worldX, worldY, worldXCamera, worldYCamera, camera_r, camera_g, camera_b, camera_a)
- client_draw_text(ctx, worldXCamera, worldYCamera, camera_r, camera_g, camera_b, camera_a, "c-", 0, "CAM")
- end
- end
- if #value > 0 then
- client_draw_circle(ctx, worldX, worldY, 17, 17, 17, 255, 2, 0, 1)
- end
- end
- end
- client.set_event_callback("paint", on_paint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement