Загрузка данных


-- ========================================================
-- Enigma CS2 Legit Helper Script
-- ========================================================

-- Create UI Elements
local legit_group = menu.add_group("Legit Assistance", 1)

local dynamic_smooth = legit_group:add_checkbox("Dynamic Smooth on Spray")
local min_smooth = legit_group:add_slider("Minimum Smooth", 1, 20)

local engine_radar = legit_group:add_checkbox("Force Engine Radar")
local hitmarker_toggle = legit_group:add_checkbox("Custom Hitmarker")

-- Hitmarker variables
local hit_time = 0
local hit_duration = 0.25 -- duration in seconds

-- 1. Dynamic Smooth / FOV Handler
events.create_move:add(function(cmd)
    local local_player = entity.get_local_player()
    if not local_player or not local_player:is_alive() then return end

    if dynamic_smooth:get() then
        local shots_fired = local_player:get_prop("m_iShotsFired") or 0
        
        if shots_fired > 2 then
            -- Dynamically lower smooth value during spray to control recoil
            local current_min = min_smooth:get()
            cvar.aim_smooth:set_float(math.max(1, current_min - (shots_fired * 0.5)))
        end
    end
end)

-- 2. Force Engine Radar
events.net_update_end:add(function()
    if not engine_radar:get() then return end

    local players = entity.get_players(true) -- get enemies only
    for _, player in ipairs(players) do
        if player and player:is_alive() and not player:is_dormant() then
            player:set_prop("m_bSpotted", true)
        end
    end
end)

-- 3. Hitmarker Drawing
events.player_hurt:add(function(event)
    if not hitmarker_toggle:get() then return end

    local attacker = entity.get_by_userid(event.attacker)
    local local_player = entity.get_local_player()

    if attacker == local_player then
        hit_time = global_vars.realtime
        client.play_sound("buttons/arena_switch_press_02.wav")
    end
end)

events.paint:add(function()
    if not hitmarker_toggle:get() then return end
    if global_vars.realtime > hit_time + hit_duration then return end

    local screen_size = render.get_screen_size()
    local cx, cy = screen_size.x / 2, screen_size.y / 2
    local size = 6
    local gap = 3

    local alpha = math.floor((1 - ((global_vars.realtime - hit_time) / hit_duration)) * 255)
    local color = render.color(255, 255, 255, alpha)

    -- Draw cross lines
    render.line(cx - gap - size, cy - gap - size, cx - gap, cy - gap, color)
    render.line(cx + gap, cy - gap, cx + gap + size, cy - gap - size, color)
    render.line(cx - gap - size, cy + gap + size, cx - gap, cy + gap, color)
    render.line(cx + gap, cy + gap, cx + gap + size, cy + gap + size, color)
end)