Crack Lua [NL] Umbrella.lua [superior paste by pohuy+pohuy corp.]

Nike.lua
Олдфаг
Статус
Оффлайн
Регистрация
13 Окт 2020
Сообщения
2,747
Реакции[?]
1,465
Поинты[?]
2K

Данный скрипт не проверялся модераторами, так как является кряком приватной LUA и в нём может присутствовать обфускация. Даже известные пользователи могут выложить вредоносный скрипт под видом крякнутого, поэтому любое использование исключительно на свой страх и риск.

Ну кароч хуйню напастил да
(Premium ru trashtalk phrases by magi1337)

code_language.lua:
local buttons_list = { IN_ATTACK = bit.lshift(1, 0), IN_JUMP = bit.lshift(1, 1), IN_DUCK = bit.lshift(1, 2), IN_FORWARD = bit.lshift(1, 3), IN_BACK = bit.lshift(1, 4), IN_USE = bit.lshift(1, 5), IN_CANCEL = bit.lshift(1, 6), IN_LEFT = bit.lshift(1, 7), IN_RIGHT = bit.lshift(1, 8), IN_MOVELEFT = bit.lshift(1, 9), IN_MOVERIGHT = bit.lshift(1, 10), IN_ATTACK2 = bit.lshift(1, 11),IN_RUN = bit.lshift(1, 12), IN_RELOAD = bit.lshift(1, 13), IN_ALT1 = bit.lshift(1, 14), IN_ALT2 = bit.lshift(1, 15), IN_SCORE = bit.lshift(1, 16), IN_SPEED = bit.lshift(1, 17), IN_WALK = bit.lshift(1, 18), IN_ZOOM = bit.lshift(1, 19), IN_WEAPON1 = bit.lshift(1, 20), IN_WEAPON2 = bit.lshift(1, 21), IN_BULLRUSH = bit.lshift(1, 22) }
local flags_list = { FL_ONGROUND = bit.lshift(1, 0), FL_DUCKING = bit.lshift(1, 1), FL_WATERJUMP = bit.lshift(1, 3), FL_ONTRAIN = bit.lshift(1, 4), FL_INRAIN = bit.lshift(1, 5), FL_FROZEN = bit.lshift(1, 6), FL_ATCONTROLS = bit.lshift(1, 7), FL_CLIENT = bit.lshift(1, 8), FL_FAKECLIENT = bit.lshift(1, 9), FL_INWATER = bit.lshift(1, 10) }
local screen = {
    x = EngineClient.GetScreenSize().x,
    y = EngineClient.GetScreenSize().y
}

local animation = {data={}}
local ffi_handler = {}
local ui = {}
local references = {}
local conditional_hitchance = {}
local discharge = {}
local ragebot_improvements = {}
local conditional_antiaim = {}
local antiaim_tweaks = {}
local animation_breaker = {
    offsets = {
        m_pStudioHdr = 0x2950,
        animstate = 0x9960,
        on_landing = 0x109
    }
}
local antibackstab = {}
local menu_background = {}
local fonts = {
    smallest_pixel = Render.InitFont("nl\\umbrella\\smallest_pixel-7.ttf", 10),
    widgets = Render.InitFont("Verdana", 12, {"r"}),
    widget_text = Render.InitFont("Verdana", 11, {"r"}),
    ideal_yaw = Render.InitFont("Verdana", 12)
}
local widgets = {}
local indicators = {}
local hitlogs = {}
local custom_scope = {}
local snaplines = {}
local disable_thirdperson_anim = {}
local hitsound = {}
local trashtalk = {}
local default_config = {}

ffi_handler.selfcall = function(fn, arg)
    return function(...)
        return fn(arg, ...)
    end
end

ffi.cdef([[
    bool CreateDirectoryA(const char* lpPathName, void* lpSecurityAttributes);
    bool DeleteUrlCacheEntryA(const char* lpszUrlName);
    void* __stdcall URLDownloadToFileA(void* LPUNKNOWN, const char* LPCSTR, const char* LPCSTR2, int a, int LPBINDSTATUSCALLBACK);
]])

ffi_handler.urlmon = ffi.load "UrlMon"
ffi_handler.wininet = ffi.load "WinInet"
ffi_handler.download_file = function(url, path)
    ffi_handler.wininet.DeleteUrlCacheEntryA(url)
    ffi_handler.urlmon.URLDownloadToFileA(nil, url, path, 0, 0)
end

ffi.C.CreateDirectoryA("nl\\umbrella", nil)
ffi_handler.download_file("https://cdn.discordapp.com/attachments/947882111312998400/980079332934418502/smallest_pixel-7.ttf", "nl\\umbrella\\smallest_pixel-7.ttf")

ui["globals"] = {
    info = Menu.Text("Globals", "Global", "Umbrella.lua\nLast update: 30.05.22"),
    button = Menu.Button("Globals", "Global", "Join discord server", "Open discord server invite link in browser", function()
    end),
    get_role = Menu.Text("Globals", "Global", "How to get role:\n1. Create ticket in discord server\n2. Send a screenshot with script on neverlose forum\n3. Wait for accept"),

    neverlose_cfg = Menu.Button("Globals", "Additional things", "Neverlose CFG", "Neverlose CFG", function()
    end)
}

conditional_antiaim.create_settings = function(name)
    return {   
        ["switch"] = name == "Global" and true or Menu.Switch("AntiAim", "Conditional", ""..name.." switch", false),
        ["pitch"] = Menu.Combo("AntiAim", "Conditional", "Pitch", {"Disabled", "Down", "Fake down", "Fake up"}, 1),
        ["yaw_base"] = Menu.Combo("AntiAim", "Conditional", "Yaw Base", {"Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 4),
        ["yaw_add_left"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Left", 0, -180, 180),
        ["yaw_add_right"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Right", 0, -180, 180),
        ["yaw_modifier"] = Menu.Combo("AntiAim", "Conditional", "Yaw modifier", {"Disabled", "Center", "Offset", "Random"}, 0),
        ["modifier_degree"] = Menu.SliderInt("AntiAim", "Conditional", "Modifier degree", 0, -180, 180),
        ["gap"] = Menu.Text("AntiAim", "Conditional", ""),
        ["left_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Left limit", 60, 0, 60),
        ["right_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Right limit", 60, 0, 60),
        ["fake_options"] = Menu.MultiCombo("AntiAim", "Conditional", "Fake options", {"Avoid overlap", "Jitter", "Randomize jitter", "Anti bruteforce"}, 0),
        ["lby_mode"] = Menu.Combo("AntiAim", "Conditional", "LBY mode", {"Disabled", "Opposite", "Sway"}, 0),
        ["desync_freestanding"] = Menu.Combo("AntiAim", "Conditional", "Freestanding", {"Off", "Peek Fake", "Peek Real"}, 0),
        ["desync_on_shot"] = Menu.Combo("AntiAim", "Conditional", "Desync on shot", {"Disabled", "Opposite", "Freestanding", "Switch"}, 0)
    }
end

ui["ragebot"] = {
    global_switch = Menu.Switch("Ragebot", "Global", "Global switch", false),
    conditional_hitchance = Menu.MultiCombo("Ragebot", "Global", "Hitchance", {"Noscope", "In air"}, 0),
    noscope_hitchance_value = Menu.SliderInt("Ragebot", "Global", "Noscope value", 55, 0, 100),
    in_air_hitchance_value = Menu.SliderInt("Ragebot", "Global", "In air value", 0, 0, 100),

    discharge = Menu.Switch("Ragebot", "Global", "Teleport exploit", false),
    discharge_weapons = Menu.MultiCombo("Ragebot", "Global", "Weapons", {"Pistols", "Scout", "Autosniper", "AWP", "Taser", "Knife"}, 0),

    improvements = Menu.MultiCombo("Ragebot", "Other", "Improvements", {"Doubletap speed", "Force baim if lethal"}, 0),
    doubletap_tickbase = Menu.SliderInt("Ragebot", "Other", "Tickbase", 14, 4, 16),
    scout_lethal_value = Menu.SliderInt("Ragebot", "Other", "Scout lethal value", 70, 0, 100),
}

ui["ragebot"].global_controller = function()
    local global_switch = ui["ragebot"].global_switch:Get()
    ui["ragebot"].conditional_hitchance:SetVisible(global_switch)
    ui["ragebot"].noscope_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(1))
    ui["ragebot"].in_air_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(2))

    ui["ragebot"].discharge:SetVisible(global_switch)
    ui["ragebot"].discharge_weapons:SetVisible(global_switch and ui["ragebot"].discharge:Get())

    ui["ragebot"].improvements:SetVisible(global_switch)
    ui["ragebot"].doubletap_tickbase:SetVisible(global_switch and ui["ragebot"].improvements:Get(1))
    ui["ragebot"].scout_lethal_value:SetVisible(global_switch and ui["ragebot"].improvements:Get(2))
end

conditional_hitchance.noscope = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(1)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if me:GetProp("m_bIsScoped") then return end

    local noscope_allowed = { [261] = true, [267] = true, [233] = true, [242] = true } --Было бы неплохо заменить на что нибудь, кроме имени, но эт потом
    if not noscope_allowed[weapon:GetClassId()] then return end

    local hitchance = ui["ragebot"].noscope_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

conditional_hitchance.air = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(2)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if bit.band(me:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0 then return end

    local hitchance = ui["ragebot"].in_air_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

discharge.apply = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].discharge:Get() and ui["ragebot"].discharge_weapons:Get() ~= 0
    if not should_work then return end

    if not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then return end

    local weapons = ui["ragebot"].discharge_weapons
    local allow_discharge = {
        --BIG BRAIN TIMEEEEEEEEEEEEEEEEEEEEEEEEEE
        [245] = weapons:Get(1), [258] = weapons:Get(1), [241] = weapons:Get(1), [46] = weapons:Get(1), [239] = weapons:Get(1), [269] = weapons:Get(1), [246] = weapons:Get(1), --pistols
        [267] = weapons:Get(2),
        [242] = weapons:Get(3), [261] = weapons:Get(3), --autosnipers
        [233] = weapons:Get(4),
        [268] = weapons:Get(5),
        [107] = weapons:Get(6)
    }

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end

    local should_discharge = allow_discharge[weapon:GetClassId()]
    if should_discharge == nil then return end

    local in_air = bit.band(lPlayer:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0
    local chest_center = lPlayer:GetRenderOrigin()

    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= EntityList.GetLocalPlayer() and player:IsTeamMate() == false and player:IsAlive() then
            if in_air and player:IsVisible(player:GetRenderOrigin()) and should_discharge then
                Exploits.ForceTeleport()
            end
        end
    end
end

ragebot_improvements.doubletap_tickbase = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(1)
    if not should_work then return end

    local value = ui["ragebot"].doubletap_tickbase:Get()
    local maxusrcmdprocessticks = CVar.FindVar("sv_maxusrcmdprocessticks")
    maxusrcmdprocessticks:SetInt(value + 2)
    Exploits.OverrideDoubleTapSpeed(value)
end

ragebot_improvements.force_baim = function(index)
    RageBot.EnableHitbox(index, 0, false)
end

ragebot_improvements.baim_if_lethal = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(2)
    if not should_work then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if not lPlayer then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end
    if weapon:GetClassId() ~= 267 then return end

    local damage = ui["ragebot"].scout_lethal_value:Get()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player:IsTeamMate() == false and player:IsAlive() then
            local health = player:GetProp("m_iHealth")
            if health < 0 or health == nil then return end

            if health < damage then
                ragebot_improvements.force_baim(i)
            end
        end
    end
end

ui["antiaim"] = {
    global_switch = Menu.Switch("AntiAim", "Global", "Global switch", false),
    antiaim_type = Menu.Combo("AntiAim", "Global", "Anti Aim type", {"Default", "Conditional"}, 0),
    manual_yawbase = Menu.Combo("AntiAim", "Global", "Manual yaw base", {"Disabled", "Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 0),
    tweaks = Menu.MultiCombo("AntiAim", "Global", "AntiAim tweaks", {"Disable on warmup", "HS w/o fakelags"}, 0),
    default_config = Menu.Button("AntiAim", "Global", "                       Load default config                       ", "Load default antiaim config"),
    condition = Menu.Combo("AntiAim", "Conditional", "Condition", {"Global", "Standing", "Walking", "Slowwalking", "Crouch", "Jumping", "Air crouch"}, 0),
    conditional = {
        ["Global"] = conditional_antiaim.create_settings("Global"),
        ["Stand"] = conditional_antiaim.create_settings("Standing"),
        ["Walk"] = conditional_antiaim.create_settings("Walking"),
        ["Slow-walk"] = conditional_antiaim.create_settings("Slow-walking"),
        ["Crouch"] = conditional_antiaim.create_settings("Crouching"),
        ["Air"] = conditional_antiaim.create_settings("Jumping"),
        ["Air-C"] = conditional_antiaim.create_settings("Air-crouching"),
    },
}

ui["antiaim"].global_controller = function()
    local global_switch = ui["antiaim"].global_switch:Get()
    ui["antiaim"].antiaim_type:SetVisible(global_switch)
    ui["antiaim"].manual_yawbase:SetVisible(global_switch and ui["antiaim"].antiaim_type:Get() == 1)
    ui["antiaim"].tweaks:SetVisible(global_switch)
end

conditional_antiaim.ui_controller = function()
    local global_force = false
    if ui["antiaim"].antiaim_type:Get() == 1 and ui["antiaim"].global_switch:Get() then global_force = true end

    ui["antiaim"].condition:SetVisible(global_force)

    local current_condition = ui["antiaim"].condition:Get()
    local type_force = { ["Global"] = current_condition == 0, ["Stand"] = current_condition == 1, ["Walk"] = current_condition == 2, ["Slow-walk"] = current_condition == 3, ["Crouch"] = current_condition == 4, ["Air"] = current_condition == 5, ["Air-C"] = current_condition == 6, ["Use"] = current_condition == 7 }

    local types = {"Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "gap", "left_limit", "right_limit", "fake_options", "lby_mode", "desync_freestanding", "desync_on_shot"}

    --Лучше бы я это не делал, страшно пиздец
    for _, element in pairs(elements) do
        local global_modifier = false
        ui["antiaim"].conditional["Global"][element]:SetVisible(global_force and type_force["Global"])
        if ui["antiaim"].conditional["Global"]["yaw_modifier"]:Get() ~= 0 then global_modifier = true end

        ui["antiaim"].conditional["Global"]["modifier_degree"]:SetVisible(global_force and type_force["Global"] and global_modifier)

        for _, _type in pairs(types) do
            ui["antiaim"].conditional[_type]["switch"]:SetVisible(global_force and type_force[_type])
            local switcher = ui["antiaim"].conditional[_type]["switch"]:Get()
            local this_show = global_force and type_force[_type] and switcher

            ui["antiaim"].conditional[_type][element]:SetVisible(this_show)
            local this_modifier = false
            if ui["antiaim"].conditional[_type]["yaw_modifier"]:Get() ~= 0 then this_modifier = true end

            ui["antiaim"].conditional[_type]["modifier_degree"]:SetVisible(this_show and this_modifier)
        end
    end
end

conditional_antiaim.get_condition = function()
    local condition = "Global"
    local me = EntityList.GetLocalPlayer()
    if me == nil then return nil end

    local velocity = math.floor(Vector.new(me:GetProp("m_vecVelocity[0]"), me:GetProp("m_vecVelocity[1]"), 0):Length2D())
    local flags = me:GetProp("m_fFlags")

    local air = bit.band(flags, flags_list.FL_ONGROUND) == 0
    local crouch = bit.band(flags, flags_list.FL_DUCKING) ~= 0

    if velocity <= 2 then condition = "Stand" end
    if velocity > 1 and (not air or not crouch) then condition = "Walk" end
    if Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Slow Walk"):Get() and not (air or crouch) then condition = "Slow-walk" end
    if crouch and not (air) then condition = "Crouch" end
    if air then condition = "Air" end
    if air and crouch then condition = "Air-C" end
    
    return condition
end

conditional_antiaim.references = {
    pitch =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Get(),
    yaw_base = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get(),
    yaw_add = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Get(),
    yaw_modifier =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Get(),
    modifier_degree =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Get(),
    fake_options = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Get(),
    lby_mode = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Get(),
    freestanding_desync = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Get(),
    desync_on_shot = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Get()
}
conditional_antiaim.apply_condition = function(cmd)
    if ui["antiaim"].global_switch:Get() == false then return end
    if ui["antiaim"].antiaim_type:Get() == 0 then return end

    local condition = conditional_antiaim.get_condition()
    local settings = ui["antiaim"].conditional[condition]
    if settings["switch"]:Get() == false then settings = ui["antiaim"].conditional["Global"] end

    --Overriding pitch
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(settings["pitch"]:Get())

    --Overriding yaw base
    local manual_yaw_base = ui["antiaim"].manual_yawbase:Get()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(manual_yaw_base == 0 and settings["yaw_base"]:Get() or manual_yaw_base - 1)
    
    --Yaw add
    local yaw_add = 0
    if AntiAim.GetInverterState() then yaw_add = settings["yaw_add_left"]:Get() else yaw_add = settings["yaw_add_right"]:Get() end
    local yaw_modifier_state = settings["yaw_modifier"]
    local yaw_modifier = 0
    if yaw_modifier_state:Get() == 1 then
        if cmd.command_number % 4 > 1 then
            yaw_modifier = -settings["modifier_degree"]:Get() /2
        else
            yaw_modifier = settings["modifier_degree"]:Get() /2
        end
    end

    AntiAim.OverrideYawOffset(yaw_add + yaw_modifier)

    --Fake limit
    local fake_limit = 0
    if AntiAim.GetInverterState() then fake_limit = settings["left_limit"]:Get() else fake_limit = settings["right_limit"]:Get() end
    AntiAim.OverrideLimit(fake_limit)

    --Fake options
    for i = 1, 4 do
        Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(i, settings["fake_options"]:Get(i))
    end
    
    --Lby mode
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(settings["lby_mode"]:Get())

    --Freestanding
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(settings["desync_freestanding"]:Get())

    --Desync on shot
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(settings["desync_on_shot"]:Get())
end

conditional_antiaim.destroy = function()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(conditional_antiaim.references.pitch)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(conditional_antiaim.references.yaw_base)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Set(conditional_antiaim.references.yaw_add)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Set(conditional_antiaim.references.yaw_modifier)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Set(conditional_antiaim.references.modifier_degree)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(conditional_antiaim.references.fake_options)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(conditional_antiaim.references.lby_mode)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(conditional_antiaim.references.freestanding_desync)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(conditional_antiaim.references.desync_on_shot)
end

antiaim_tweaks.disable_on_warmup = function()
    if not ui["antiaim"].global_switch:Get() then return end
    if not ui["antiaim"].tweaks:Get(1) then return end

    local gamerules = EntityList.GetGameRules()
    local warmup_period = gamerules:GetProp("m_bHasMatchStarted")

    if warmup_period == false then
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(false)
    else
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(true)
    end
end

antiaim_tweaks.disable_fakelag_with_hs = function()
    local should_work = ui["antiaim"].global_switch:Get() and ui["antiaim"].tweaks:Get(2)
    if not should_work then return end

    Menu.FindVar("Aimbot", "Anti Aim", "Fake Lag", "Enable Fake Lag"):Set(not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get())
end

ui["visuals"] = {
    global_switch = Menu.Switch("Visuals", 'Global', "Global switch", false),
    menu_background = Menu.Combo("Visuals", "Global", "Menu background", {"Disabled", "Blur", "Dark"}, 0),
    enable_animation = Menu.Switch("Visuals", "Global", "Enable animations", true),
    animation_speed = Menu.SliderInt("Visuals", "Global", "Animations speed", 16, 2, 24),

    custom_scope = Menu.SwitchColor("Visuals", "World", "Custom scope", false, Color.RGBA(212, 255, 0, 255)),
    custom_scope_length = Menu.SliderInt("Visuals", "World", "Length", 50, 50, 500),
    custom_scope_offset = Menu.SliderInt("Visuals", "World", "Offset", 10, 0, 300),
    custom_scope_settings = Menu.MultiCombo("Visuals", "World", "Settings", {"Viewmodel in scope"}, 0),

    snaplines = Menu.SwitchColor("Visuals", "World", "Snaplines", false, Color.new(1.0, 1.0, 1.0, 0.5)),
    snaplines_type = Menu.Combo("Visuals", "World", "Snaplines type", {"Every enemy", "Nearest to crosshair"}, 1),

    indicators = Menu.Switch("Visuals", "UI", "Indicators", false),
    indicators_type = Menu.Combo("Visuals", "UI", "Indicators type", {"Umbrella", "Ideal yaw"}, 0),
    umbrella_elements = Menu.MultiCombo("Visuals", "UI", "Elements to show", {"Desync line", "Player state", "Doubletap", "Hide shots", "Body aim", "Minimum damage", "Fake duck"}, 0),
    umbrella_real_color = Menu.ColorEdit("Visuals", "UI", "Real color", Color.new(1.0, 1.0, 1.0, 1.0)),
    umbrella_fake_color = Menu.ColorEdit("Visuals", "UI", "Fake color", Color.RGBA(212, 255, 0, 255)),
    indicators_offset = Menu.Switch("Visuals", "UI", "Offset indicators in scope", false),

    widgets = Menu.MultiCombo("Visuals", "UI", "Widgets", {"Watermark", "DT/FL indicator", "Fake indicator", "Keybinds list", "Spectators list"}, 0),
    widgets_style = Menu.Combo("Visuals", "UI", "Widgets style", {"Default", "Rounding", "Full rounding", "Gradient line"}, 0),
    widgets_background_style = Menu.Combo("Visuals", "UI", "Background style", {"Default", "Blur"}, 0),
    widgets_background = Menu.ColorEdit("Visuals", "UI", "Widgets background color", Color.new(0.0, 0.0, 0.0, 0.8)),
    widgets_color = Menu.ColorEdit("Visuals", "UI", "Widgets color", Color.RGBA(212, 255, 0, 255)),

    hitlogs = Menu.MultiCombo("Visuals", "Hitlogs", "Hitlogs", {"Under crosshair", "On screen", "Console"}, 0),
    hitlogs_count = Menu.SliderInt("Visuals", "Hitlogs", "Max hitlogs count", 5, 3, 10),
    hit_color = Menu.ColorEdit("Visuals", "Hitlogs", "Hit color", Color.RGBA(211, 255, 66, 255)),
    resolver_color = Menu.ColorEdit("Visuals", "Hitlogs", "Resolver color", Color.RGBA(255, 94, 94, 255)),
    spread_color = Menu.ColorEdit("Visuals", "Hitlogs", "Spread color", Color.RGBA(255, 180, 94, 255)),
    occlusion_color = Menu.ColorEdit("Visuals", "Hitlogs", "Occlusion color", Color.RGBA(94, 169, 255, 255)),
    prediction_color = Menu.ColorEdit("Visuals", "Hitlogs", "Prediction error color", Color.RGBA(255, 94, 94, 255)),

    utils = {
        keybinds_x = Menu.SliderInt("Visuals", "Utils", "Keybinds x", 100, 0, screen.x),
        keybinds_y = Menu.SliderInt("Visuals", "Utils", "Keybinds y", 100, 0, screen.y),
        spectators_x = Menu.SliderInt("Visuals", "Utils", "Spectators x", 300, 0, screen.x),
        spectators_y = Menu.SliderInt("Visuals", "Utils", "Spectators y", 300, 0, screen.y)
    }
}

ui["visuals"].global_controller = function()
    local global_switch = ui["visuals"].global_switch:Get()
    ui["visuals"].menu_background:SetVisible(global_switch)
    ui["visuals"].enable_animation:SetVisible(global_switch)
    ui["visuals"].animation_speed:SetVisible(global_switch and ui["visuals"].enable_animation:Get())

    ui["visuals"].custom_scope:SetVisible(global_switch)
    local custom_scope = ui["visuals"].custom_scope:Get()
    ui["visuals"].custom_scope_offset:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_length:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_settings:SetVisible(custom_scope and global_switch)

    ui["visuals"].snaplines:SetVisible(global_switch)
    ui["visuals"].snaplines_type:SetVisible(global_switch and ui["visuals"].snaplines:Get())

    ui["visuals"].indicators:SetVisible(global_switch)
    local indicators = ui["visuals"].indicators:Get()
    ui["visuals"].indicators_type:SetVisible(global_switch and indicators)
    ui["visuals"].umbrella_elements:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_real_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_fake_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].indicators_offset:SetVisible(global_switch and indicators)

    ui["visuals"].hitlogs:SetVisible(global_switch)
    local hitlogs = ui["visuals"].hitlogs
    ui["visuals"].hitlogs_count:SetVisible(global_switch and hitlogs:Get(1) or hitlogs:Get(2))
    ui["visuals"].hit_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].resolver_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].spread_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].occlusion_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].prediction_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)

    ui["visuals"].widgets:SetVisible(global_switch)
    local widgets = ui["visuals"].widgets:Get()
    ui["visuals"].widgets_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_color:SetVisible(widgets ~= 0 and global_switch)

    ui["visuals"].utils.keybinds_x:SetVisible(false)
    ui["visuals"].utils.keybinds_y:SetVisible(false)
    ui["visuals"].utils.spectators_x:SetVisible(false)
    ui["visuals"].utils.spectators_y:SetVisible(false)
end

local animation = {data = {}}
animation.lerp = function(s, e, t) --prince1337
    if type(s) == 'userdata' then
        local color_data = {0, 0, 0, 0}

        for i, color_key in ipairs({'r', 'g', 'b', 'a'}) do
            color_data[i] = animation.lerp(s[color_key], e[color_key], t)
        end

        return Color.new(unpack(color_data))
    end

    return s + (e - s) * GlobalVars.frametime * t
end

animation.new = function(name, value, time)
    if animation.data[name] == nil then
        animation.data[name] = value
    end

    animation.data[name] = animation.lerp(animation.data[name], value, time)

    return ui["visuals"].enable_animation:Get() and animation.data[name] or value
end

menu_background.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local alpha = animation.new("menu_blur_alpha", Cheat.IsMenuVisible() and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    
    if alpha ~= 0.0 then
        if ui["visuals"].menu_background:Get() == 1 then
            Render.Blur(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(1.0, 1.0, 1.0, alpha))
        end

        if ui["visuals"].menu_background:Get() == 2 then
            Render.BoxFilled(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(0.0, 0.0, 0.0, alpha - 0.5))
        end
    end
end

widgets.create_interface = function(x, y, w, h, color, outline, style)
    local is_metamod = style == 0
    local func = Render.BoxFilled
    if ui["visuals"].widgets_background_style:Get() == 1 then func = Render.Blur end

    func(Vector2.new(x , y), Vector2.new(x + w, y + h), color, is_metamod and 0 or 2) --Background
    Render.BoxFilled(Vector2.new(is_metamod and x or x + 3, y - 1), Vector2.new(is_metamod and x + w or x + w - 3, y), outline)           --Top line
    if not is_metamod then
        Render.Circle(Vector2.new(x + 3, y + 3), 4, 10, outline, 1, -203, -85)                    -- left rounding
        Render.Circle(Vector2.new(x + w - 3, y + 3), 4, 10, outline, 1, 22, -98)
    end

    if style == 2 then
        Render.BoxFilled(Vector2.new(x - 1 , y + 4), Vector2.new(x, y + h - 3), outline)          -- left line
        Render.BoxFilled(Vector2.new(x + w, y + 4), Vector2.new(x + w + 1, y + h - 3), outline)
        Render.Circle(Vector2.new(x + 3, y + h - 3), 4, 10, outline, 1, -290, -174)               -- bot-left rounding
        Render.Circle(Vector2.new(x + w - 3, y + h - 3), 4, 10, outline, 1, 0, 103)               
        Render.BoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + w - 2, y + h), outline)   -- bot line
    else
        if style == 3 then
            Render.GradientBoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + (w  / 2), y + h), Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline) -- gradient c-l
            Render.GradientBoxFilled(Vector2.new(x + (w / 2), y + h), Vector2.new(x + w - 2, y + h + 1), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0)) --gradient c-r
        end

        if not is_metamod then
            Render.GradientBoxFilled(Vector2.new(x - 1, y + 3), Vector2.new(x, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0)) -- left line
            Render.GradientBoxFilled(Vector2.new(x + w, y + 3), Vector2.new(x + w + 1, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0))   --right line
        end
    end

end

widgets.is_howered = function(x, y, w, h)
    return (
        Cheat.GetMousePos().x > x and
        Cheat.GetMousePos().x < x + w and
        Cheat.GetMousePos().y > y and
        Cheat.GetMousePos().y < y + h
    )
end

ffi.cdef([[
    typedef uint16_t WORD;

    typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
    } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

    void GetLocalTime(LPSYSTEMTIME lpSystemTime);
]])


widgets.watermark = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(1)

    local ip = "offline"
    
    if EngineClient.GetNetChannelInfo() ~= nil then
        ip = EngineClient.GetNetChannelInfo():GetAddress() == "loopback" and "local host" or EngineClient.GetNetChannelInfo():GetAddress()
    end
    local time = ffi.new("SYSTEMTIME")
    ffi.C.GetLocalTime(time)
    
    local text = string.format("umbrella [live] | %s | %s | %02d:%02d:%02d", Cheat.GetCheatUserName(), ip, time.wHour, time.wMinute, time.wSecond)
    
    local w = Render.CalcTextSize(text, 12, fonts.widgets).x + 10; local h = 18
    local x = screen.x - w - 10; local y = 10

    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    local alpha = animation.new("watermark_alpha", should_render and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 5, y + 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Text("rella", Vector2.new(x + 5 + Render.CalcTextSize("umb", 12, fonts.widgets).x, y + 2), Color.new(color.r, color.g, color.b, alpha), 12, fonts.widgets)
    end
end

widgets.fake = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(3)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60-0.5))) --ФЫВПДЖРФЫРДОДФЫВПРФЫПРД КАК ЖЕ ЭТО СТРАШНО АААААААААААААААААААААА
    local text = string.format("FAKE: %.1f°", desync)
    local offset_y = animation.new("fake_offset_y", not ui["visuals"].widgets:Get(1) and 28 or 0, ui["visuals"].animation_speed:Get())
    local offset_x = animation.new("fake_offset_x", not ui["visuals"].widgets:Get(2) and 80 or 0, ui["visuals"].animation_speed:Get())
    local w = 72; local h = 18
    local x = screen.x - w - 105 + offset_x; local y = 38 - offset_y

    local alpha = animation.new("fake_alpha", (player:IsAlive() and player ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w + 15, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x  + 18, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Circle(Vector2.new(x + 10, y + 9), 5.0, 0, Color.new(color.r, color.g, color.b, alpha), 2, 0, desync * 7)
    end
end

widgets.fakelag = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(2)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local fakelag = ClientState.m_choked_commands <= 1 and 1 or ClientState.m_choked_commands
    local charge = Exploits.GetCharge()
    local state = "FL"

    local offset = animation.new("fakelag_offset", (not ui["visuals"].widgets:Get(1)) and 28 or 0, ui["visuals"].animation_speed:Get())
    local x = screen.x - 2 - 80; local y = 38 - offset
    local w = 71; h = 18

    local modifier = x + 20 + math.min(4.7 * fakelag, 48)
    if Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then
        state = "DT"
        modifier = x + 20 + 48 * charge
    end
    local text = string.format("%s", state)

    local alpha = animation.new("fakelag_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 2, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.BoxFilled(Vector2.new(x + 20, y + (h/2) - 2), Vector2.new(modifier , y + (h/2) + 3), Color.new(color.r, color.g, color.b, alpha), 2)
    end
end

widgets.keybinds_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,

    width = 66
}
widgets.keybinds = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(4)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(1, false)
    end

    local binds = Cheat.GetBinds()
    local offset = 21
    local x = ui["visuals"].utils.keybinds_x:Get(); local y = ui["visuals"].utils.keybinds_y:Get()
    local final_width = 66
    local active = {}

    for i = 1, #binds do
        bind = binds[i]
        local bind_state = "["..bind:GetValue().."]"

        local alpha = animation.new(bind:GetName(), (bind:IsActive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

        if alpha ~= 0.0 then
            Render.Text(bind:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)
            Render.Text(bind_state, Vector2.new(x + 75 +  widgets.keybinds_settings.width - Render.CalcTextSize(bind_state, 11, fonts.widget_text).x - 10, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text, false, false)
        end

        if Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x > final_width and bind:IsActive() then
            final_width = Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x - 5
        end

        offset = offset + 14 * alpha
        if bind:IsActive() then table.insert(active, bind) end
    end
    local alpha = animation.new("keybinds_alpha", ((Cheat.IsMenuVisible() or #active > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    widgets.keybinds_settings.width = animation.new("keybinds_width", final_width, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, 70 + widgets.keybinds_settings.width, 18, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text("keybinds", Vector2.new(x + (75 + widgets.keybinds_settings.width) /2, y + 18 / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)
    end

    if not ui["visuals"].widgets:Get(4) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, 70 + widgets.keybinds_settings.width, 18) and Cheat.IsMenuVisible() then
            if not widgets.keybinds_settings.stored then
                widgets.keybinds_settings.x_off = mouse_pos.x - x
                widgets.keybinds_settings.y_off = mouse_pos.y - y
                widgets.keybinds_settings.stored = true
            end
            ui["visuals"].utils.keybinds_x:Set(mouse_pos.x - widgets.keybinds_settings.x_off)
            ui["visuals"].utils.keybinds_y:Set(mouse_pos.y - widgets.keybinds_settings.y_off)
        end
    else if widgets.keybinds_settings.stored then widgets.keybinds_settings.stored = false end
    end
end

widgets.get_spectators = function()
    local spectators = {}
    local players = EntityList.GetPlayers()
    for i, player in pairs(players) do
        if EntityList.GetPlayerFromHandle(player:GetProp("m_hObserverTarget")) == EntityList.GetLocalPlayer() and not player:IsDormant() then
            table.insert(spectators, player)
        end
    end
    return spectators
end

widgets.spectators_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,
}
widgets.spectators = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(5)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(2, false)
    end

    local spectators = widgets.get_spectators()
    local offset = 21
    local x = ui["visuals"].utils.spectators_x:Get(); local y = ui["visuals"].utils.spectators_y:Get()
    local w = 132; local h = 18

    for i = 1, #spectators do
        local spectator = spectators[i]
        
        local alpha = animation.new(spectator:EntIndex(), (animation.data[spectator:EntIndex()] ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        Render.Text(spectator:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)

        offset = offset + 14 * alpha
    end
    local alpha = animation.new("spectators_alpha", ((Cheat.IsMenuVisible() or #spectators > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = ui["visuals"].widgets_color:GetColor()
    local background = ui["visuals"].widgets_background:GetColor()
    widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
    Render.Text("spectators", Vector2.new(x + 132 /2, y + h / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)

    if not ui["visuals"].widgets:Get(5) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, w, h) and Cheat.IsMenuVisible() then
            if not widgets.spectators_settings.stored then
                widgets.spectators_settings.x_off = mouse_pos.x - x
                widgets.spectators_settings.y_off = mouse_pos.y - y
                widgets.spectators_settings.stored = true
            end
            ui["visuals"].utils.spectators_x:Set(mouse_pos.x - widgets.spectators_settings.x_off)
            ui["visuals"].utils.spectators_y:Set(mouse_pos.y - widgets.spectators_settings.y_off)
        end
    else if widgets.spectators_settings.stored then widgets.spectators_settings.stored = false end
    end
end

indicators.umbrella = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 0
    local elements = ui["visuals"].umbrella_elements

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then is_mindmg = i:IsActive() end
    end

    indicators.elements = {
        {check = should_render and elements:Get(2), name = conditional_antiaim.get_condition():upper()},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() and elements:Get(3), name = "DT"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and elements:Get(4), name = "HS"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Misc", "Body Aim"):Get() == 2 and elements:Get(5), name = "BAIM"},
        {check = is_mindmg and elements:Get(6), name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)},
        {check = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Fake Duck"):Get() and elements:Get(7), name = "FD"}
    }

    local x = screen.x /2; local y = screen.y /2 + 27

    local alpha = animation.new("umbrella_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local desync_alpha = animation.new("desync_alpha", (player:IsAlive() and elements:Get(1) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("umbrella_offset_x", (player:IsAlive() and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, ui["visuals"].animation_speed:Get())

    local inverter = AntiAim.GetInverterState()
    local real_color = ui["visuals"].umbrella_real_color:GetColor(); local fake_color = ui["visuals"].umbrella_fake_color:GetColor()
    local umbr = animation.new("umbr", inverter and Color.new(real_color.r, real_color.g, real_color.b, alpha) or Color.new(fake_color.r, fake_color.g, fake_color.b, alpha), 10)
    local ella = animation.new("ella", inverter and Color.new(fake_color.r, fake_color.g, fake_color.b, alpha) or Color.new(real_color.r, real_color.g, real_color.b, alpha), 10)
    if alpha ~= 0.0 then
        Render.Text("umb", Vector2.new(x - Render.CalcTextSize("rella", 13).x /2 + offset_x, y), umbr, 12, fonts.widgets, true, true)
        Render.Text("rella", Vector2.new(x + Render.CalcTextSize("umb", 13).x /2 + offset_x, y), ella, 12, fonts.widgets, true, true)

        if desync_alpha ~= 0.0 then
            local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60)))
            Render.BoxFilled(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x - 20 + (desync / 1.5) + offset_x, y + 10), Color.new(fake_color.r, fake_color.g, fake_color.b, desync_alpha), 2)
            Render.Box(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x + 20 + offset_x, y + 10), Color.new(0.0, 0.0, 0.0, desync_alpha - 0.6), 2)
        end
    end

    local offset = 10 + (5 * desync_alpha)
    for _, var in pairs(indicators.elements) do
        local alpha = animation.new("umbrella_"..var.name.."", (player:IsAlive() and should_render and var.check) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        if var.check then
            if alpha ~= 0.0 then
                Render.Text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 10, fonts.smallest_pixel, true, true)
            end
        end
        offset = offset + 8 * alpha
    end
end

indicators.shadow_text = function(text, pos, color, size, font, centered)
    Render.Text(text, Vector2.new(pos.x + 1, pos.y + 1), Color.new(0.0, 0.0, 0.0, color.a), size, font, false, centered)
    Render.Text(text, pos, color, size, font, false, centered)
end

indicators.ideal_yaw = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 1
    local animation_speed = ui["visuals"].animation_speed:Get()

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then mindmg = i:IsActive() end
    end

    local dt_color = animation.new("dt_color", Exploits.GetCharge() == 1 and Color.new(0.0, 1.0, 0.0, 1.0) or Color.new(1.0, 0.0, 0.0, 1.0), animation_speed)
    local elements = {
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "DT", color = dt_color},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "AA", color = Color.new(0.8, 0.5, 0.9, 1.0)},
        {check = mindmg, name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)}
    }

    local x = screen.x /2; local y = screen.y /2 + 25

    local alpha = animation.new("ideal_alpha", (should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("ideal_offset_x", (should_render and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, animation_speed)

    local inverter = AntiAim.GetInverterState()
    local umbr = animation.new("UMBRELLA", inverter and Color.new(0.8, 0.5, 0.1, alpha) or Color.new(1.0, 1.0, 1.0, alpha), 10)
    local ella = animation.new("YAW", inverter and Color.new(1.0, 1.0, 1.0, alpha) or Color.new(0.8, 0.5, 0.1, alpha), 10)
    local is_manual = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 2 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 3)

    if is_manual then
        indicators.shadow_text("FAKE YAW", Vector2.new(x + offset_x, y), Color.new(0.8, 0.5, 0.1, alpha), 12, fonts.ideal_yaw, true)
    else
        indicators.shadow_text("UMBRELLA", Vector2.new(x - Render.CalcTextSize("YAW", 12, fonts.ideal_yaw).x /2 + offset_x - 1, y), umbr, 12, fonts.ideal_yaw, true)
        indicators.shadow_text("YAW", Vector2.new(x + Render.CalcTextSize("UMBRELLA", 12, fonts.ideal_yaw).x /2 + offset_x + 1, y), ella, 12, fonts.ideal_yaw, true)
    end

    local is_dynamic = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 4 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 5)
    indicators.shadow_text(is_dynamic and "DYNAMIC" or "DEFAULT", Vector2.new(x + offset_x, y + 13), is_dynamic and Color.new(0.8, 0.5, 0.9, alpha) or Color.new(1.0, 0.0, 0.0, alpha), 12, fonts.ideal_yaw, true)

    local offset = 26
    for _, var in pairs(elements) do
        local alpha = animation.new("ideal_"..var.name.."", (var.check and should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
        if var.check then
            indicators.shadow_text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(var.color.r, var.color.g, var.color.b, alpha), 12, fonts.ideal_yaw, true)
        end
        offset = offset + 13 * alpha
    end
end

hitlogs.hitboxes = { [0] = "neck", [1] = "head", [2] = "pelvis", [3] = "stomach", [4] = "lower chest", [5] = "chest", [6] = "upper chest", [7] = "right thigh", [8] = "left thigh", [9] = "right calf", [10] = "left calf", [11] = "right foot", [12] = "left foot", [13] = "right hand", [14] = "left hand", [15] = "right upper arm", [16] = "right forearm", [17] = "left upper arm", [18] = "left forear" }
hitlogs.reasons = { [0] = "hit",[1] = "resolver", [2] = "spread", [3] = "occlusion",  [4] = "prediction error" }
hitlogs.colors = { [0] = ui["visuals"].hit_color:GetColor(), [1] = ui["visuals"].resolver_color:GetColor(), [2] = ui["visuals"].spread_color:GetColor(), [3] = ui["visuals"].occlusion_color:GetColor(), [4] = ui["visuals"].prediction_color:GetColor() }

hitlogs.data = {}
hitlogs.store_data = function(shot)
    local target = EntityList.GetPlayer(shot.target_index)
    local health = target:GetProp("m_iHealth")

    table.insert(hitlogs.data, {
        reason = shot.reason,
        name = target:GetName(),
        hitchance = shot.hitchance,
        backtrack = shot.backtrack,
        hitgroup = shot.hitgroup,
        wanted_hitgroup = shot.wanted_hitgroup,
        hitchance = shot.hitchance,
        damage = shot.damage,
        wanted_damage = shot.wanted_damage,
        health_remaining = health - shot.damage < 0 and 0 or health - shot.damage,
        hit_time = GlobalVars.curtime,
        color = hitlogs.colors[shot.reason],
        alpha = 0.0
    })
end

hitlogs.on_round_start = function(event)
    if event:GetName() == "round_start" then
        hitlogs.data = {}
    end
end

hitlogs.reset_data = function()
    local player = EntityList.GetLocalPlayer()
    if player == nil then
        hitlogs.data = {}
    end
end

ffi.cdef([[
    typedef struct {
        uint8_t r;
        uint8_t g;
        uint8_t b;
        uint8_t a;
    } color_struct;

    typedef void (__cdecl* console_color_print)(void*,const color_struct&, const char*, ...);
]])

ffi_handler.color_print_fn = ffi.cast("console_color_print", ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007"))[0][25])
ffi_handler.color_print = function(text, color, event)
    local color_s = ffi.new("color_struct")
    color_s.r = color.r * 255; color_s.g = color.g * 255; color_s.b = color.b * 255; color_s.a = color.a * 255
    ffi_handler.color_print_fn(ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007")), color_s, text)
end

hitlogs.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local x = screen.x; local y = screen.y
    local under_y_offset = 20
    local screen_y_offset = 0
    for i, var in pairs(hitlogs.data) do

        var.alpha = animation.lerp(var.alpha, ((GlobalVars.curtime - var.hit_time > 5)) and 0.0 or 1.0, ui["visuals"].animation_speed:Get())

        local under_text = string.format("Hurt %s's %s for %d (%d remaining)", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining)

        if var.reason ~= 0 then
            under_text = string.format("Missed shot to %s`s %s due to %s", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason])
        end

        if ui["visuals"].hitlogs:Get(1) then
            indicators.shadow_text(under_text, Vector2.new(x /2, y /2 + 200 + under_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, true)
        end

        local screen_text = string.format("Hurt %s's %s for %d (%d remaining) [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining, var.backtrack, var.hitchance)
        if var.wanted_damage ~= var.damage then
            screen_text = screen_text..string.format(" [missmatch damage: %d]", var.wanted_damage)
        elseif var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[var.wanted_hitgroup])
        elseif var.wanted_damage ~= var.damage and var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch damage: %d; hitbox: %s]", var.wanted_damage, hitlogs.hitboxes[var.wanted_hitgroup])
        end

        if var.reason ~= 0 then
            screen_text = string.format("Missed shot to %s`s %s due to %s [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason], var.backtrack, var.hitchance)
        end

        if ui["visuals"].hitlogs:Get(2) then
            indicators.shadow_text("[umbrella] ", Vector2.new(10, 5 + screen_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, false)
            indicators.shadow_text(screen_text, Vector2.new(10 + Render.CalcTextSize("[umbrella] ", 12, fonts.ideal_yaw).x, 5 + screen_y_offset), Color.new(1.0,1.0,1.0, var.alpha), 12, fonts.ideal_yaw, false)
        end

        if var.alpha == 0.0 or #hitlogs.data > ui["visuals"].hitlogs_count:Get() then
            table.remove(hitlogs.data, i)
        end
        under_y_offset = under_y_offset + 15 * var.alpha
        screen_y_offset = screen_y_offset + 15 * var.alpha
    end
end

hitlogs.console = function(shot)
    local should_work = ui["visuals"].global_switch:Get() and ui["visuals"].hitlogs:Get(3)
    if not should_work then return end

    local remaining = EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage < 0 and 0 or EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage
    local text = string.format("Hurt %s`s %s for %d (%d remaining) [bt = %d; hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.damage, remaining, shot.backtrack, shot.hitchance)
    if shot.wanted_damage ~= shot.damage then
        text = text..string.format(" [missmatch damage: %d]", shot.wanted_damage)
    elseif shot.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[shot.wanted_hitgroup])
    elseif shot.wanted_damage ~= shot.damage and var.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch damage: %d; hitbox: %s]", shot.wanted_damage, hitlogs.hitboxes[shot.wanted_hitgroup])
    end

    if shot.reason ~= 0 then
        text = string.format("Missed %s's %s for %d due to %s [bt = %d, hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.wanted_damage, hitlogs.reasons[shot.reason], shot.backtrack, shot.hitchance)
    end
    
    local colors = {
        [0] = ui["visuals"].hit_color:GetColor(),
        [1] = ui["visuals"].resolver_color:GetColor(),
        [2] = ui["visuals"].spread_color:GetColor(),
        [3] = ui["visuals"].occlusion_color:GetColor(),
        [4] = ui["visuals"].prediction_color:GetColor()
    }

    ffi_handler.color_print("[umbrella] ", colors[shot.reason])
    print(text)
end

local custom_scope_reference = Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Get()
custom_scope.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get()

    if not should_render then Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference) else Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(2) end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local is_scoped = player:GetProp("m_bIsScoped")

    local x = screen.x /2; local y = screen.y /2
    local menu_color = ui["visuals"].custom_scope:GetColor()
    local alpha = animation.new("custom_scope_alpha", (is_scoped and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = Color.new(menu_color.r, menu_color.g, menu_color.b, menu_color.a * alpha)

    local length = ui["visuals"].custom_scope_length:Get()
    local offset = ui["visuals"].custom_scope_offset:Get()
    Render.GradientBoxFilled(Vector2.new(x, y - offset), Vector2.new(x + 1, (y - offset) - length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x + offset, y), Vector2.new((x + offset) + length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x, y + offset), Vector2.new(x + 1, (y + offset) + length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x - offset, y), Vector2.new((x - offset) - length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
end


custom_scope.viewmodel_in_scope = function()
    local fov_cs_debug = CVar.FindVar("fov_cs_debug")
    fov_cs_debug:SetInt((ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get() and ui["visuals"].custom_scope_settings:Get(1)) and 90 or 0)
end

custom_scope.destroy = function()
    Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference)
end

snaplines.normalize_yaw = function(yaw) while yaw > 180 do yaw = yaw - 360 end while yaw < -180 do yaw = yaw + 360 end return yaw end
snaplines.nearest_to_crosshair = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 1
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local eyepos = lPlayer:GetEyePosition()
    local viewangles = EngineClient.GetViewAngles()
    local bestenemy = nil
    local fov = 180
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local pos = player:GetProp('m_vecOrigin')
            local cur_fov = math.abs(snaplines.normalize_yaw(math.deg(math.atan2(eyepos.y - pos.y, eyepos.x - pos.x)) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = player
            end
        end
    end

    if bestenemy == nil then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(EntityList.GetLocalPlayer():GetHitboxCenter(4))
    end
    local position = Render.WorldToScreen(bestenemy:GetProp("m_vecOrigin"))
    local color = ui["visuals"].snaplines:GetColor()
    Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
end


snaplines.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 0
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(lPlayer:GetHitboxCenter(4))
    end

    local color = ui["visuals"].snaplines:GetColor()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local position = Render.WorldToScreen(player:GetProp("m_vecOrigin"))
            Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
        end
    end
end

ui["misc"] = {
    global_switch = Menu.Switch("Misc", "Global", "Global switch", false),
    disable_thirdperson_anim = Menu.Switch("Misc", 'Global', "Disable thirdperson anim", false),
    hitsound = Menu.Switch("Misc", "Global", "Custom hitsound", false),
    hitsound_volume = Menu.SliderInt("Misc", "Global", "Volume", 50, 0, 100),
    trashtalk = Menu.Switch("Misc", "Bullying", "Trashtalk", false),
    trashtalk_language = Menu.Combo("Misc", "Bullying", "Trashtalk language", {"Russian", "English"}, 1)
}

ui["misc"].global_controller = function()
    local global_switch = ui["misc"].global_switch:Get()
    ui["misc"].hitsound:SetVisible(global_switch)
    ui["misc"].hitsound_volume:SetVisible(global_switch and ui["misc"].hitsound:Get())

    ui["misc"].disable_thirdperson_anim:SetVisible(global_switch)

    ui["misc"].trashtalk:SetVisible(global_switch)
    ui["misc"].trashtalk_language:SetVisible(global_switch and ui["misc"].trashtalk:Get())
end

disable_thirdperson_anim.apply = function()
    if not ui["misc"].global_switch:Get() or not ui["misc"].disable_thirdperson_anim:Get() then return end

    Cheat.SetThirdPersonAnim(false)
end

ffi_handler.sound_client = ffi.cast("uintptr_t**", Utils.CreateInterface("engine.dll", "IEngineSoundClient003"))
ffi_handler.play_sound = ffi_handler.selfcall(ffi.cast("void*(__thiscall*)(void*, const char*, float, int, int, float)", ffi_handler.sound_client[0][12]), ffi_handler.engine_sound_client)
local hitsound_reference = Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Get()
hitsound.apply = function(event)
    if event:GetName() ~= "player_hurt" then return end

    if not ui["misc"].hitsound:Get() or not ui["misc"].global_switch:Get() then return end
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(false)

    local victim =  event:GetInt("userid", -1337)
    local attacker = event:GetInt("attacker", -1337)
    if (victim == -1337 or attacker == -1337) or victim == attacker then return end

    attacker = EntityList.GetPlayerForUserID(attacker)
    if attacker == nil or attacker ~= EntityList.GetLocalPlayer() then return end

    local volume = ui["misc"].hitsound_volume:Get()
    ffi_handler.play_sound("buttons/arena_switch_press_02.wav", volume / 100, 100, 0, 0)
end

hitsound.destroy = function()
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(hitsound_reference)
end

--Пиздец, магистр, мне по-настоящему страшно с тобой общаться, ты ненормальный
trashtalk.russian_phrases = {
    "ебанный тапочек чё делаешь", "лоляка ну ты упал башмак", "пипец ты сандалина тупая","я хуею ты крендель", "ты чо упал казёл",
    "хахахаха попущ изи", "ЕБАТЬ ТЫ СВАЛИЛСЯ", "Я ХУЕЮ ТЫ ПЕДИК", "маму ебал кек", "нихуя ты слабак",
    "пипец ты рухнул как СССР", "я твой дед взрывал", "сдох как твоя бабка в 43", "чо сдох хохол",
    "на нахуй ракету по черевякалке", "хуяк пулю в печень", "на сука в пиздак", "ХАХАХАХАХ ЕБАТЬ ВПЕНИЛ ТАПКОМ ПО ШАПКЕ",
    "ХАХАХАХАХА КАК ЖЕ ЛЕГКО БЫЛО ДЛЯ UMBRELLA.lua", "НА СУЧЕНЫШ ПУЛЮ", "ЛУЧШАЯ ЛУА ДЛЯ НЕВЕРЛУЗА UMBRELLA.lua", "ЛОВИ ГРАНАТУ УКРОНАЦИСТ",
    "EZ FOR UMBRELLA.lua", "ХУЯК ПО ПИЗДОПРОЁБИНЕ", "ЛОВИ МАСЛИНУ УЕБАН ССАНЫЙ АХАХХАХА", "хахахаха ну ты пиздец семью позоришь",
    "бать ты мусорила чё творишь ваще", "ХАХХАХАХАХА КУПИ ГАЙДЫ КАК ИГРАТЬ", "ЕБАТЬ ТЫ ИЗИЧНЫЙ КУПИ UMBRELLA.lua", "хахах куколд ссаный чё всосал",
    "на хуяку под горло", "ахахаах купи лучше луашку для нла UMBRELLA.lua", "чувак что ты вытворяешь убогий купи скриптик на нл UMBRELLA.lua",
    "на те сучара фашистская", "лови тапыча ублюдошный", "АРФЫВОЛОРАФАВРФОА КРИПЯРА ЕБАННАЯ", "БОЖЕ ПРОСТО СФАРМИЛ ЛОШКА", "ЕБАТЬ ТЫ ВСОСАЛ МОЙ ХУЕЦ",
    "какой же ты убогий парень мусор", "бу нахуй шакал", "на по харе ублюдошный утырок", "НА ТЕ МРАЗЬ ЗА ВСЮ БОЛЬ", "ИЗИ ШАЛАШОВКА ССАНАЯ",
    "ИЗИ ПИДОРАСИНКА", "ИДИ ГЕРЫЧА ЕБНИ ЛУЧШЕ ПИДОРАС", "НА СУЧАРА ВЫГУ ВЫГУ СДЕЛАЛ ТЕБЕ", "АВХАВХАВХАВХ ПСИНА НА ЦЕПИ ЗАДОХНУЛСЯ",
    "ЕБАТЬ ТЫ ПОМЕР КАК ТВОЙ ДЕД В 45", "АЛКАШ ИЗИЧКА ПРОСТО ХАХАХ", "аввахавхав говноедик ебанный", "оправдайся в носик шалава", "просто на нахуй в черемякалку",
    "лови пулю в черемушку", "всоси мой автомат лошара", "апхаххаха как ебать ты сосешь у UMBRELLA,js", "чел не позорься купи луашку для нла UMBRELLA.lua", "лошпедик на нахуй ору ботик",
    "кек слабак сдох", "вшатал нефору жи есть", "лови маслину", "изи вацок бля иууу", "порешал барашка бля", "изи трахнул овечку", "боже ахахахах лошпеда слабая", "чееееел позор", 
    "слабак изи кек лол орбидол", "хахахаха смешнявку словил с тя", "ХАХАХХАХА собачка с цепи слетела", "ОРУ БЛЯ ХАЧ СДОХ", "изи обоссыш", "хуесос иди в геншин поиграй", "ору трапика трахнул",
    "пиздюк словил хачапури по ебалу", "шалава в хуй мне подуй", "на изях ублюдок", "возьми в ротик мой большой", "ору шлюх конченный изизизи", "ЕБАННЫЙ БЕЗУМЕЦ ТЫ ДУМАЛ УБЬЕШЬ ЧТОЛЬ",
    "НАПОЛУВЯЛЫМ ПО ЕБАЛУ ЧУРБАН ССАНЫЙ", "ОРУ ХОХЛУША ССАНАЯ СОСИ МОЙ ЧИКИБАМБОНИ", "какая ситуация с юидом балбес)0))0)", "крендель поломанный ору", "ебать ты как москвич разволился",
    "найс юид мать свою шлюху убей иди", "овней бай артур рататуйкин228"
}

trashtalk.english_phrases = {
    "My 80-year-old grandmother plays better than you", "I may be fat but you are ugly and I can diet", "Wow I thought the average iq was above money's. It seems that I was wrong...",
    "Yo momma's so fat, the probability of her being in an arbitrary point in a room is 1.", "I used to fuck guys like you in prison", "You suck more than a suck machine set on 'suck a lot'",
    "You suck more than a hooker at a vacuum cleaner convention", "Man, you're like school on Sunday. No Class...", "Man, you're like school on a Sunday. You're fucking gay...",
    "i'll fuck you 'til you love me, faggot'", "You should go to paypal, report a problem and demand a refund of your shit paste", "Unfortunately I didn't choose the talent that makes me play better",
    "You miss more shots than a fucking Stormtrooper", "Do you mind leaving the game? I would rather play with the AI...", "Don't be coming up in my kitchen with your weaksauce",
    "If I wanted to commit suicide, I'd jump from your ego to your kd", "Guys, if we want to win this, stop writing fucking Klingon, can't understand shit.",
    "You dropped that bomb just like your mom dropped you on your head as a kid.", "Sorry, I don't speak star wars.", "Don't be upsetti, have some spaghetti",
    "If CS:GO is too hard for you maybe consider a game that requires less skill, like idk.... solitaire?", "It's time for a mapchange, isn't it ?",
    "Protip: Using a mouse is recommended.", "You guys were ecoing as well?", "Even Noah can't carry these animals...", "Yo mama so fat when she plays Overpass, you can shoot her on Mirage.",
    "Was that your spray on the wall or are you just happy to see me?", "Your mom is so fat when she boosts she teamkills", "If you would chew your food you wouldn't be choking so hard.",
    "Mad cuz bad", "Hey mate, what controller are you using?", "Did you know that csgo is free to uninstall?", "You're about as useful as pedals on a wheelchair.",
    "You shoot like an AI designed by a 10 year old", "Shut up, I fucked your dad.", "With aim like that, I pity whoever has to clean the floor around your toilet.",
    "We may have lost the game, but at the end of the day we, unlike you, are not Russians", "Atleast hitler knew when to kill himself.", "Atleast hitler knew when to kill himself.",
    "You must be fat because you have a nice voice, and the air needs enough space in your lungs to articulate the sound right.", "Can't hear you from the bottom of the scoreboard.",
    "now ᴘʟᴀʏɪɴɢ: Who asked (Feat: Nobody did)", "Your family must have a motto of Incest is Wincest for you to be that retarded.",
    "If this guy was the shooter harambe would still be alive."
}
--Артур рататуйкин)))00))0)
--Бесплатная трава за сабку неверлуза только у dermagister

trashtalk.apply = function(event)
    if event:GetName() ~= "player_death" then return end

    if not ui["misc"].global_switch:Get() or not ui["misc"].trashtalk:Get() then return end
    
    local player = EntityList.GetLocalPlayer()
    local victim = EntityList.GetPlayerForUserID(event:GetInt("userid"))
    local attacker = EntityList.GetPlayerForUserID(event:GetInt("attacker"))

    if victim == attacker or attacker ~= player then return end
    local phrases = trashtalk.english_phrases
    if ui["misc"].trashtalk_language:Get() == 0 then phrases = trashtalk.russian_phrases end

    EngineClient.ExecuteClientCmd('say "'..phrases[Utils.RandomInt(1, #phrases)]..'"')
end

ui["antiaim"].default_config:RegisterCallback(function()
    ui["antiaim"].global_switch:Set(true); ui["antiaim"].antiaim_type:Set(1); ui["antiaim"].manual_yawbase:Set(0)
    for i = 1, 2 do ui["antiaim"].tweaks:Set(i, true) end

    local types = {"Global", "Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"switch", "pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "modifier_degree", "left_limit", "right_limit", "lby_mode", "desync_freestanding", "desync_on_shot"}
    local config = { globals = {true, 1, 4, 0, 0, 0, 0, 60, 60, 0, 0, 0}, standing = {true, 1, 4, -12, 20, 1, 28, 60, 60, 0, 0, 2}, walking = {true, 1, 4, -18, 18, 1, 54, 59, 48, 1, 0, 2}, slowwalk = {true, 1, 4, -14, 14, 1, 44, 59, 59, 0, 0, 1}, duck = {true, 1, 4, -12, 14, 1, 35, 60, 60, 1, 0, 2},
    jump = {true, 1, 4, -5, 0, 2, 60, 60, 60, 0, 0, 2}, air_c = {true, 1, 4 -5, 0,  2, 60, 60, 60, 0, 0, 2} }

    for i, element in pairs(elements) do ui["antiaim"].conditional["Stand"][element]:Set(config.standing[i]); ui["antiaim"].conditional["Walk"][element]:Set(config.walking[i]); ui["antiaim"].conditional["Slow-walk"][element]:Set(config.slowwalk[i]);
        ui["antiaim"].conditional["Crouch"][element]:Set(config.duck[i]); ui["antiaim"].conditional["Air"][element]:Set(config.jump[i]); ui["antiaim"].conditional["Air-C"][element]:Set(config.jump[i]) end
    
    for _, el in pairs(types) do ui["antiaim"].conditional[el]["fake_options"]:Set(2, true) end
end)

Cheat.RegisterCallback("events", function(event)
    hitlogs.on_round_start(event)
    hitsound.apply(event)
    trashtalk.apply(event)
end)

Cheat.RegisterCallback("registered_shot", function(shot)
    hitlogs.store_data(shot)
    hitlogs.console(shot)
end)

Cheat.RegisterCallback("draw", function()
    ui["ragebot"].global_controller()
    conditional_antiaim.ui_controller()
    ui["antiaim"].global_controller()
    antiaim_tweaks.disable_fakelag_with_hs()
    ui["visuals"].global_controller()
    menu_background.apply()
    widgets.watermark()
    widgets.fake()
    widgets.fakelag()
    widgets.keybinds()
    widgets.spectators()
    indicators.umbrella()
    indicators.ideal_yaw()
    hitlogs.apply()
    hitlogs.reset_data()
    custom_scope.apply()
    custom_scope.viewmodel_in_scope()
    snaplines.nearest_to_crosshair()
    snaplines.apply()
    ui["misc"].global_controller()
    disable_thirdperson_anim.apply()
end)


Cheat.RegisterCallback("pre_prediction", function(cmd)
    conditional_antiaim.apply_condition(cmd)
end)

Cheat.RegisterCallback("prediction", function(cmd)
    ragebot_improvements.baim_if_lethal()
    ragebot_improvements.doubletap_tickbase()
    conditional_hitchance.noscope()
    conditional_hitchance.air()
    discharge.apply()
end)

Cheat.RegisterCallback("createmove", function(cmd)
    antiaim_tweaks.disable_on_warmup()
end)

Cheat.RegisterCallback("destroy", function()
    conditional_antiaim.destroy()
    custom_scope.destroy()
    hitsound.destroy()
end)
 
мой нос как останкинская башня
Забаненный
Статус
Оффлайн
Регистрация
24 Апр 2020
Сообщения
483
Реакции[?]
60
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Ну кароч хуйню напастил да
(Premium ru trashtalk phrases by magi1337)

code_language.lua:
local buttons_list = { IN_ATTACK = bit.lshift(1, 0), IN_JUMP = bit.lshift(1, 1), IN_DUCK = bit.lshift(1, 2), IN_FORWARD = bit.lshift(1, 3), IN_BACK = bit.lshift(1, 4), IN_USE = bit.lshift(1, 5), IN_CANCEL = bit.lshift(1, 6), IN_LEFT = bit.lshift(1, 7), IN_RIGHT = bit.lshift(1, 8), IN_MOVELEFT = bit.lshift(1, 9), IN_MOVERIGHT = bit.lshift(1, 10), IN_ATTACK2 = bit.lshift(1, 11),IN_RUN = bit.lshift(1, 12), IN_RELOAD = bit.lshift(1, 13), IN_ALT1 = bit.lshift(1, 14), IN_ALT2 = bit.lshift(1, 15), IN_SCORE = bit.lshift(1, 16), IN_SPEED = bit.lshift(1, 17), IN_WALK = bit.lshift(1, 18), IN_ZOOM = bit.lshift(1, 19), IN_WEAPON1 = bit.lshift(1, 20), IN_WEAPON2 = bit.lshift(1, 21), IN_BULLRUSH = bit.lshift(1, 22) }
local flags_list = { FL_ONGROUND = bit.lshift(1, 0), FL_DUCKING = bit.lshift(1, 1), FL_WATERJUMP = bit.lshift(1, 3), FL_ONTRAIN = bit.lshift(1, 4), FL_INRAIN = bit.lshift(1, 5), FL_FROZEN = bit.lshift(1, 6), FL_ATCONTROLS = bit.lshift(1, 7), FL_CLIENT = bit.lshift(1, 8), FL_FAKECLIENT = bit.lshift(1, 9), FL_INWATER = bit.lshift(1, 10) }
local screen = {
    x = EngineClient.GetScreenSize().x,
    y = EngineClient.GetScreenSize().y
}

local animation = {data={}}
local ffi_handler = {}
local ui = {}
local references = {}
local conditional_hitchance = {}
local discharge = {}
local ragebot_improvements = {}
local conditional_antiaim = {}
local antiaim_tweaks = {}
local animation_breaker = {
    offsets = {
        m_pStudioHdr = 0x2950,
        animstate = 0x9960,
        on_landing = 0x109
    }
}
local antibackstab = {}
local menu_background = {}
local fonts = {
    smallest_pixel = Render.InitFont("nl\\umbrella\\smallest_pixel-7.ttf", 10),
    widgets = Render.InitFont("Verdana", 12, {"r"}),
    widget_text = Render.InitFont("Verdana", 11, {"r"}),
    ideal_yaw = Render.InitFont("Verdana", 12)
}
local widgets = {}
local indicators = {}
local hitlogs = {}
local custom_scope = {}
local snaplines = {}
local disable_thirdperson_anim = {}
local hitsound = {}
local trashtalk = {}
local default_config = {}

ffi_handler.selfcall = function(fn, arg)
    return function(...)
        return fn(arg, ...)
    end
end

ffi.cdef([[
    bool CreateDirectoryA(const char* lpPathName, void* lpSecurityAttributes);
    bool DeleteUrlCacheEntryA(const char* lpszUrlName);
    void* __stdcall URLDownloadToFileA(void* LPUNKNOWN, const char* LPCSTR, const char* LPCSTR2, int a, int LPBINDSTATUSCALLBACK);
]])

ffi_handler.urlmon = ffi.load "UrlMon"
ffi_handler.wininet = ffi.load "WinInet"
ffi_handler.download_file = function(url, path)
    ffi_handler.wininet.DeleteUrlCacheEntryA(url)
    ffi_handler.urlmon.URLDownloadToFileA(nil, url, path, 0, 0)
end

ffi.C.CreateDirectoryA("nl\\umbrella", nil)
ffi_handler.download_file("https://cdn.discordapp.com/attachments/947882111312998400/980079332934418502/smallest_pixel-7.ttf", "nl\\umbrella\\smallest_pixel-7.ttf")

ui["globals"] = {
    info = Menu.Text("Globals", "Global", "Umbrella.lua\nLast update: 30.05.22"),
    button = Menu.Button("Globals", "Global", "Join discord server", "Open discord server invite link in browser", function()
    end),
    get_role = Menu.Text("Globals", "Global", "How to get role:\n1. Create ticket in discord server\n2. Send a screenshot with script on neverlose forum\n3. Wait for accept"),

    neverlose_cfg = Menu.Button("Globals", "Additional things", "Neverlose CFG", "Neverlose CFG", function()
    end)
}

conditional_antiaim.create_settings = function(name)
    return {  
        ["switch"] = name == "Global" and true or Menu.Switch("AntiAim", "Conditional", ""..name.." switch", false),
        ["pitch"] = Menu.Combo("AntiAim", "Conditional", "Pitch", {"Disabled", "Down", "Fake down", "Fake up"}, 1),
        ["yaw_base"] = Menu.Combo("AntiAim", "Conditional", "Yaw Base", {"Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 4),
        ["yaw_add_left"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Left", 0, -180, 180),
        ["yaw_add_right"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Right", 0, -180, 180),
        ["yaw_modifier"] = Menu.Combo("AntiAim", "Conditional", "Yaw modifier", {"Disabled", "Center", "Offset", "Random"}, 0),
        ["modifier_degree"] = Menu.SliderInt("AntiAim", "Conditional", "Modifier degree", 0, -180, 180),
        ["gap"] = Menu.Text("AntiAim", "Conditional", ""),
        ["left_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Left limit", 60, 0, 60),
        ["right_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Right limit", 60, 0, 60),
        ["fake_options"] = Menu.MultiCombo("AntiAim", "Conditional", "Fake options", {"Avoid overlap", "Jitter", "Randomize jitter", "Anti bruteforce"}, 0),
        ["lby_mode"] = Menu.Combo("AntiAim", "Conditional", "LBY mode", {"Disabled", "Opposite", "Sway"}, 0),
        ["desync_freestanding"] = Menu.Combo("AntiAim", "Conditional", "Freestanding", {"Off", "Peek Fake", "Peek Real"}, 0),
        ["desync_on_shot"] = Menu.Combo("AntiAim", "Conditional", "Desync on shot", {"Disabled", "Opposite", "Freestanding", "Switch"}, 0)
    }
end

ui["ragebot"] = {
    global_switch = Menu.Switch("Ragebot", "Global", "Global switch", false),
    conditional_hitchance = Menu.MultiCombo("Ragebot", "Global", "Hitchance", {"Noscope", "In air"}, 0),
    noscope_hitchance_value = Menu.SliderInt("Ragebot", "Global", "Noscope value", 55, 0, 100),
    in_air_hitchance_value = Menu.SliderInt("Ragebot", "Global", "In air value", 0, 0, 100),

    discharge = Menu.Switch("Ragebot", "Global", "Teleport exploit", false),
    discharge_weapons = Menu.MultiCombo("Ragebot", "Global", "Weapons", {"Pistols", "Scout", "Autosniper", "AWP", "Taser", "Knife"}, 0),

    improvements = Menu.MultiCombo("Ragebot", "Other", "Improvements", {"Doubletap speed", "Force baim if lethal"}, 0),
    doubletap_tickbase = Menu.SliderInt("Ragebot", "Other", "Tickbase", 14, 4, 16),
    scout_lethal_value = Menu.SliderInt("Ragebot", "Other", "Scout lethal value", 70, 0, 100),
}

ui["ragebot"].global_controller = function()
    local global_switch = ui["ragebot"].global_switch:Get()
    ui["ragebot"].conditional_hitchance:SetVisible(global_switch)
    ui["ragebot"].noscope_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(1))
    ui["ragebot"].in_air_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(2))

    ui["ragebot"].discharge:SetVisible(global_switch)
    ui["ragebot"].discharge_weapons:SetVisible(global_switch and ui["ragebot"].discharge:Get())

    ui["ragebot"].improvements:SetVisible(global_switch)
    ui["ragebot"].doubletap_tickbase:SetVisible(global_switch and ui["ragebot"].improvements:Get(1))
    ui["ragebot"].scout_lethal_value:SetVisible(global_switch and ui["ragebot"].improvements:Get(2))
end

conditional_hitchance.noscope = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(1)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if me:GetProp("m_bIsScoped") then return end

    local noscope_allowed = { [261] = true, [267] = true, [233] = true, [242] = true } --Было бы неплохо заменить на что нибудь, кроме имени, но эт потом
    if not noscope_allowed[weapon:GetClassId()] then return end

    local hitchance = ui["ragebot"].noscope_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

conditional_hitchance.air = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(2)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if bit.band(me:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0 then return end

    local hitchance = ui["ragebot"].in_air_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

discharge.apply = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].discharge:Get() and ui["ragebot"].discharge_weapons:Get() ~= 0
    if not should_work then return end

    if not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then return end

    local weapons = ui["ragebot"].discharge_weapons
    local allow_discharge = {
        --BIG BRAIN TIMEEEEEEEEEEEEEEEEEEEEEEEEEE
        [245] = weapons:Get(1), [258] = weapons:Get(1), [241] = weapons:Get(1), [46] = weapons:Get(1), [239] = weapons:Get(1), [269] = weapons:Get(1), [246] = weapons:Get(1), --pistols
        [267] = weapons:Get(2),
        [242] = weapons:Get(3), [261] = weapons:Get(3), --autosnipers
        [233] = weapons:Get(4),
        [268] = weapons:Get(5),
        [107] = weapons:Get(6)
    }

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end

    local should_discharge = allow_discharge[weapon:GetClassId()]
    if should_discharge == nil then return end

    local in_air = bit.band(lPlayer:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0
    local chest_center = lPlayer:GetRenderOrigin()

    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= EntityList.GetLocalPlayer() and player:IsTeamMate() == false and player:IsAlive() then
            if in_air and player:IsVisible(player:GetRenderOrigin()) and should_discharge then
                Exploits.ForceTeleport()
            end
        end
    end
end

ragebot_improvements.doubletap_tickbase = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(1)
    if not should_work then return end

    local value = ui["ragebot"].doubletap_tickbase:Get()
    local maxusrcmdprocessticks = CVar.FindVar("sv_maxusrcmdprocessticks")
    maxusrcmdprocessticks:SetInt(value + 2)
    Exploits.OverrideDoubleTapSpeed(value)
end

ragebot_improvements.force_baim = function(index)
    RageBot.EnableHitbox(index, 0, false)
end

ragebot_improvements.baim_if_lethal = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(2)
    if not should_work then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if not lPlayer then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end
    if weapon:GetClassId() ~= 267 then return end

    local damage = ui["ragebot"].scout_lethal_value:Get()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player:IsTeamMate() == false and player:IsAlive() then
            local health = player:GetProp("m_iHealth")
            if health < 0 or health == nil then return end

            if health < damage then
                ragebot_improvements.force_baim(i)
            end
        end
    end
end

ui["antiaim"] = {
    global_switch = Menu.Switch("AntiAim", "Global", "Global switch", false),
    antiaim_type = Menu.Combo("AntiAim", "Global", "Anti Aim type", {"Default", "Conditional"}, 0),
    manual_yawbase = Menu.Combo("AntiAim", "Global", "Manual yaw base", {"Disabled", "Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 0),
    tweaks = Menu.MultiCombo("AntiAim", "Global", "AntiAim tweaks", {"Disable on warmup", "HS w/o fakelags"}, 0),
    default_config = Menu.Button("AntiAim", "Global", "                       Load default config                       ", "Load default antiaim config"),
    condition = Menu.Combo("AntiAim", "Conditional", "Condition", {"Global", "Standing", "Walking", "Slowwalking", "Crouch", "Jumping", "Air crouch"}, 0),
    conditional = {
        ["Global"] = conditional_antiaim.create_settings("Global"),
        ["Stand"] = conditional_antiaim.create_settings("Standing"),
        ["Walk"] = conditional_antiaim.create_settings("Walking"),
        ["Slow-walk"] = conditional_antiaim.create_settings("Slow-walking"),
        ["Crouch"] = conditional_antiaim.create_settings("Crouching"),
        ["Air"] = conditional_antiaim.create_settings("Jumping"),
        ["Air-C"] = conditional_antiaim.create_settings("Air-crouching"),
    },
}

ui["antiaim"].global_controller = function()
    local global_switch = ui["antiaim"].global_switch:Get()
    ui["antiaim"].antiaim_type:SetVisible(global_switch)
    ui["antiaim"].manual_yawbase:SetVisible(global_switch and ui["antiaim"].antiaim_type:Get() == 1)
    ui["antiaim"].tweaks:SetVisible(global_switch)
end

conditional_antiaim.ui_controller = function()
    local global_force = false
    if ui["antiaim"].antiaim_type:Get() == 1 and ui["antiaim"].global_switch:Get() then global_force = true end

    ui["antiaim"].condition:SetVisible(global_force)

    local current_condition = ui["antiaim"].condition:Get()
    local type_force = { ["Global"] = current_condition == 0, ["Stand"] = current_condition == 1, ["Walk"] = current_condition == 2, ["Slow-walk"] = current_condition == 3, ["Crouch"] = current_condition == 4, ["Air"] = current_condition == 5, ["Air-C"] = current_condition == 6, ["Use"] = current_condition == 7 }

    local types = {"Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "gap", "left_limit", "right_limit", "fake_options", "lby_mode", "desync_freestanding", "desync_on_shot"}

    --Лучше бы я это не делал, страшно пиздец
    for _, element in pairs(elements) do
        local global_modifier = false
        ui["antiaim"].conditional["Global"][element]:SetVisible(global_force and type_force["Global"])
        if ui["antiaim"].conditional["Global"]["yaw_modifier"]:Get() ~= 0 then global_modifier = true end

        ui["antiaim"].conditional["Global"]["modifier_degree"]:SetVisible(global_force and type_force["Global"] and global_modifier)

        for _, _type in pairs(types) do
            ui["antiaim"].conditional[_type]["switch"]:SetVisible(global_force and type_force[_type])
            local switcher = ui["antiaim"].conditional[_type]["switch"]:Get()
            local this_show = global_force and type_force[_type] and switcher

            ui["antiaim"].conditional[_type][element]:SetVisible(this_show)
            local this_modifier = false
            if ui["antiaim"].conditional[_type]["yaw_modifier"]:Get() ~= 0 then this_modifier = true end

            ui["antiaim"].conditional[_type]["modifier_degree"]:SetVisible(this_show and this_modifier)
        end
    end
end

conditional_antiaim.get_condition = function()
    local condition = "Global"
    local me = EntityList.GetLocalPlayer()
    if me == nil then return nil end

    local velocity = math.floor(Vector.new(me:GetProp("m_vecVelocity[0]"), me:GetProp("m_vecVelocity[1]"), 0):Length2D())
    local flags = me:GetProp("m_fFlags")

    local air = bit.band(flags, flags_list.FL_ONGROUND) == 0
    local crouch = bit.band(flags, flags_list.FL_DUCKING) ~= 0

    if velocity <= 2 then condition = "Stand" end
    if velocity > 1 and (not air or not crouch) then condition = "Walk" end
    if Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Slow Walk"):Get() and not (air or crouch) then condition = "Slow-walk" end
    if crouch and not (air) then condition = "Crouch" end
    if air then condition = "Air" end
    if air and crouch then condition = "Air-C" end
   
    return condition
end

conditional_antiaim.references = {
    pitch =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Get(),
    yaw_base = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get(),
    yaw_add = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Get(),
    yaw_modifier =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Get(),
    modifier_degree =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Get(),
    fake_options = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Get(),
    lby_mode = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Get(),
    freestanding_desync = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Get(),
    desync_on_shot = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Get()
}
conditional_antiaim.apply_condition = function(cmd)
    if ui["antiaim"].global_switch:Get() == false then return end
    if ui["antiaim"].antiaim_type:Get() == 0 then return end

    local condition = conditional_antiaim.get_condition()
    local settings = ui["antiaim"].conditional[condition]
    if settings["switch"]:Get() == false then settings = ui["antiaim"].conditional["Global"] end

    --Overriding pitch
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(settings["pitch"]:Get())

    --Overriding yaw base
    local manual_yaw_base = ui["antiaim"].manual_yawbase:Get()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(manual_yaw_base == 0 and settings["yaw_base"]:Get() or manual_yaw_base - 1)
   
    --Yaw add
    local yaw_add = 0
    if AntiAim.GetInverterState() then yaw_add = settings["yaw_add_left"]:Get() else yaw_add = settings["yaw_add_right"]:Get() end
    local yaw_modifier_state = settings["yaw_modifier"]
    local yaw_modifier = 0
    if yaw_modifier_state:Get() == 1 then
        if cmd.command_number % 4 > 1 then
            yaw_modifier = -settings["modifier_degree"]:Get() /2
        else
            yaw_modifier = settings["modifier_degree"]:Get() /2
        end
    end

    AntiAim.OverrideYawOffset(yaw_add + yaw_modifier)

    --Fake limit
    local fake_limit = 0
    if AntiAim.GetInverterState() then fake_limit = settings["left_limit"]:Get() else fake_limit = settings["right_limit"]:Get() end
    AntiAim.OverrideLimit(fake_limit)

    --Fake options
    for i = 1, 4 do
        Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(i, settings["fake_options"]:Get(i))
    end
   
    --Lby mode
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(settings["lby_mode"]:Get())

    --Freestanding
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(settings["desync_freestanding"]:Get())

    --Desync on shot
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(settings["desync_on_shot"]:Get())
end

conditional_antiaim.destroy = function()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(conditional_antiaim.references.pitch)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(conditional_antiaim.references.yaw_base)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Set(conditional_antiaim.references.yaw_add)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Set(conditional_antiaim.references.yaw_modifier)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Set(conditional_antiaim.references.modifier_degree)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(conditional_antiaim.references.fake_options)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(conditional_antiaim.references.lby_mode)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(conditional_antiaim.references.freestanding_desync)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(conditional_antiaim.references.desync_on_shot)
end

antiaim_tweaks.disable_on_warmup = function()
    if not ui["antiaim"].global_switch:Get() then return end
    if not ui["antiaim"].tweaks:Get(1) then return end

    local gamerules = EntityList.GetGameRules()
    local warmup_period = gamerules:GetProp("m_bHasMatchStarted")

    if warmup_period == false then
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(false)
    else
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(true)
    end
end

antiaim_tweaks.disable_fakelag_with_hs = function()
    local should_work = ui["antiaim"].global_switch:Get() and ui["antiaim"].tweaks:Get(2)
    if not should_work then return end

    Menu.FindVar("Aimbot", "Anti Aim", "Fake Lag", "Enable Fake Lag"):Set(not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get())
end

ui["visuals"] = {
    global_switch = Menu.Switch("Visuals", 'Global', "Global switch", false),
    menu_background = Menu.Combo("Visuals", "Global", "Menu background", {"Disabled", "Blur", "Dark"}, 0),
    enable_animation = Menu.Switch("Visuals", "Global", "Enable animations", true),
    animation_speed = Menu.SliderInt("Visuals", "Global", "Animations speed", 16, 2, 24),

    custom_scope = Menu.SwitchColor("Visuals", "World", "Custom scope", false, Color.RGBA(212, 255, 0, 255)),
    custom_scope_length = Menu.SliderInt("Visuals", "World", "Length", 50, 50, 500),
    custom_scope_offset = Menu.SliderInt("Visuals", "World", "Offset", 10, 0, 300),
    custom_scope_settings = Menu.MultiCombo("Visuals", "World", "Settings", {"Viewmodel in scope"}, 0),

    snaplines = Menu.SwitchColor("Visuals", "World", "Snaplines", false, Color.new(1.0, 1.0, 1.0, 0.5)),
    snaplines_type = Menu.Combo("Visuals", "World", "Snaplines type", {"Every enemy", "Nearest to crosshair"}, 1),

    indicators = Menu.Switch("Visuals", "UI", "Indicators", false),
    indicators_type = Menu.Combo("Visuals", "UI", "Indicators type", {"Umbrella", "Ideal yaw"}, 0),
    umbrella_elements = Menu.MultiCombo("Visuals", "UI", "Elements to show", {"Desync line", "Player state", "Doubletap", "Hide shots", "Body aim", "Minimum damage", "Fake duck"}, 0),
    umbrella_real_color = Menu.ColorEdit("Visuals", "UI", "Real color", Color.new(1.0, 1.0, 1.0, 1.0)),
    umbrella_fake_color = Menu.ColorEdit("Visuals", "UI", "Fake color", Color.RGBA(212, 255, 0, 255)),
    indicators_offset = Menu.Switch("Visuals", "UI", "Offset indicators in scope", false),

    widgets = Menu.MultiCombo("Visuals", "UI", "Widgets", {"Watermark", "DT/FL indicator", "Fake indicator", "Keybinds list", "Spectators list"}, 0),
    widgets_style = Menu.Combo("Visuals", "UI", "Widgets style", {"Default", "Rounding", "Full rounding", "Gradient line"}, 0),
    widgets_background_style = Menu.Combo("Visuals", "UI", "Background style", {"Default", "Blur"}, 0),
    widgets_background = Menu.ColorEdit("Visuals", "UI", "Widgets background color", Color.new(0.0, 0.0, 0.0, 0.8)),
    widgets_color = Menu.ColorEdit("Visuals", "UI", "Widgets color", Color.RGBA(212, 255, 0, 255)),

    hitlogs = Menu.MultiCombo("Visuals", "Hitlogs", "Hitlogs", {"Under crosshair", "On screen", "Console"}, 0),
    hitlogs_count = Menu.SliderInt("Visuals", "Hitlogs", "Max hitlogs count", 5, 3, 10),
    hit_color = Menu.ColorEdit("Visuals", "Hitlogs", "Hit color", Color.RGBA(211, 255, 66, 255)),
    resolver_color = Menu.ColorEdit("Visuals", "Hitlogs", "Resolver color", Color.RGBA(255, 94, 94, 255)),
    spread_color = Menu.ColorEdit("Visuals", "Hitlogs", "Spread color", Color.RGBA(255, 180, 94, 255)),
    occlusion_color = Menu.ColorEdit("Visuals", "Hitlogs", "Occlusion color", Color.RGBA(94, 169, 255, 255)),
    prediction_color = Menu.ColorEdit("Visuals", "Hitlogs", "Prediction error color", Color.RGBA(255, 94, 94, 255)),

    utils = {
        keybinds_x = Menu.SliderInt("Visuals", "Utils", "Keybinds x", 100, 0, screen.x),
        keybinds_y = Menu.SliderInt("Visuals", "Utils", "Keybinds y", 100, 0, screen.y),
        spectators_x = Menu.SliderInt("Visuals", "Utils", "Spectators x", 300, 0, screen.x),
        spectators_y = Menu.SliderInt("Visuals", "Utils", "Spectators y", 300, 0, screen.y)
    }
}

ui["visuals"].global_controller = function()
    local global_switch = ui["visuals"].global_switch:Get()
    ui["visuals"].menu_background:SetVisible(global_switch)
    ui["visuals"].enable_animation:SetVisible(global_switch)
    ui["visuals"].animation_speed:SetVisible(global_switch and ui["visuals"].enable_animation:Get())

    ui["visuals"].custom_scope:SetVisible(global_switch)
    local custom_scope = ui["visuals"].custom_scope:Get()
    ui["visuals"].custom_scope_offset:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_length:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_settings:SetVisible(custom_scope and global_switch)

    ui["visuals"].snaplines:SetVisible(global_switch)
    ui["visuals"].snaplines_type:SetVisible(global_switch and ui["visuals"].snaplines:Get())

    ui["visuals"].indicators:SetVisible(global_switch)
    local indicators = ui["visuals"].indicators:Get()
    ui["visuals"].indicators_type:SetVisible(global_switch and indicators)
    ui["visuals"].umbrella_elements:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_real_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_fake_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].indicators_offset:SetVisible(global_switch and indicators)

    ui["visuals"].hitlogs:SetVisible(global_switch)
    local hitlogs = ui["visuals"].hitlogs
    ui["visuals"].hitlogs_count:SetVisible(global_switch and hitlogs:Get(1) or hitlogs:Get(2))
    ui["visuals"].hit_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].resolver_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].spread_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].occlusion_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].prediction_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)

    ui["visuals"].widgets:SetVisible(global_switch)
    local widgets = ui["visuals"].widgets:Get()
    ui["visuals"].widgets_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_color:SetVisible(widgets ~= 0 and global_switch)

    ui["visuals"].utils.keybinds_x:SetVisible(false)
    ui["visuals"].utils.keybinds_y:SetVisible(false)
    ui["visuals"].utils.spectators_x:SetVisible(false)
    ui["visuals"].utils.spectators_y:SetVisible(false)
end

local animation = {data = {}}
animation.lerp = function(s, e, t) --prince1337
    if type(s) == 'userdata' then
        local color_data = {0, 0, 0, 0}

        for i, color_key in ipairs({'r', 'g', 'b', 'a'}) do
            color_data[i] = animation.lerp(s[color_key], e[color_key], t)
        end

        return Color.new(unpack(color_data))
    end

    return s + (e - s) * GlobalVars.frametime * t
end

animation.new = function(name, value, time)
    if animation.data[name] == nil then
        animation.data[name] = value
    end

    animation.data[name] = animation.lerp(animation.data[name], value, time)

    return ui["visuals"].enable_animation:Get() and animation.data[name] or value
end

menu_background.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local alpha = animation.new("menu_blur_alpha", Cheat.IsMenuVisible() and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
   
    if alpha ~= 0.0 then
        if ui["visuals"].menu_background:Get() == 1 then
            Render.Blur(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(1.0, 1.0, 1.0, alpha))
        end

        if ui["visuals"].menu_background:Get() == 2 then
            Render.BoxFilled(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(0.0, 0.0, 0.0, alpha - 0.5))
        end
    end
end

widgets.create_interface = function(x, y, w, h, color, outline, style)
    local is_metamod = style == 0
    local func = Render.BoxFilled
    if ui["visuals"].widgets_background_style:Get() == 1 then func = Render.Blur end

    func(Vector2.new(x , y), Vector2.new(x + w, y + h), color, is_metamod and 0 or 2) --Background
    Render.BoxFilled(Vector2.new(is_metamod and x or x + 3, y - 1), Vector2.new(is_metamod and x + w or x + w - 3, y), outline)           --Top line
    if not is_metamod then
        Render.Circle(Vector2.new(x + 3, y + 3), 4, 10, outline, 1, -203, -85)                    -- left rounding
        Render.Circle(Vector2.new(x + w - 3, y + 3), 4, 10, outline, 1, 22, -98)
    end

    if style == 2 then
        Render.BoxFilled(Vector2.new(x - 1 , y + 4), Vector2.new(x, y + h - 3), outline)          -- left line
        Render.BoxFilled(Vector2.new(x + w, y + 4), Vector2.new(x + w + 1, y + h - 3), outline)
        Render.Circle(Vector2.new(x + 3, y + h - 3), 4, 10, outline, 1, -290, -174)               -- bot-left rounding
        Render.Circle(Vector2.new(x + w - 3, y + h - 3), 4, 10, outline, 1, 0, 103)              
        Render.BoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + w - 2, y + h), outline)   -- bot line
    else
        if style == 3 then
            Render.GradientBoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + (w  / 2), y + h), Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline) -- gradient c-l
            Render.GradientBoxFilled(Vector2.new(x + (w / 2), y + h), Vector2.new(x + w - 2, y + h + 1), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0)) --gradient c-r
        end

        if not is_metamod then
            Render.GradientBoxFilled(Vector2.new(x - 1, y + 3), Vector2.new(x, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0)) -- left line
            Render.GradientBoxFilled(Vector2.new(x + w, y + 3), Vector2.new(x + w + 1, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0))   --right line
        end
    end

end

widgets.is_howered = function(x, y, w, h)
    return (
        Cheat.GetMousePos().x > x and
        Cheat.GetMousePos().x < x + w and
        Cheat.GetMousePos().y > y and
        Cheat.GetMousePos().y < y + h
    )
end

ffi.cdef([[
    typedef uint16_t WORD;

    typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
    } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

    void GetLocalTime(LPSYSTEMTIME lpSystemTime);
]])


widgets.watermark = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(1)

    local ip = "offline"
   
    if EngineClient.GetNetChannelInfo() ~= nil then
        ip = EngineClient.GetNetChannelInfo():GetAddress() == "loopback" and "local host" or EngineClient.GetNetChannelInfo():GetAddress()
    end
    local time = ffi.new("SYSTEMTIME")
    ffi.C.GetLocalTime(time)
   
    local text = string.format("umbrella [live] | %s | %s | %02d:%02d:%02d", Cheat.GetCheatUserName(), ip, time.wHour, time.wMinute, time.wSecond)
   
    local w = Render.CalcTextSize(text, 12, fonts.widgets).x + 10; local h = 18
    local x = screen.x - w - 10; local y = 10

    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    local alpha = animation.new("watermark_alpha", should_render and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 5, y + 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Text("rella", Vector2.new(x + 5 + Render.CalcTextSize("umb", 12, fonts.widgets).x, y + 2), Color.new(color.r, color.g, color.b, alpha), 12, fonts.widgets)
    end
end

widgets.fake = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(3)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60-0.5))) --ФЫВПДЖРФЫРДОДФЫВПРФЫПРД КАК ЖЕ ЭТО СТРАШНО АААААААААААААААААААААА
    local text = string.format("FAKE: %.1f°", desync)
    local offset_y = animation.new("fake_offset_y", not ui["visuals"].widgets:Get(1) and 28 or 0, ui["visuals"].animation_speed:Get())
    local offset_x = animation.new("fake_offset_x", not ui["visuals"].widgets:Get(2) and 80 or 0, ui["visuals"].animation_speed:Get())
    local w = 72; local h = 18
    local x = screen.x - w - 105 + offset_x; local y = 38 - offset_y

    local alpha = animation.new("fake_alpha", (player:IsAlive() and player ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w + 15, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x  + 18, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Circle(Vector2.new(x + 10, y + 9), 5.0, 0, Color.new(color.r, color.g, color.b, alpha), 2, 0, desync * 7)
    end
end

widgets.fakelag = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(2)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local fakelag = ClientState.m_choked_commands <= 1 and 1 or ClientState.m_choked_commands
    local charge = Exploits.GetCharge()
    local state = "FL"

    local offset = animation.new("fakelag_offset", (not ui["visuals"].widgets:Get(1)) and 28 or 0, ui["visuals"].animation_speed:Get())
    local x = screen.x - 2 - 80; local y = 38 - offset
    local w = 71; h = 18

    local modifier = x + 20 + math.min(4.7 * fakelag, 48)
    if Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then
        state = "DT"
        modifier = x + 20 + 48 * charge
    end
    local text = string.format("%s", state)

    local alpha = animation.new("fakelag_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 2, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.BoxFilled(Vector2.new(x + 20, y + (h/2) - 2), Vector2.new(modifier , y + (h/2) + 3), Color.new(color.r, color.g, color.b, alpha), 2)
    end
end

widgets.keybinds_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,

    width = 66
}
widgets.keybinds = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(4)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(1, false)
    end

    local binds = Cheat.GetBinds()
    local offset = 21
    local x = ui["visuals"].utils.keybinds_x:Get(); local y = ui["visuals"].utils.keybinds_y:Get()
    local final_width = 66
    local active = {}

    for i = 1, #binds do
        bind = binds[i]
        local bind_state = "["..bind:GetValue().."]"

        local alpha = animation.new(bind:GetName(), (bind:IsActive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

        if alpha ~= 0.0 then
            Render.Text(bind:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)
            Render.Text(bind_state, Vector2.new(x + 75 +  widgets.keybinds_settings.width - Render.CalcTextSize(bind_state, 11, fonts.widget_text).x - 10, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text, false, false)
        end

        if Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x > final_width and bind:IsActive() then
            final_width = Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x - 5
        end

        offset = offset + 14 * alpha
        if bind:IsActive() then table.insert(active, bind) end
    end
    local alpha = animation.new("keybinds_alpha", ((Cheat.IsMenuVisible() or #active > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    widgets.keybinds_settings.width = animation.new("keybinds_width", final_width, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, 70 + widgets.keybinds_settings.width, 18, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text("keybinds", Vector2.new(x + (75 + widgets.keybinds_settings.width) /2, y + 18 / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)
    end

    if not ui["visuals"].widgets:Get(4) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, 70 + widgets.keybinds_settings.width, 18) and Cheat.IsMenuVisible() then
            if not widgets.keybinds_settings.stored then
                widgets.keybinds_settings.x_off = mouse_pos.x - x
                widgets.keybinds_settings.y_off = mouse_pos.y - y
                widgets.keybinds_settings.stored = true
            end
            ui["visuals"].utils.keybinds_x:Set(mouse_pos.x - widgets.keybinds_settings.x_off)
            ui["visuals"].utils.keybinds_y:Set(mouse_pos.y - widgets.keybinds_settings.y_off)
        end
    else if widgets.keybinds_settings.stored then widgets.keybinds_settings.stored = false end
    end
end

widgets.get_spectators = function()
    local spectators = {}
    local players = EntityList.GetPlayers()
    for i, player in pairs(players) do
        if EntityList.GetPlayerFromHandle(player:GetProp("m_hObserverTarget")) == EntityList.GetLocalPlayer() and not player:IsDormant() then
            table.insert(spectators, player)
        end
    end
    return spectators
end

widgets.spectators_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,
}
widgets.spectators = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(5)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(2, false)
    end

    local spectators = widgets.get_spectators()
    local offset = 21
    local x = ui["visuals"].utils.spectators_x:Get(); local y = ui["visuals"].utils.spectators_y:Get()
    local w = 132; local h = 18

    for i = 1, #spectators do
        local spectator = spectators[i]
       
        local alpha = animation.new(spectator:EntIndex(), (animation.data[spectator:EntIndex()] ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        Render.Text(spectator:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)

        offset = offset + 14 * alpha
    end
    local alpha = animation.new("spectators_alpha", ((Cheat.IsMenuVisible() or #spectators > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = ui["visuals"].widgets_color:GetColor()
    local background = ui["visuals"].widgets_background:GetColor()
    widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
    Render.Text("spectators", Vector2.new(x + 132 /2, y + h / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)

    if not ui["visuals"].widgets:Get(5) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, w, h) and Cheat.IsMenuVisible() then
            if not widgets.spectators_settings.stored then
                widgets.spectators_settings.x_off = mouse_pos.x - x
                widgets.spectators_settings.y_off = mouse_pos.y - y
                widgets.spectators_settings.stored = true
            end
            ui["visuals"].utils.spectators_x:Set(mouse_pos.x - widgets.spectators_settings.x_off)
            ui["visuals"].utils.spectators_y:Set(mouse_pos.y - widgets.spectators_settings.y_off)
        end
    else if widgets.spectators_settings.stored then widgets.spectators_settings.stored = false end
    end
end

indicators.umbrella = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 0
    local elements = ui["visuals"].umbrella_elements

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then is_mindmg = i:IsActive() end
    end

    indicators.elements = {
        {check = should_render and elements:Get(2), name = conditional_antiaim.get_condition():upper()},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() and elements:Get(3), name = "DT"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and elements:Get(4), name = "HS"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Misc", "Body Aim"):Get() == 2 and elements:Get(5), name = "BAIM"},
        {check = is_mindmg and elements:Get(6), name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)},
        {check = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Fake Duck"):Get() and elements:Get(7), name = "FD"}
    }

    local x = screen.x /2; local y = screen.y /2 + 27

    local alpha = animation.new("umbrella_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local desync_alpha = animation.new("desync_alpha", (player:IsAlive() and elements:Get(1) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("umbrella_offset_x", (player:IsAlive() and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, ui["visuals"].animation_speed:Get())

    local inverter = AntiAim.GetInverterState()
    local real_color = ui["visuals"].umbrella_real_color:GetColor(); local fake_color = ui["visuals"].umbrella_fake_color:GetColor()
    local umbr = animation.new("umbr", inverter and Color.new(real_color.r, real_color.g, real_color.b, alpha) or Color.new(fake_color.r, fake_color.g, fake_color.b, alpha), 10)
    local ella = animation.new("ella", inverter and Color.new(fake_color.r, fake_color.g, fake_color.b, alpha) or Color.new(real_color.r, real_color.g, real_color.b, alpha), 10)
    if alpha ~= 0.0 then
        Render.Text("umb", Vector2.new(x - Render.CalcTextSize("rella", 13).x /2 + offset_x, y), umbr, 12, fonts.widgets, true, true)
        Render.Text("rella", Vector2.new(x + Render.CalcTextSize("umb", 13).x /2 + offset_x, y), ella, 12, fonts.widgets, true, true)

        if desync_alpha ~= 0.0 then
            local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60)))
            Render.BoxFilled(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x - 20 + (desync / 1.5) + offset_x, y + 10), Color.new(fake_color.r, fake_color.g, fake_color.b, desync_alpha), 2)
            Render.Box(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x + 20 + offset_x, y + 10), Color.new(0.0, 0.0, 0.0, desync_alpha - 0.6), 2)
        end
    end

    local offset = 10 + (5 * desync_alpha)
    for _, var in pairs(indicators.elements) do
        local alpha = animation.new("umbrella_"..var.name.."", (player:IsAlive() and should_render and var.check) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        if var.check then
            if alpha ~= 0.0 then
                Render.Text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 10, fonts.smallest_pixel, true, true)
            end
        end
        offset = offset + 8 * alpha
    end
end

indicators.shadow_text = function(text, pos, color, size, font, centered)
    Render.Text(text, Vector2.new(pos.x + 1, pos.y + 1), Color.new(0.0, 0.0, 0.0, color.a), size, font, false, centered)
    Render.Text(text, pos, color, size, font, false, centered)
end

indicators.ideal_yaw = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 1
    local animation_speed = ui["visuals"].animation_speed:Get()

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then mindmg = i:IsActive() end
    end

    local dt_color = animation.new("dt_color", Exploits.GetCharge() == 1 and Color.new(0.0, 1.0, 0.0, 1.0) or Color.new(1.0, 0.0, 0.0, 1.0), animation_speed)
    local elements = {
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "DT", color = dt_color},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "AA", color = Color.new(0.8, 0.5, 0.9, 1.0)},
        {check = mindmg, name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)}
    }

    local x = screen.x /2; local y = screen.y /2 + 25

    local alpha = animation.new("ideal_alpha", (should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("ideal_offset_x", (should_render and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, animation_speed)

    local inverter = AntiAim.GetInverterState()
    local umbr = animation.new("UMBRELLA", inverter and Color.new(0.8, 0.5, 0.1, alpha) or Color.new(1.0, 1.0, 1.0, alpha), 10)
    local ella = animation.new("YAW", inverter and Color.new(1.0, 1.0, 1.0, alpha) or Color.new(0.8, 0.5, 0.1, alpha), 10)
    local is_manual = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 2 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 3)

    if is_manual then
        indicators.shadow_text("FAKE YAW", Vector2.new(x + offset_x, y), Color.new(0.8, 0.5, 0.1, alpha), 12, fonts.ideal_yaw, true)
    else
        indicators.shadow_text("UMBRELLA", Vector2.new(x - Render.CalcTextSize("YAW", 12, fonts.ideal_yaw).x /2 + offset_x - 1, y), umbr, 12, fonts.ideal_yaw, true)
        indicators.shadow_text("YAW", Vector2.new(x + Render.CalcTextSize("UMBRELLA", 12, fonts.ideal_yaw).x /2 + offset_x + 1, y), ella, 12, fonts.ideal_yaw, true)
    end

    local is_dynamic = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 4 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 5)
    indicators.shadow_text(is_dynamic and "DYNAMIC" or "DEFAULT", Vector2.new(x + offset_x, y + 13), is_dynamic and Color.new(0.8, 0.5, 0.9, alpha) or Color.new(1.0, 0.0, 0.0, alpha), 12, fonts.ideal_yaw, true)

    local offset = 26
    for _, var in pairs(elements) do
        local alpha = animation.new("ideal_"..var.name.."", (var.check and should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
        if var.check then
            indicators.shadow_text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(var.color.r, var.color.g, var.color.b, alpha), 12, fonts.ideal_yaw, true)
        end
        offset = offset + 13 * alpha
    end
end

hitlogs.hitboxes = { [0] = "neck", [1] = "head", [2] = "pelvis", [3] = "stomach", [4] = "lower chest", [5] = "chest", [6] = "upper chest", [7] = "right thigh", [8] = "left thigh", [9] = "right calf", [10] = "left calf", [11] = "right foot", [12] = "left foot", [13] = "right hand", [14] = "left hand", [15] = "right upper arm", [16] = "right forearm", [17] = "left upper arm", [18] = "left forear" }
hitlogs.reasons = { [0] = "hit",[1] = "resolver", [2] = "spread", [3] = "occlusion",  [4] = "prediction error" }
hitlogs.colors = { [0] = ui["visuals"].hit_color:GetColor(), [1] = ui["visuals"].resolver_color:GetColor(), [2] = ui["visuals"].spread_color:GetColor(), [3] = ui["visuals"].occlusion_color:GetColor(), [4] = ui["visuals"].prediction_color:GetColor() }

hitlogs.data = {}
hitlogs.store_data = function(shot)
    local target = EntityList.GetPlayer(shot.target_index)
    local health = target:GetProp("m_iHealth")

    table.insert(hitlogs.data, {
        reason = shot.reason,
        name = target:GetName(),
        hitchance = shot.hitchance,
        backtrack = shot.backtrack,
        hitgroup = shot.hitgroup,
        wanted_hitgroup = shot.wanted_hitgroup,
        hitchance = shot.hitchance,
        damage = shot.damage,
        wanted_damage = shot.wanted_damage,
        health_remaining = health - shot.damage < 0 and 0 or health - shot.damage,
        hit_time = GlobalVars.curtime,
        color = hitlogs.colors[shot.reason],
        alpha = 0.0
    })
end

hitlogs.on_round_start = function(event)
    if event:GetName() == "round_start" then
        hitlogs.data = {}
    end
end

hitlogs.reset_data = function()
    local player = EntityList.GetLocalPlayer()
    if player == nil then
        hitlogs.data = {}
    end
end

ffi.cdef([[
    typedef struct {
        uint8_t r;
        uint8_t g;
        uint8_t b;
        uint8_t a;
    } color_struct;

    typedef void (__cdecl* console_color_print)(void*,const color_struct&, const char*, ...);
]])

ffi_handler.color_print_fn = ffi.cast("console_color_print", ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007"))[0][25])
ffi_handler.color_print = function(text, color, event)
    local color_s = ffi.new("color_struct")
    color_s.r = color.r * 255; color_s.g = color.g * 255; color_s.b = color.b * 255; color_s.a = color.a * 255
    ffi_handler.color_print_fn(ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007")), color_s, text)
end

hitlogs.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local x = screen.x; local y = screen.y
    local under_y_offset = 20
    local screen_y_offset = 0
    for i, var in pairs(hitlogs.data) do

        var.alpha = animation.lerp(var.alpha, ((GlobalVars.curtime - var.hit_time > 5)) and 0.0 or 1.0, ui["visuals"].animation_speed:Get())

        local under_text = string.format("Hurt %s's %s for %d (%d remaining)", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining)

        if var.reason ~= 0 then
            under_text = string.format("Missed shot to %s`s %s due to %s", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason])
        end

        if ui["visuals"].hitlogs:Get(1) then
            indicators.shadow_text(under_text, Vector2.new(x /2, y /2 + 200 + under_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, true)
        end

        local screen_text = string.format("Hurt %s's %s for %d (%d remaining) [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining, var.backtrack, var.hitchance)
        if var.wanted_damage ~= var.damage then
            screen_text = screen_text..string.format(" [missmatch damage: %d]", var.wanted_damage)
        elseif var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[var.wanted_hitgroup])
        elseif var.wanted_damage ~= var.damage and var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch damage: %d; hitbox: %s]", var.wanted_damage, hitlogs.hitboxes[var.wanted_hitgroup])
        end

        if var.reason ~= 0 then
            screen_text = string.format("Missed shot to %s`s %s due to %s [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason], var.backtrack, var.hitchance)
        end

        if ui["visuals"].hitlogs:Get(2) then
            indicators.shadow_text("[umbrella] ", Vector2.new(10, 5 + screen_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, false)
            indicators.shadow_text(screen_text, Vector2.new(10 + Render.CalcTextSize("[umbrella] ", 12, fonts.ideal_yaw).x, 5 + screen_y_offset), Color.new(1.0,1.0,1.0, var.alpha), 12, fonts.ideal_yaw, false)
        end

        if var.alpha == 0.0 or #hitlogs.data > ui["visuals"].hitlogs_count:Get() then
            table.remove(hitlogs.data, i)
        end
        under_y_offset = under_y_offset + 15 * var.alpha
        screen_y_offset = screen_y_offset + 15 * var.alpha
    end
end

hitlogs.console = function(shot)
    local should_work = ui["visuals"].global_switch:Get() and ui["visuals"].hitlogs:Get(3)
    if not should_work then return end

    local remaining = EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage < 0 and 0 or EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage
    local text = string.format("Hurt %s`s %s for %d (%d remaining) [bt = %d; hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.damage, remaining, shot.backtrack, shot.hitchance)
    if shot.wanted_damage ~= shot.damage then
        text = text..string.format(" [missmatch damage: %d]", shot.wanted_damage)
    elseif shot.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[shot.wanted_hitgroup])
    elseif shot.wanted_damage ~= shot.damage and var.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch damage: %d; hitbox: %s]", shot.wanted_damage, hitlogs.hitboxes[shot.wanted_hitgroup])
    end

    if shot.reason ~= 0 then
        text = string.format("Missed %s's %s for %d due to %s [bt = %d, hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.wanted_damage, hitlogs.reasons[shot.reason], shot.backtrack, shot.hitchance)
    end
   
    local colors = {
        [0] = ui["visuals"].hit_color:GetColor(),
        [1] = ui["visuals"].resolver_color:GetColor(),
        [2] = ui["visuals"].spread_color:GetColor(),
        [3] = ui["visuals"].occlusion_color:GetColor(),
        [4] = ui["visuals"].prediction_color:GetColor()
    }

    ffi_handler.color_print("[umbrella] ", colors[shot.reason])
    print(text)
end

local custom_scope_reference = Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Get()
custom_scope.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get()

    if not should_render then Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference) else Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(2) end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local is_scoped = player:GetProp("m_bIsScoped")

    local x = screen.x /2; local y = screen.y /2
    local menu_color = ui["visuals"].custom_scope:GetColor()
    local alpha = animation.new("custom_scope_alpha", (is_scoped and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = Color.new(menu_color.r, menu_color.g, menu_color.b, menu_color.a * alpha)

    local length = ui["visuals"].custom_scope_length:Get()
    local offset = ui["visuals"].custom_scope_offset:Get()
    Render.GradientBoxFilled(Vector2.new(x, y - offset), Vector2.new(x + 1, (y - offset) - length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x + offset, y), Vector2.new((x + offset) + length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x, y + offset), Vector2.new(x + 1, (y + offset) + length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x - offset, y), Vector2.new((x - offset) - length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
end


custom_scope.viewmodel_in_scope = function()
    local fov_cs_debug = CVar.FindVar("fov_cs_debug")
    fov_cs_debug:SetInt((ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get() and ui["visuals"].custom_scope_settings:Get(1)) and 90 or 0)
end

custom_scope.destroy = function()
    Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference)
end

snaplines.normalize_yaw = function(yaw) while yaw > 180 do yaw = yaw - 360 end while yaw < -180 do yaw = yaw + 360 end return yaw end
snaplines.nearest_to_crosshair = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 1
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local eyepos = lPlayer:GetEyePosition()
    local viewangles = EngineClient.GetViewAngles()
    local bestenemy = nil
    local fov = 180
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local pos = player:GetProp('m_vecOrigin')
            local cur_fov = math.abs(snaplines.normalize_yaw(math.deg(math.atan2(eyepos.y - pos.y, eyepos.x - pos.x)) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = player
            end
        end
    end

    if bestenemy == nil then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(EntityList.GetLocalPlayer():GetHitboxCenter(4))
    end
    local position = Render.WorldToScreen(bestenemy:GetProp("m_vecOrigin"))
    local color = ui["visuals"].snaplines:GetColor()
    Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
end


snaplines.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 0
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(lPlayer:GetHitboxCenter(4))
    end

    local color = ui["visuals"].snaplines:GetColor()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local position = Render.WorldToScreen(player:GetProp("m_vecOrigin"))
            Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
        end
    end
end

ui["misc"] = {
    global_switch = Menu.Switch("Misc", "Global", "Global switch", false),
    disable_thirdperson_anim = Menu.Switch("Misc", 'Global', "Disable thirdperson anim", false),
    hitsound = Menu.Switch("Misc", "Global", "Custom hitsound", false),
    hitsound_volume = Menu.SliderInt("Misc", "Global", "Volume", 50, 0, 100),
    trashtalk = Menu.Switch("Misc", "Bullying", "Trashtalk", false),
    trashtalk_language = Menu.Combo("Misc", "Bullying", "Trashtalk language", {"Russian", "English"}, 1)
}

ui["misc"].global_controller = function()
    local global_switch = ui["misc"].global_switch:Get()
    ui["misc"].hitsound:SetVisible(global_switch)
    ui["misc"].hitsound_volume:SetVisible(global_switch and ui["misc"].hitsound:Get())

    ui["misc"].disable_thirdperson_anim:SetVisible(global_switch)

    ui["misc"].trashtalk:SetVisible(global_switch)
    ui["misc"].trashtalk_language:SetVisible(global_switch and ui["misc"].trashtalk:Get())
end

disable_thirdperson_anim.apply = function()
    if not ui["misc"].global_switch:Get() or not ui["misc"].disable_thirdperson_anim:Get() then return end

    Cheat.SetThirdPersonAnim(false)
end

ffi_handler.sound_client = ffi.cast("uintptr_t**", Utils.CreateInterface("engine.dll", "IEngineSoundClient003"))
ffi_handler.play_sound = ffi_handler.selfcall(ffi.cast("void*(__thiscall*)(void*, const char*, float, int, int, float)", ffi_handler.sound_client[0][12]), ffi_handler.engine_sound_client)
local hitsound_reference = Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Get()
hitsound.apply = function(event)
    if event:GetName() ~= "player_hurt" then return end

    if not ui["misc"].hitsound:Get() or not ui["misc"].global_switch:Get() then return end
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(false)

    local victim =  event:GetInt("userid", -1337)
    local attacker = event:GetInt("attacker", -1337)
    if (victim == -1337 or attacker == -1337) or victim == attacker then return end

    attacker = EntityList.GetPlayerForUserID(attacker)
    if attacker == nil or attacker ~= EntityList.GetLocalPlayer() then return end

    local volume = ui["misc"].hitsound_volume:Get()
    ffi_handler.play_sound("buttons/arena_switch_press_02.wav", volume / 100, 100, 0, 0)
end

hitsound.destroy = function()
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(hitsound_reference)
end

--Пиздец, магистр, мне по-настоящему страшно с тобой общаться, ты ненормальный
trashtalk.russian_phrases = {
    "ебанный тапочек чё делаешь", "лоляка ну ты упал башмак", "пипец ты сандалина тупая","я хуею ты крендель", "ты чо упал казёл",
    "хахахаха попущ изи", "ЕБАТЬ ТЫ СВАЛИЛСЯ", "Я ХУЕЮ ТЫ ПЕДИК", "маму ебал кек", "нихуя ты слабак",
    "пипец ты рухнул как СССР", "я твой дед взрывал", "сдох как твоя бабка в 43", "чо сдох хохол",
    "на нахуй ракету по черевякалке", "хуяк пулю в печень", "на сука в пиздак", "ХАХАХАХАХ ЕБАТЬ ВПЕНИЛ ТАПКОМ ПО ШАПКЕ",
    "ХАХАХАХАХА КАК ЖЕ ЛЕГКО БЫЛО ДЛЯ UMBRELLA.lua", "НА СУЧЕНЫШ ПУЛЮ", "ЛУЧШАЯ ЛУА ДЛЯ НЕВЕРЛУЗА UMBRELLA.lua", "ЛОВИ ГРАНАТУ УКРОНАЦИСТ",
    "EZ FOR UMBRELLA.lua", "ХУЯК ПО ПИЗДОПРОЁБИНЕ", "ЛОВИ МАСЛИНУ УЕБАН ССАНЫЙ АХАХХАХА", "хахахаха ну ты пиздец семью позоришь",
    "бать ты мусорила чё творишь ваще", "ХАХХАХАХАХА КУПИ ГАЙДЫ КАК ИГРАТЬ", "ЕБАТЬ ТЫ ИЗИЧНЫЙ КУПИ UMBRELLA.lua", "хахах куколд ссаный чё всосал",
    "на хуяку под горло", "ахахаах купи лучше луашку для нла UMBRELLA.lua", "чувак что ты вытворяешь убогий купи скриптик на нл UMBRELLA.lua",
    "на те сучара фашистская", "лови тапыча ублюдошный", "АРФЫВОЛОРАФАВРФОА КРИПЯРА ЕБАННАЯ", "БОЖЕ ПРОСТО СФАРМИЛ ЛОШКА", "ЕБАТЬ ТЫ ВСОСАЛ МОЙ ХУЕЦ",
    "какой же ты убогий парень мусор", "бу нахуй шакал", "на по харе ублюдошный утырок", "НА ТЕ МРАЗЬ ЗА ВСЮ БОЛЬ", "ИЗИ ШАЛАШОВКА ССАНАЯ",
    "ИЗИ ПИДОРАСИНКА", "ИДИ ГЕРЫЧА ЕБНИ ЛУЧШЕ ПИДОРАС", "НА СУЧАРА ВЫГУ ВЫГУ СДЕЛАЛ ТЕБЕ", "АВХАВХАВХАВХ ПСИНА НА ЦЕПИ ЗАДОХНУЛСЯ",
    "ЕБАТЬ ТЫ ПОМЕР КАК ТВОЙ ДЕД В 45", "АЛКАШ ИЗИЧКА ПРОСТО ХАХАХ", "аввахавхав говноедик ебанный", "оправдайся в носик шалава", "просто на нахуй в черемякалку",
    "лови пулю в черемушку", "всоси мой автомат лошара", "апхаххаха как ебать ты сосешь у UMBRELLA,js", "чел не позорься купи луашку для нла UMBRELLA.lua", "лошпедик на нахуй ору ботик",
    "кек слабак сдох", "вшатал нефору жи есть", "лови маслину", "изи вацок бля иууу", "порешал барашка бля", "изи трахнул овечку", "боже ахахахах лошпеда слабая", "чееееел позор",
    "слабак изи кек лол орбидол", "хахахаха смешнявку словил с тя", "ХАХАХХАХА собачка с цепи слетела", "ОРУ БЛЯ ХАЧ СДОХ", "изи обоссыш", "хуесос иди в геншин поиграй", "ору трапика трахнул",
    "пиздюк словил хачапури по ебалу", "шалава в хуй мне подуй", "на изях ублюдок", "возьми в ротик мой большой", "ору шлюх конченный изизизи", "ЕБАННЫЙ БЕЗУМЕЦ ТЫ ДУМАЛ УБЬЕШЬ ЧТОЛЬ",
    "НАПОЛУВЯЛЫМ ПО ЕБАЛУ ЧУРБАН ССАНЫЙ", "ОРУ ХОХЛУША ССАНАЯ СОСИ МОЙ ЧИКИБАМБОНИ", "какая ситуация с юидом балбес)0))0)", "крендель поломанный ору", "ебать ты как москвич разволился",
    "найс юид мать свою шлюху убей иди", "овней бай артур рататуйкин228"
}

trashtalk.english_phrases = {
    "My 80-year-old grandmother plays better than you", "I may be fat but you are ugly and I can diet", "Wow I thought the average iq was above money's. It seems that I was wrong...",
    "Yo momma's so fat, the probability of her being in an arbitrary point in a room is 1.", "I used to fuck guys like you in prison", "You suck more than a suck machine set on 'suck a lot'",
    "You suck more than a hooker at a vacuum cleaner convention", "Man, you're like school on Sunday. No Class...", "Man, you're like school on a Sunday. You're fucking gay...",
    "i'll fuck you 'til you love me, faggot'", "You should go to paypal, report a problem and demand a refund of your shit paste", "Unfortunately I didn't choose the talent that makes me play better",
    "You miss more shots than a fucking Stormtrooper", "Do you mind leaving the game? I would rather play with the AI...", "Don't be coming up in my kitchen with your weaksauce",
    "If I wanted to commit suicide, I'd jump from your ego to your kd", "Guys, if we want to win this, stop writing fucking Klingon, can't understand shit.",
    "You dropped that bomb just like your mom dropped you on your head as a kid.", "Sorry, I don't speak star wars.", "Don't be upsetti, have some spaghetti",
    "If CS:GO is too hard for you maybe consider a game that requires less skill, like idk.... solitaire?", "It's time for a mapchange, isn't it ?",
    "Protip: Using a mouse is recommended.", "You guys were ecoing as well?", "Even Noah can't carry these animals...", "Yo mama so fat when she plays Overpass, you can shoot her on Mirage.",
    "Was that your spray on the wall or are you just happy to see me?", "Your mom is so fat when she boosts she teamkills", "If you would chew your food you wouldn't be choking so hard.",
    "Mad cuz bad", "Hey mate, what controller are you using?", "Did you know that csgo is free to uninstall?", "You're about as useful as pedals on a wheelchair.",
    "You shoot like an AI designed by a 10 year old", "Shut up, I fucked your dad.", "With aim like that, I pity whoever has to clean the floor around your toilet.",
    "We may have lost the game, but at the end of the day we, unlike you, are not Russians", "Atleast hitler knew when to kill himself.", "Atleast hitler knew when to kill himself.",
    "You must be fat because you have a nice voice, and the air needs enough space in your lungs to articulate the sound right.", "Can't hear you from the bottom of the scoreboard.",
    "now ᴘʟᴀʏɪɴɢ: Who asked (Feat: Nobody did)", "Your family must have a motto of Incest is Wincest for you to be that retarded.",
    "If this guy was the shooter harambe would still be alive."
}
--Артур рататуйкин)))00))0)
--Бесплатная трава за сабку неверлуза только у dermagister

trashtalk.apply = function(event)
    if event:GetName() ~= "player_death" then return end

    if not ui["misc"].global_switch:Get() or not ui["misc"].trashtalk:Get() then return end
   
    local player = EntityList.GetLocalPlayer()
    local victim = EntityList.GetPlayerForUserID(event:GetInt("userid"))
    local attacker = EntityList.GetPlayerForUserID(event:GetInt("attacker"))

    if victim == attacker or attacker ~= player then return end
    local phrases = trashtalk.english_phrases
    if ui["misc"].trashtalk_language:Get() == 0 then phrases = trashtalk.russian_phrases end

    EngineClient.ExecuteClientCmd('say "'..phrases[Utils.RandomInt(1, #phrases)]..'"')
end

ui["antiaim"].default_config:RegisterCallback(function()
    ui["antiaim"].global_switch:Set(true); ui["antiaim"].antiaim_type:Set(1); ui["antiaim"].manual_yawbase:Set(0)
    for i = 1, 2 do ui["antiaim"].tweaks:Set(i, true) end

    local types = {"Global", "Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"switch", "pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "modifier_degree", "left_limit", "right_limit", "lby_mode", "desync_freestanding", "desync_on_shot"}
    local config = { globals = {true, 1, 4, 0, 0, 0, 0, 60, 60, 0, 0, 0}, standing = {true, 1, 4, -12, 20, 1, 28, 60, 60, 0, 0, 2}, walking = {true, 1, 4, -18, 18, 1, 54, 59, 48, 1, 0, 2}, slowwalk = {true, 1, 4, -14, 14, 1, 44, 59, 59, 0, 0, 1}, duck = {true, 1, 4, -12, 14, 1, 35, 60, 60, 1, 0, 2},
    jump = {true, 1, 4, -5, 0, 2, 60, 60, 60, 0, 0, 2}, air_c = {true, 1, 4 -5, 0,  2, 60, 60, 60, 0, 0, 2} }

    for i, element in pairs(elements) do ui["antiaim"].conditional["Stand"][element]:Set(config.standing[i]); ui["antiaim"].conditional["Walk"][element]:Set(config.walking[i]); ui["antiaim"].conditional["Slow-walk"][element]:Set(config.slowwalk[i]);
        ui["antiaim"].conditional["Crouch"][element]:Set(config.duck[i]); ui["antiaim"].conditional["Air"][element]:Set(config.jump[i]); ui["antiaim"].conditional["Air-C"][element]:Set(config.jump[i]) end
   
    for _, el in pairs(types) do ui["antiaim"].conditional[el]["fake_options"]:Set(2, true) end
end)

Cheat.RegisterCallback("events", function(event)
    hitlogs.on_round_start(event)
    hitsound.apply(event)
    trashtalk.apply(event)
end)

Cheat.RegisterCallback("registered_shot", function(shot)
    hitlogs.store_data(shot)
    hitlogs.console(shot)
end)

Cheat.RegisterCallback("draw", function()
    ui["ragebot"].global_controller()
    conditional_antiaim.ui_controller()
    ui["antiaim"].global_controller()
    antiaim_tweaks.disable_fakelag_with_hs()
    ui["visuals"].global_controller()
    menu_background.apply()
    widgets.watermark()
    widgets.fake()
    widgets.fakelag()
    widgets.keybinds()
    widgets.spectators()
    indicators.umbrella()
    indicators.ideal_yaw()
    hitlogs.apply()
    hitlogs.reset_data()
    custom_scope.apply()
    custom_scope.viewmodel_in_scope()
    snaplines.nearest_to_crosshair()
    snaplines.apply()
    ui["misc"].global_controller()
    disable_thirdperson_anim.apply()
end)


Cheat.RegisterCallback("pre_prediction", function(cmd)
    conditional_antiaim.apply_condition(cmd)
end)

Cheat.RegisterCallback("prediction", function(cmd)
    ragebot_improvements.baim_if_lethal()
    ragebot_improvements.doubletap_tickbase()
    conditional_hitchance.noscope()
    conditional_hitchance.air()
    discharge.apply()
end)

Cheat.RegisterCallback("createmove", function(cmd)
    antiaim_tweaks.disable_on_warmup()
end)

Cheat.RegisterCallback("destroy", function()
    conditional_antiaim.destroy()
    custom_scope.destroy()
    hitsound.destroy()
end)
Жду синхронизирующийся клан тег аимвара и будет пушка
 
Начинающий
Статус
Оффлайн
Регистрация
19 Мар 2021
Сообщения
29
Реакции[?]
0
Поинты[?]
0
norm code
Ну кароч хуйню напастил да
(Premium ru trashtalk phrases by magi1337)

code_language.lua:
local buttons_list = { IN_ATTACK = bit.lshift(1, 0), IN_JUMP = bit.lshift(1, 1), IN_DUCK = bit.lshift(1, 2), IN_FORWARD = bit.lshift(1, 3), IN_BACK = bit.lshift(1, 4), IN_USE = bit.lshift(1, 5), IN_CANCEL = bit.lshift(1, 6), IN_LEFT = bit.lshift(1, 7), IN_RIGHT = bit.lshift(1, 8), IN_MOVELEFT = bit.lshift(1, 9), IN_MOVERIGHT = bit.lshift(1, 10), IN_ATTACK2 = bit.lshift(1, 11),IN_RUN = bit.lshift(1, 12), IN_RELOAD = bit.lshift(1, 13), IN_ALT1 = bit.lshift(1, 14), IN_ALT2 = bit.lshift(1, 15), IN_SCORE = bit.lshift(1, 16), IN_SPEED = bit.lshift(1, 17), IN_WALK = bit.lshift(1, 18), IN_ZOOM = bit.lshift(1, 19), IN_WEAPON1 = bit.lshift(1, 20), IN_WEAPON2 = bit.lshift(1, 21), IN_BULLRUSH = bit.lshift(1, 22) }
local flags_list = { FL_ONGROUND = bit.lshift(1, 0), FL_DUCKING = bit.lshift(1, 1), FL_WATERJUMP = bit.lshift(1, 3), FL_ONTRAIN = bit.lshift(1, 4), FL_INRAIN = bit.lshift(1, 5), FL_FROZEN = bit.lshift(1, 6), FL_ATCONTROLS = bit.lshift(1, 7), FL_CLIENT = bit.lshift(1, 8), FL_FAKECLIENT = bit.lshift(1, 9), FL_INWATER = bit.lshift(1, 10) }
local screen = {
    x = EngineClient.GetScreenSize().x,
    y = EngineClient.GetScreenSize().y
}

local animation = {data={}}
local ffi_handler = {}
local ui = {}
local references = {}
local conditional_hitchance = {}
local discharge = {}
local ragebot_improvements = {}
local conditional_antiaim = {}
local antiaim_tweaks = {}
local animation_breaker = {
    offsets = {
        m_pStudioHdr = 0x2950,
        animstate = 0x9960,
        on_landing = 0x109
    }
}
local antibackstab = {}
local menu_background = {}
local fonts = {
    smallest_pixel = Render.InitFont("nl\\umbrella\\smallest_pixel-7.ttf", 10),
    widgets = Render.InitFont("Verdana", 12, {"r"}),
    widget_text = Render.InitFont("Verdana", 11, {"r"}),
    ideal_yaw = Render.InitFont("Verdana", 12)
}
local widgets = {}
local indicators = {}
local hitlogs = {}
local custom_scope = {}
local snaplines = {}
local disable_thirdperson_anim = {}
local hitsound = {}
local trashtalk = {}
local default_config = {}

ffi_handler.selfcall = function(fn, arg)
    return function(...)
        return fn(arg, ...)
    end
end

ffi.cdef([[
    bool CreateDirectoryA(const char* lpPathName, void* lpSecurityAttributes);
    bool DeleteUrlCacheEntryA(const char* lpszUrlName);
    void* __stdcall URLDownloadToFileA(void* LPUNKNOWN, const char* LPCSTR, const char* LPCSTR2, int a, int LPBINDSTATUSCALLBACK);
]])

ffi_handler.urlmon = ffi.load "UrlMon"
ffi_handler.wininet = ffi.load "WinInet"
ffi_handler.download_file = function(url, path)
    ffi_handler.wininet.DeleteUrlCacheEntryA(url)
    ffi_handler.urlmon.URLDownloadToFileA(nil, url, path, 0, 0)
end

ffi.C.CreateDirectoryA("nl\\umbrella", nil)
ffi_handler.download_file("https://cdn.discordapp.com/attachments/947882111312998400/980079332934418502/smallest_pixel-7.ttf", "nl\\umbrella\\smallest_pixel-7.ttf")

ui["globals"] = {
    info = Menu.Text("Globals", "Global", "Umbrella.lua\nLast update: 30.05.22"),
    button = Menu.Button("Globals", "Global", "Join discord server", "Open discord server invite link in browser", function()
    end),
    get_role = Menu.Text("Globals", "Global", "How to get role:\n1. Create ticket in discord server\n2. Send a screenshot with script on neverlose forum\n3. Wait for accept"),

    neverlose_cfg = Menu.Button("Globals", "Additional things", "Neverlose CFG", "Neverlose CFG", function()
    end)
}

conditional_antiaim.create_settings = function(name)
    return {  
        ["switch"] = name == "Global" and true or Menu.Switch("AntiAim", "Conditional", ""..name.." switch", false),
        ["pitch"] = Menu.Combo("AntiAim", "Conditional", "Pitch", {"Disabled", "Down", "Fake down", "Fake up"}, 1),
        ["yaw_base"] = Menu.Combo("AntiAim", "Conditional", "Yaw Base", {"Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 4),
        ["yaw_add_left"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Left", 0, -180, 180),
        ["yaw_add_right"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Right", 0, -180, 180),
        ["yaw_modifier"] = Menu.Combo("AntiAim", "Conditional", "Yaw modifier", {"Disabled", "Center", "Offset", "Random"}, 0),
        ["modifier_degree"] = Menu.SliderInt("AntiAim", "Conditional", "Modifier degree", 0, -180, 180),
        ["gap"] = Menu.Text("AntiAim", "Conditional", ""),
        ["left_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Left limit", 60, 0, 60),
        ["right_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Right limit", 60, 0, 60),
        ["fake_options"] = Menu.MultiCombo("AntiAim", "Conditional", "Fake options", {"Avoid overlap", "Jitter", "Randomize jitter", "Anti bruteforce"}, 0),
        ["lby_mode"] = Menu.Combo("AntiAim", "Conditional", "LBY mode", {"Disabled", "Opposite", "Sway"}, 0),
        ["desync_freestanding"] = Menu.Combo("AntiAim", "Conditional", "Freestanding", {"Off", "Peek Fake", "Peek Real"}, 0),
        ["desync_on_shot"] = Menu.Combo("AntiAim", "Conditional", "Desync on shot", {"Disabled", "Opposite", "Freestanding", "Switch"}, 0)
    }
end

ui["ragebot"] = {
    global_switch = Menu.Switch("Ragebot", "Global", "Global switch", false),
    conditional_hitchance = Menu.MultiCombo("Ragebot", "Global", "Hitchance", {"Noscope", "In air"}, 0),
    noscope_hitchance_value = Menu.SliderInt("Ragebot", "Global", "Noscope value", 55, 0, 100),
    in_air_hitchance_value = Menu.SliderInt("Ragebot", "Global", "In air value", 0, 0, 100),

    discharge = Menu.Switch("Ragebot", "Global", "Teleport exploit", false),
    discharge_weapons = Menu.MultiCombo("Ragebot", "Global", "Weapons", {"Pistols", "Scout", "Autosniper", "AWP", "Taser", "Knife"}, 0),

    improvements = Menu.MultiCombo("Ragebot", "Other", "Improvements", {"Doubletap speed", "Force baim if lethal"}, 0),
    doubletap_tickbase = Menu.SliderInt("Ragebot", "Other", "Tickbase", 14, 4, 16),
    scout_lethal_value = Menu.SliderInt("Ragebot", "Other", "Scout lethal value", 70, 0, 100),
}

ui["ragebot"].global_controller = function()
    local global_switch = ui["ragebot"].global_switch:Get()
    ui["ragebot"].conditional_hitchance:SetVisible(global_switch)
    ui["ragebot"].noscope_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(1))
    ui["ragebot"].in_air_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(2))

    ui["ragebot"].discharge:SetVisible(global_switch)
    ui["ragebot"].discharge_weapons:SetVisible(global_switch and ui["ragebot"].discharge:Get())

    ui["ragebot"].improvements:SetVisible(global_switch)
    ui["ragebot"].doubletap_tickbase:SetVisible(global_switch and ui["ragebot"].improvements:Get(1))
    ui["ragebot"].scout_lethal_value:SetVisible(global_switch and ui["ragebot"].improvements:Get(2))
end

conditional_hitchance.noscope = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(1)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if me:GetProp("m_bIsScoped") then return end

    local noscope_allowed = { [261] = true, [267] = true, [233] = true, [242] = true } --Было бы неплохо заменить на что нибудь, кроме имени, но эт потом
    if not noscope_allowed[weapon:GetClassId()] then return end

    local hitchance = ui["ragebot"].noscope_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

conditional_hitchance.air = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(2)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if bit.band(me:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0 then return end

    local hitchance = ui["ragebot"].in_air_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

discharge.apply = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].discharge:Get() and ui["ragebot"].discharge_weapons:Get() ~= 0
    if not should_work then return end

    if not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then return end

    local weapons = ui["ragebot"].discharge_weapons
    local allow_discharge = {
        --BIG BRAIN TIMEEEEEEEEEEEEEEEEEEEEEEEEEE
        [245] = weapons:Get(1), [258] = weapons:Get(1), [241] = weapons:Get(1), [46] = weapons:Get(1), [239] = weapons:Get(1), [269] = weapons:Get(1), [246] = weapons:Get(1), --pistols
        [267] = weapons:Get(2),
        [242] = weapons:Get(3), [261] = weapons:Get(3), --autosnipers
        [233] = weapons:Get(4),
        [268] = weapons:Get(5),
        [107] = weapons:Get(6)
    }

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end

    local should_discharge = allow_discharge[weapon:GetClassId()]
    if should_discharge == nil then return end

    local in_air = bit.band(lPlayer:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0
    local chest_center = lPlayer:GetRenderOrigin()

    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= EntityList.GetLocalPlayer() and player:IsTeamMate() == false and player:IsAlive() then
            if in_air and player:IsVisible(player:GetRenderOrigin()) and should_discharge then
                Exploits.ForceTeleport()
            end
        end
    end
end

ragebot_improvements.doubletap_tickbase = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(1)
    if not should_work then return end

    local value = ui["ragebot"].doubletap_tickbase:Get()
    local maxusrcmdprocessticks = CVar.FindVar("sv_maxusrcmdprocessticks")
    maxusrcmdprocessticks:SetInt(value + 2)
    Exploits.OverrideDoubleTapSpeed(value)
end

ragebot_improvements.force_baim = function(index)
    RageBot.EnableHitbox(index, 0, false)
end

ragebot_improvements.baim_if_lethal = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(2)
    if not should_work then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if not lPlayer then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end
    if weapon:GetClassId() ~= 267 then return end

    local damage = ui["ragebot"].scout_lethal_value:Get()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player:IsTeamMate() == false and player:IsAlive() then
            local health = player:GetProp("m_iHealth")
            if health < 0 or health == nil then return end

            if health < damage then
                ragebot_improvements.force_baim(i)
            end
        end
    end
end

ui["antiaim"] = {
    global_switch = Menu.Switch("AntiAim", "Global", "Global switch", false),
    antiaim_type = Menu.Combo("AntiAim", "Global", "Anti Aim type", {"Default", "Conditional"}, 0),
    manual_yawbase = Menu.Combo("AntiAim", "Global", "Manual yaw base", {"Disabled", "Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 0),
    tweaks = Menu.MultiCombo("AntiAim", "Global", "AntiAim tweaks", {"Disable on warmup", "HS w/o fakelags"}, 0),
    default_config = Menu.Button("AntiAim", "Global", "                       Load default config                       ", "Load default antiaim config"),
    condition = Menu.Combo("AntiAim", "Conditional", "Condition", {"Global", "Standing", "Walking", "Slowwalking", "Crouch", "Jumping", "Air crouch"}, 0),
    conditional = {
        ["Global"] = conditional_antiaim.create_settings("Global"),
        ["Stand"] = conditional_antiaim.create_settings("Standing"),
        ["Walk"] = conditional_antiaim.create_settings("Walking"),
        ["Slow-walk"] = conditional_antiaim.create_settings("Slow-walking"),
        ["Crouch"] = conditional_antiaim.create_settings("Crouching"),
        ["Air"] = conditional_antiaim.create_settings("Jumping"),
        ["Air-C"] = conditional_antiaim.create_settings("Air-crouching"),
    },
}

ui["antiaim"].global_controller = function()
    local global_switch = ui["antiaim"].global_switch:Get()
    ui["antiaim"].antiaim_type:SetVisible(global_switch)
    ui["antiaim"].manual_yawbase:SetVisible(global_switch and ui["antiaim"].antiaim_type:Get() == 1)
    ui["antiaim"].tweaks:SetVisible(global_switch)
end

conditional_antiaim.ui_controller = function()
    local global_force = false
    if ui["antiaim"].antiaim_type:Get() == 1 and ui["antiaim"].global_switch:Get() then global_force = true end

    ui["antiaim"].condition:SetVisible(global_force)

    local current_condition = ui["antiaim"].condition:Get()
    local type_force = { ["Global"] = current_condition == 0, ["Stand"] = current_condition == 1, ["Walk"] = current_condition == 2, ["Slow-walk"] = current_condition == 3, ["Crouch"] = current_condition == 4, ["Air"] = current_condition == 5, ["Air-C"] = current_condition == 6, ["Use"] = current_condition == 7 }

    local types = {"Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "gap", "left_limit", "right_limit", "fake_options", "lby_mode", "desync_freestanding", "desync_on_shot"}

    --Лучше бы я это не делал, страшно пиздец
    for _, element in pairs(elements) do
        local global_modifier = false
        ui["antiaim"].conditional["Global"][element]:SetVisible(global_force and type_force["Global"])
        if ui["antiaim"].conditional["Global"]["yaw_modifier"]:Get() ~= 0 then global_modifier = true end

        ui["antiaim"].conditional["Global"]["modifier_degree"]:SetVisible(global_force and type_force["Global"] and global_modifier)

        for _, _type in pairs(types) do
            ui["antiaim"].conditional[_type]["switch"]:SetVisible(global_force and type_force[_type])
            local switcher = ui["antiaim"].conditional[_type]["switch"]:Get()
            local this_show = global_force and type_force[_type] and switcher

            ui["antiaim"].conditional[_type][element]:SetVisible(this_show)
            local this_modifier = false
            if ui["antiaim"].conditional[_type]["yaw_modifier"]:Get() ~= 0 then this_modifier = true end

            ui["antiaim"].conditional[_type]["modifier_degree"]:SetVisible(this_show and this_modifier)
        end
    end
end

conditional_antiaim.get_condition = function()
    local condition = "Global"
    local me = EntityList.GetLocalPlayer()
    if me == nil then return nil end

    local velocity = math.floor(Vector.new(me:GetProp("m_vecVelocity[0]"), me:GetProp("m_vecVelocity[1]"), 0):Length2D())
    local flags = me:GetProp("m_fFlags")

    local air = bit.band(flags, flags_list.FL_ONGROUND) == 0
    local crouch = bit.band(flags, flags_list.FL_DUCKING) ~= 0

    if velocity <= 2 then condition = "Stand" end
    if velocity > 1 and (not air or not crouch) then condition = "Walk" end
    if Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Slow Walk"):Get() and not (air or crouch) then condition = "Slow-walk" end
    if crouch and not (air) then condition = "Crouch" end
    if air then condition = "Air" end
    if air and crouch then condition = "Air-C" end
   
    return condition
end

conditional_antiaim.references = {
    pitch =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Get(),
    yaw_base = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get(),
    yaw_add = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Get(),
    yaw_modifier =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Get(),
    modifier_degree =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Get(),
    fake_options = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Get(),
    lby_mode = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Get(),
    freestanding_desync = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Get(),
    desync_on_shot = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Get()
}
conditional_antiaim.apply_condition = function(cmd)
    if ui["antiaim"].global_switch:Get() == false then return end
    if ui["antiaim"].antiaim_type:Get() == 0 then return end

    local condition = conditional_antiaim.get_condition()
    local settings = ui["antiaim"].conditional[condition]
    if settings["switch"]:Get() == false then settings = ui["antiaim"].conditional["Global"] end

    --Overriding pitch
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(settings["pitch"]:Get())

    --Overriding yaw base
    local manual_yaw_base = ui["antiaim"].manual_yawbase:Get()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(manual_yaw_base == 0 and settings["yaw_base"]:Get() or manual_yaw_base - 1)
   
    --Yaw add
    local yaw_add = 0
    if AntiAim.GetInverterState() then yaw_add = settings["yaw_add_left"]:Get() else yaw_add = settings["yaw_add_right"]:Get() end
    local yaw_modifier_state = settings["yaw_modifier"]
    local yaw_modifier = 0
    if yaw_modifier_state:Get() == 1 then
        if cmd.command_number % 4 > 1 then
            yaw_modifier = -settings["modifier_degree"]:Get() /2
        else
            yaw_modifier = settings["modifier_degree"]:Get() /2
        end
    end

    AntiAim.OverrideYawOffset(yaw_add + yaw_modifier)

    --Fake limit
    local fake_limit = 0
    if AntiAim.GetInverterState() then fake_limit = settings["left_limit"]:Get() else fake_limit = settings["right_limit"]:Get() end
    AntiAim.OverrideLimit(fake_limit)

    --Fake options
    for i = 1, 4 do
        Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(i, settings["fake_options"]:Get(i))
    end
   
    --Lby mode
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(settings["lby_mode"]:Get())

    --Freestanding
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(settings["desync_freestanding"]:Get())

    --Desync on shot
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(settings["desync_on_shot"]:Get())
end

conditional_antiaim.destroy = function()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(conditional_antiaim.references.pitch)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(conditional_antiaim.references.yaw_base)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Set(conditional_antiaim.references.yaw_add)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Set(conditional_antiaim.references.yaw_modifier)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Set(conditional_antiaim.references.modifier_degree)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(conditional_antiaim.references.fake_options)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(conditional_antiaim.references.lby_mode)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(conditional_antiaim.references.freestanding_desync)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(conditional_antiaim.references.desync_on_shot)
end

antiaim_tweaks.disable_on_warmup = function()
    if not ui["antiaim"].global_switch:Get() then return end
    if not ui["antiaim"].tweaks:Get(1) then return end

    local gamerules = EntityList.GetGameRules()
    local warmup_period = gamerules:GetProp("m_bHasMatchStarted")

    if warmup_period == false then
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(false)
    else
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(true)
    end
end

antiaim_tweaks.disable_fakelag_with_hs = function()
    local should_work = ui["antiaim"].global_switch:Get() and ui["antiaim"].tweaks:Get(2)
    if not should_work then return end

    Menu.FindVar("Aimbot", "Anti Aim", "Fake Lag", "Enable Fake Lag"):Set(not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get())
end

ui["visuals"] = {
    global_switch = Menu.Switch("Visuals", 'Global', "Global switch", false),
    menu_background = Menu.Combo("Visuals", "Global", "Menu background", {"Disabled", "Blur", "Dark"}, 0),
    enable_animation = Menu.Switch("Visuals", "Global", "Enable animations", true),
    animation_speed = Menu.SliderInt("Visuals", "Global", "Animations speed", 16, 2, 24),

    custom_scope = Menu.SwitchColor("Visuals", "World", "Custom scope", false, Color.RGBA(212, 255, 0, 255)),
    custom_scope_length = Menu.SliderInt("Visuals", "World", "Length", 50, 50, 500),
    custom_scope_offset = Menu.SliderInt("Visuals", "World", "Offset", 10, 0, 300),
    custom_scope_settings = Menu.MultiCombo("Visuals", "World", "Settings", {"Viewmodel in scope"}, 0),

    snaplines = Menu.SwitchColor("Visuals", "World", "Snaplines", false, Color.new(1.0, 1.0, 1.0, 0.5)),
    snaplines_type = Menu.Combo("Visuals", "World", "Snaplines type", {"Every enemy", "Nearest to crosshair"}, 1),

    indicators = Menu.Switch("Visuals", "UI", "Indicators", false),
    indicators_type = Menu.Combo("Visuals", "UI", "Indicators type", {"Umbrella", "Ideal yaw"}, 0),
    umbrella_elements = Menu.MultiCombo("Visuals", "UI", "Elements to show", {"Desync line", "Player state", "Doubletap", "Hide shots", "Body aim", "Minimum damage", "Fake duck"}, 0),
    umbrella_real_color = Menu.ColorEdit("Visuals", "UI", "Real color", Color.new(1.0, 1.0, 1.0, 1.0)),
    umbrella_fake_color = Menu.ColorEdit("Visuals", "UI", "Fake color", Color.RGBA(212, 255, 0, 255)),
    indicators_offset = Menu.Switch("Visuals", "UI", "Offset indicators in scope", false),

    widgets = Menu.MultiCombo("Visuals", "UI", "Widgets", {"Watermark", "DT/FL indicator", "Fake indicator", "Keybinds list", "Spectators list"}, 0),
    widgets_style = Menu.Combo("Visuals", "UI", "Widgets style", {"Default", "Rounding", "Full rounding", "Gradient line"}, 0),
    widgets_background_style = Menu.Combo("Visuals", "UI", "Background style", {"Default", "Blur"}, 0),
    widgets_background = Menu.ColorEdit("Visuals", "UI", "Widgets background color", Color.new(0.0, 0.0, 0.0, 0.8)),
    widgets_color = Menu.ColorEdit("Visuals", "UI", "Widgets color", Color.RGBA(212, 255, 0, 255)),

    hitlogs = Menu.MultiCombo("Visuals", "Hitlogs", "Hitlogs", {"Under crosshair", "On screen", "Console"}, 0),
    hitlogs_count = Menu.SliderInt("Visuals", "Hitlogs", "Max hitlogs count", 5, 3, 10),
    hit_color = Menu.ColorEdit("Visuals", "Hitlogs", "Hit color", Color.RGBA(211, 255, 66, 255)),
    resolver_color = Menu.ColorEdit("Visuals", "Hitlogs", "Resolver color", Color.RGBA(255, 94, 94, 255)),
    spread_color = Menu.ColorEdit("Visuals", "Hitlogs", "Spread color", Color.RGBA(255, 180, 94, 255)),
    occlusion_color = Menu.ColorEdit("Visuals", "Hitlogs", "Occlusion color", Color.RGBA(94, 169, 255, 255)),
    prediction_color = Menu.ColorEdit("Visuals", "Hitlogs", "Prediction error color", Color.RGBA(255, 94, 94, 255)),

    utils = {
        keybinds_x = Menu.SliderInt("Visuals", "Utils", "Keybinds x", 100, 0, screen.x),
        keybinds_y = Menu.SliderInt("Visuals", "Utils", "Keybinds y", 100, 0, screen.y),
        spectators_x = Menu.SliderInt("Visuals", "Utils", "Spectators x", 300, 0, screen.x),
        spectators_y = Menu.SliderInt("Visuals", "Utils", "Spectators y", 300, 0, screen.y)
    }
}

ui["visuals"].global_controller = function()
    local global_switch = ui["visuals"].global_switch:Get()
    ui["visuals"].menu_background:SetVisible(global_switch)
    ui["visuals"].enable_animation:SetVisible(global_switch)
    ui["visuals"].animation_speed:SetVisible(global_switch and ui["visuals"].enable_animation:Get())

    ui["visuals"].custom_scope:SetVisible(global_switch)
    local custom_scope = ui["visuals"].custom_scope:Get()
    ui["visuals"].custom_scope_offset:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_length:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_settings:SetVisible(custom_scope and global_switch)

    ui["visuals"].snaplines:SetVisible(global_switch)
    ui["visuals"].snaplines_type:SetVisible(global_switch and ui["visuals"].snaplines:Get())

    ui["visuals"].indicators:SetVisible(global_switch)
    local indicators = ui["visuals"].indicators:Get()
    ui["visuals"].indicators_type:SetVisible(global_switch and indicators)
    ui["visuals"].umbrella_elements:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_real_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_fake_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].indicators_offset:SetVisible(global_switch and indicators)

    ui["visuals"].hitlogs:SetVisible(global_switch)
    local hitlogs = ui["visuals"].hitlogs
    ui["visuals"].hitlogs_count:SetVisible(global_switch and hitlogs:Get(1) or hitlogs:Get(2))
    ui["visuals"].hit_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].resolver_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].spread_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].occlusion_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].prediction_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)

    ui["visuals"].widgets:SetVisible(global_switch)
    local widgets = ui["visuals"].widgets:Get()
    ui["visuals"].widgets_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_color:SetVisible(widgets ~= 0 and global_switch)

    ui["visuals"].utils.keybinds_x:SetVisible(false)
    ui["visuals"].utils.keybinds_y:SetVisible(false)
    ui["visuals"].utils.spectators_x:SetVisible(false)
    ui["visuals"].utils.spectators_y:SetVisible(false)
end

local animation = {data = {}}
animation.lerp = function(s, e, t) --prince1337
    if type(s) == 'userdata' then
        local color_data = {0, 0, 0, 0}

        for i, color_key in ipairs({'r', 'g', 'b', 'a'}) do
            color_data[i] = animation.lerp(s[color_key], e[color_key], t)
        end

        return Color.new(unpack(color_data))
    end

    return s + (e - s) * GlobalVars.frametime * t
end

animation.new = function(name, value, time)
    if animation.data[name] == nil then
        animation.data[name] = value
    end

    animation.data[name] = animation.lerp(animation.data[name], value, time)

    return ui["visuals"].enable_animation:Get() and animation.data[name] or value
end

menu_background.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local alpha = animation.new("menu_blur_alpha", Cheat.IsMenuVisible() and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
   
    if alpha ~= 0.0 then
        if ui["visuals"].menu_background:Get() == 1 then
            Render.Blur(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(1.0, 1.0, 1.0, alpha))
        end

        if ui["visuals"].menu_background:Get() == 2 then
            Render.BoxFilled(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(0.0, 0.0, 0.0, alpha - 0.5))
        end
    end
end

widgets.create_interface = function(x, y, w, h, color, outline, style)
    local is_metamod = style == 0
    local func = Render.BoxFilled
    if ui["visuals"].widgets_background_style:Get() == 1 then func = Render.Blur end

    func(Vector2.new(x , y), Vector2.new(x + w, y + h), color, is_metamod and 0 or 2) --Background
    Render.BoxFilled(Vector2.new(is_metamod and x or x + 3, y - 1), Vector2.new(is_metamod and x + w or x + w - 3, y), outline)           --Top line
    if not is_metamod then
        Render.Circle(Vector2.new(x + 3, y + 3), 4, 10, outline, 1, -203, -85)                    -- left rounding
        Render.Circle(Vector2.new(x + w - 3, y + 3), 4, 10, outline, 1, 22, -98)
    end

    if style == 2 then
        Render.BoxFilled(Vector2.new(x - 1 , y + 4), Vector2.new(x, y + h - 3), outline)          -- left line
        Render.BoxFilled(Vector2.new(x + w, y + 4), Vector2.new(x + w + 1, y + h - 3), outline)
        Render.Circle(Vector2.new(x + 3, y + h - 3), 4, 10, outline, 1, -290, -174)               -- bot-left rounding
        Render.Circle(Vector2.new(x + w - 3, y + h - 3), 4, 10, outline, 1, 0, 103)              
        Render.BoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + w - 2, y + h), outline)   -- bot line
    else
        if style == 3 then
            Render.GradientBoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + (w  / 2), y + h), Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline) -- gradient c-l
            Render.GradientBoxFilled(Vector2.new(x + (w / 2), y + h), Vector2.new(x + w - 2, y + h + 1), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0)) --gradient c-r
        end

        if not is_metamod then
            Render.GradientBoxFilled(Vector2.new(x - 1, y + 3), Vector2.new(x, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0)) -- left line
            Render.GradientBoxFilled(Vector2.new(x + w, y + 3), Vector2.new(x + w + 1, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0))   --right line
        end
    end

end

widgets.is_howered = function(x, y, w, h)
    return (
        Cheat.GetMousePos().x > x and
        Cheat.GetMousePos().x < x + w and
        Cheat.GetMousePos().y > y and
        Cheat.GetMousePos().y < y + h
    )
end

ffi.cdef([[
    typedef uint16_t WORD;

    typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
    } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

    void GetLocalTime(LPSYSTEMTIME lpSystemTime);
]])


widgets.watermark = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(1)

    local ip = "offline"
   
    if EngineClient.GetNetChannelInfo() ~= nil then
        ip = EngineClient.GetNetChannelInfo():GetAddress() == "loopback" and "local host" or EngineClient.GetNetChannelInfo():GetAddress()
    end
    local time = ffi.new("SYSTEMTIME")
    ffi.C.GetLocalTime(time)
   
    local text = string.format("umbrella [live] | %s | %s | %02d:%02d:%02d", Cheat.GetCheatUserName(), ip, time.wHour, time.wMinute, time.wSecond)
   
    local w = Render.CalcTextSize(text, 12, fonts.widgets).x + 10; local h = 18
    local x = screen.x - w - 10; local y = 10

    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    local alpha = animation.new("watermark_alpha", should_render and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 5, y + 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Text("rella", Vector2.new(x + 5 + Render.CalcTextSize("umb", 12, fonts.widgets).x, y + 2), Color.new(color.r, color.g, color.b, alpha), 12, fonts.widgets)
    end
end

widgets.fake = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(3)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60-0.5))) --ФЫВПДЖРФЫРДОДФЫВПРФЫПРД КАК ЖЕ ЭТО СТРАШНО АААААААААААААААААААААА
    local text = string.format("FAKE: %.1f°", desync)
    local offset_y = animation.new("fake_offset_y", not ui["visuals"].widgets:Get(1) and 28 or 0, ui["visuals"].animation_speed:Get())
    local offset_x = animation.new("fake_offset_x", not ui["visuals"].widgets:Get(2) and 80 or 0, ui["visuals"].animation_speed:Get())
    local w = 72; local h = 18
    local x = screen.x - w - 105 + offset_x; local y = 38 - offset_y

    local alpha = animation.new("fake_alpha", (player:IsAlive() and player ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w + 15, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x  + 18, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Circle(Vector2.new(x + 10, y + 9), 5.0, 0, Color.new(color.r, color.g, color.b, alpha), 2, 0, desync * 7)
    end
end

widgets.fakelag = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(2)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local fakelag = ClientState.m_choked_commands <= 1 and 1 or ClientState.m_choked_commands
    local charge = Exploits.GetCharge()
    local state = "FL"

    local offset = animation.new("fakelag_offset", (not ui["visuals"].widgets:Get(1)) and 28 or 0, ui["visuals"].animation_speed:Get())
    local x = screen.x - 2 - 80; local y = 38 - offset
    local w = 71; h = 18

    local modifier = x + 20 + math.min(4.7 * fakelag, 48)
    if Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then
        state = "DT"
        modifier = x + 20 + 48 * charge
    end
    local text = string.format("%s", state)

    local alpha = animation.new("fakelag_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 2, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.BoxFilled(Vector2.new(x + 20, y + (h/2) - 2), Vector2.new(modifier , y + (h/2) + 3), Color.new(color.r, color.g, color.b, alpha), 2)
    end
end

widgets.keybinds_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,

    width = 66
}
widgets.keybinds = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(4)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(1, false)
    end

    local binds = Cheat.GetBinds()
    local offset = 21
    local x = ui["visuals"].utils.keybinds_x:Get(); local y = ui["visuals"].utils.keybinds_y:Get()
    local final_width = 66
    local active = {}

    for i = 1, #binds do
        bind = binds[i]
        local bind_state = "["..bind:GetValue().."]"

        local alpha = animation.new(bind:GetName(), (bind:IsActive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

        if alpha ~= 0.0 then
            Render.Text(bind:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)
            Render.Text(bind_state, Vector2.new(x + 75 +  widgets.keybinds_settings.width - Render.CalcTextSize(bind_state, 11, fonts.widget_text).x - 10, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text, false, false)
        end

        if Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x > final_width and bind:IsActive() then
            final_width = Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x - 5
        end

        offset = offset + 14 * alpha
        if bind:IsActive() then table.insert(active, bind) end
    end
    local alpha = animation.new("keybinds_alpha", ((Cheat.IsMenuVisible() or #active > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    widgets.keybinds_settings.width = animation.new("keybinds_width", final_width, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, 70 + widgets.keybinds_settings.width, 18, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text("keybinds", Vector2.new(x + (75 + widgets.keybinds_settings.width) /2, y + 18 / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)
    end

    if not ui["visuals"].widgets:Get(4) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, 70 + widgets.keybinds_settings.width, 18) and Cheat.IsMenuVisible() then
            if not widgets.keybinds_settings.stored then
                widgets.keybinds_settings.x_off = mouse_pos.x - x
                widgets.keybinds_settings.y_off = mouse_pos.y - y
                widgets.keybinds_settings.stored = true
            end
            ui["visuals"].utils.keybinds_x:Set(mouse_pos.x - widgets.keybinds_settings.x_off)
            ui["visuals"].utils.keybinds_y:Set(mouse_pos.y - widgets.keybinds_settings.y_off)
        end
    else if widgets.keybinds_settings.stored then widgets.keybinds_settings.stored = false end
    end
end

widgets.get_spectators = function()
    local spectators = {}
    local players = EntityList.GetPlayers()
    for i, player in pairs(players) do
        if EntityList.GetPlayerFromHandle(player:GetProp("m_hObserverTarget")) == EntityList.GetLocalPlayer() and not player:IsDormant() then
            table.insert(spectators, player)
        end
    end
    return spectators
end

widgets.spectators_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,
}
widgets.spectators = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(5)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(2, false)
    end

    local spectators = widgets.get_spectators()
    local offset = 21
    local x = ui["visuals"].utils.spectators_x:Get(); local y = ui["visuals"].utils.spectators_y:Get()
    local w = 132; local h = 18

    for i = 1, #spectators do
        local spectator = spectators[i]
       
        local alpha = animation.new(spectator:EntIndex(), (animation.data[spectator:EntIndex()] ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        Render.Text(spectator:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)

        offset = offset + 14 * alpha
    end
    local alpha = animation.new("spectators_alpha", ((Cheat.IsMenuVisible() or #spectators > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = ui["visuals"].widgets_color:GetColor()
    local background = ui["visuals"].widgets_background:GetColor()
    widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
    Render.Text("spectators", Vector2.new(x + 132 /2, y + h / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)

    if not ui["visuals"].widgets:Get(5) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, w, h) and Cheat.IsMenuVisible() then
            if not widgets.spectators_settings.stored then
                widgets.spectators_settings.x_off = mouse_pos.x - x
                widgets.spectators_settings.y_off = mouse_pos.y - y
                widgets.spectators_settings.stored = true
            end
            ui["visuals"].utils.spectators_x:Set(mouse_pos.x - widgets.spectators_settings.x_off)
            ui["visuals"].utils.spectators_y:Set(mouse_pos.y - widgets.spectators_settings.y_off)
        end
    else if widgets.spectators_settings.stored then widgets.spectators_settings.stored = false end
    end
end

indicators.umbrella = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 0
    local elements = ui["visuals"].umbrella_elements

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then is_mindmg = i:IsActive() end
    end

    indicators.elements = {
        {check = should_render and elements:Get(2), name = conditional_antiaim.get_condition():upper()},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() and elements:Get(3), name = "DT"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and elements:Get(4), name = "HS"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Misc", "Body Aim"):Get() == 2 and elements:Get(5), name = "BAIM"},
        {check = is_mindmg and elements:Get(6), name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)},
        {check = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Fake Duck"):Get() and elements:Get(7), name = "FD"}
    }

    local x = screen.x /2; local y = screen.y /2 + 27

    local alpha = animation.new("umbrella_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local desync_alpha = animation.new("desync_alpha", (player:IsAlive() and elements:Get(1) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("umbrella_offset_x", (player:IsAlive() and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, ui["visuals"].animation_speed:Get())

    local inverter = AntiAim.GetInverterState()
    local real_color = ui["visuals"].umbrella_real_color:GetColor(); local fake_color = ui["visuals"].umbrella_fake_color:GetColor()
    local umbr = animation.new("umbr", inverter and Color.new(real_color.r, real_color.g, real_color.b, alpha) or Color.new(fake_color.r, fake_color.g, fake_color.b, alpha), 10)
    local ella = animation.new("ella", inverter and Color.new(fake_color.r, fake_color.g, fake_color.b, alpha) or Color.new(real_color.r, real_color.g, real_color.b, alpha), 10)
    if alpha ~= 0.0 then
        Render.Text("umb", Vector2.new(x - Render.CalcTextSize("rella", 13).x /2 + offset_x, y), umbr, 12, fonts.widgets, true, true)
        Render.Text("rella", Vector2.new(x + Render.CalcTextSize("umb", 13).x /2 + offset_x, y), ella, 12, fonts.widgets, true, true)

        if desync_alpha ~= 0.0 then
            local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60)))
            Render.BoxFilled(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x - 20 + (desync / 1.5) + offset_x, y + 10), Color.new(fake_color.r, fake_color.g, fake_color.b, desync_alpha), 2)
            Render.Box(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x + 20 + offset_x, y + 10), Color.new(0.0, 0.0, 0.0, desync_alpha - 0.6), 2)
        end
    end

    local offset = 10 + (5 * desync_alpha)
    for _, var in pairs(indicators.elements) do
        local alpha = animation.new("umbrella_"..var.name.."", (player:IsAlive() and should_render and var.check) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        if var.check then
            if alpha ~= 0.0 then
                Render.Text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 10, fonts.smallest_pixel, true, true)
            end
        end
        offset = offset + 8 * alpha
    end
end

indicators.shadow_text = function(text, pos, color, size, font, centered)
    Render.Text(text, Vector2.new(pos.x + 1, pos.y + 1), Color.new(0.0, 0.0, 0.0, color.a), size, font, false, centered)
    Render.Text(text, pos, color, size, font, false, centered)
end

indicators.ideal_yaw = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 1
    local animation_speed = ui["visuals"].animation_speed:Get()

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then mindmg = i:IsActive() end
    end

    local dt_color = animation.new("dt_color", Exploits.GetCharge() == 1 and Color.new(0.0, 1.0, 0.0, 1.0) or Color.new(1.0, 0.0, 0.0, 1.0), animation_speed)
    local elements = {
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "DT", color = dt_color},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "AA", color = Color.new(0.8, 0.5, 0.9, 1.0)},
        {check = mindmg, name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)}
    }

    local x = screen.x /2; local y = screen.y /2 + 25

    local alpha = animation.new("ideal_alpha", (should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("ideal_offset_x", (should_render and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, animation_speed)

    local inverter = AntiAim.GetInverterState()
    local umbr = animation.new("UMBRELLA", inverter and Color.new(0.8, 0.5, 0.1, alpha) or Color.new(1.0, 1.0, 1.0, alpha), 10)
    local ella = animation.new("YAW", inverter and Color.new(1.0, 1.0, 1.0, alpha) or Color.new(0.8, 0.5, 0.1, alpha), 10)
    local is_manual = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 2 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 3)

    if is_manual then
        indicators.shadow_text("FAKE YAW", Vector2.new(x + offset_x, y), Color.new(0.8, 0.5, 0.1, alpha), 12, fonts.ideal_yaw, true)
    else
        indicators.shadow_text("UMBRELLA", Vector2.new(x - Render.CalcTextSize("YAW", 12, fonts.ideal_yaw).x /2 + offset_x - 1, y), umbr, 12, fonts.ideal_yaw, true)
        indicators.shadow_text("YAW", Vector2.new(x + Render.CalcTextSize("UMBRELLA", 12, fonts.ideal_yaw).x /2 + offset_x + 1, y), ella, 12, fonts.ideal_yaw, true)
    end

    local is_dynamic = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 4 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 5)
    indicators.shadow_text(is_dynamic and "DYNAMIC" or "DEFAULT", Vector2.new(x + offset_x, y + 13), is_dynamic and Color.new(0.8, 0.5, 0.9, alpha) or Color.new(1.0, 0.0, 0.0, alpha), 12, fonts.ideal_yaw, true)

    local offset = 26
    for _, var in pairs(elements) do
        local alpha = animation.new("ideal_"..var.name.."", (var.check and should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
        if var.check then
            indicators.shadow_text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(var.color.r, var.color.g, var.color.b, alpha), 12, fonts.ideal_yaw, true)
        end
        offset = offset + 13 * alpha
    end
end

hitlogs.hitboxes = { [0] = "neck", [1] = "head", [2] = "pelvis", [3] = "stomach", [4] = "lower chest", [5] = "chest", [6] = "upper chest", [7] = "right thigh", [8] = "left thigh", [9] = "right calf", [10] = "left calf", [11] = "right foot", [12] = "left foot", [13] = "right hand", [14] = "left hand", [15] = "right upper arm", [16] = "right forearm", [17] = "left upper arm", [18] = "left forear" }
hitlogs.reasons = { [0] = "hit",[1] = "resolver", [2] = "spread", [3] = "occlusion",  [4] = "prediction error" }
hitlogs.colors = { [0] = ui["visuals"].hit_color:GetColor(), [1] = ui["visuals"].resolver_color:GetColor(), [2] = ui["visuals"].spread_color:GetColor(), [3] = ui["visuals"].occlusion_color:GetColor(), [4] = ui["visuals"].prediction_color:GetColor() }

hitlogs.data = {}
hitlogs.store_data = function(shot)
    local target = EntityList.GetPlayer(shot.target_index)
    local health = target:GetProp("m_iHealth")

    table.insert(hitlogs.data, {
        reason = shot.reason,
        name = target:GetName(),
        hitchance = shot.hitchance,
        backtrack = shot.backtrack,
        hitgroup = shot.hitgroup,
        wanted_hitgroup = shot.wanted_hitgroup,
        hitchance = shot.hitchance,
        damage = shot.damage,
        wanted_damage = shot.wanted_damage,
        health_remaining = health - shot.damage < 0 and 0 or health - shot.damage,
        hit_time = GlobalVars.curtime,
        color = hitlogs.colors[shot.reason],
        alpha = 0.0
    })
end

hitlogs.on_round_start = function(event)
    if event:GetName() == "round_start" then
        hitlogs.data = {}
    end
end

hitlogs.reset_data = function()
    local player = EntityList.GetLocalPlayer()
    if player == nil then
        hitlogs.data = {}
    end
end

ffi.cdef([[
    typedef struct {
        uint8_t r;
        uint8_t g;
        uint8_t b;
        uint8_t a;
    } color_struct;

    typedef void (__cdecl* console_color_print)(void*,const color_struct&, const char*, ...);
]])

ffi_handler.color_print_fn = ffi.cast("console_color_print", ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007"))[0][25])
ffi_handler.color_print = function(text, color, event)
    local color_s = ffi.new("color_struct")
    color_s.r = color.r * 255; color_s.g = color.g * 255; color_s.b = color.b * 255; color_s.a = color.a * 255
    ffi_handler.color_print_fn(ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007")), color_s, text)
end

hitlogs.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local x = screen.x; local y = screen.y
    local under_y_offset = 20
    local screen_y_offset = 0
    for i, var in pairs(hitlogs.data) do

        var.alpha = animation.lerp(var.alpha, ((GlobalVars.curtime - var.hit_time > 5)) and 0.0 or 1.0, ui["visuals"].animation_speed:Get())

        local under_text = string.format("Hurt %s's %s for %d (%d remaining)", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining)

        if var.reason ~= 0 then
            under_text = string.format("Missed shot to %s`s %s due to %s", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason])
        end

        if ui["visuals"].hitlogs:Get(1) then
            indicators.shadow_text(under_text, Vector2.new(x /2, y /2 + 200 + under_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, true)
        end

        local screen_text = string.format("Hurt %s's %s for %d (%d remaining) [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining, var.backtrack, var.hitchance)
        if var.wanted_damage ~= var.damage then
            screen_text = screen_text..string.format(" [missmatch damage: %d]", var.wanted_damage)
        elseif var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[var.wanted_hitgroup])
        elseif var.wanted_damage ~= var.damage and var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch damage: %d; hitbox: %s]", var.wanted_damage, hitlogs.hitboxes[var.wanted_hitgroup])
        end

        if var.reason ~= 0 then
            screen_text = string.format("Missed shot to %s`s %s due to %s [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason], var.backtrack, var.hitchance)
        end

        if ui["visuals"].hitlogs:Get(2) then
            indicators.shadow_text("[umbrella] ", Vector2.new(10, 5 + screen_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, false)
            indicators.shadow_text(screen_text, Vector2.new(10 + Render.CalcTextSize("[umbrella] ", 12, fonts.ideal_yaw).x, 5 + screen_y_offset), Color.new(1.0,1.0,1.0, var.alpha), 12, fonts.ideal_yaw, false)
        end

        if var.alpha == 0.0 or #hitlogs.data > ui["visuals"].hitlogs_count:Get() then
            table.remove(hitlogs.data, i)
        end
        under_y_offset = under_y_offset + 15 * var.alpha
        screen_y_offset = screen_y_offset + 15 * var.alpha
    end
end

hitlogs.console = function(shot)
    local should_work = ui["visuals"].global_switch:Get() and ui["visuals"].hitlogs:Get(3)
    if not should_work then return end

    local remaining = EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage < 0 and 0 or EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage
    local text = string.format("Hurt %s`s %s for %d (%d remaining) [bt = %d; hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.damage, remaining, shot.backtrack, shot.hitchance)
    if shot.wanted_damage ~= shot.damage then
        text = text..string.format(" [missmatch damage: %d]", shot.wanted_damage)
    elseif shot.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[shot.wanted_hitgroup])
    elseif shot.wanted_damage ~= shot.damage and var.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch damage: %d; hitbox: %s]", shot.wanted_damage, hitlogs.hitboxes[shot.wanted_hitgroup])
    end

    if shot.reason ~= 0 then
        text = string.format("Missed %s's %s for %d due to %s [bt = %d, hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.wanted_damage, hitlogs.reasons[shot.reason], shot.backtrack, shot.hitchance)
    end
   
    local colors = {
        [0] = ui["visuals"].hit_color:GetColor(),
        [1] = ui["visuals"].resolver_color:GetColor(),
        [2] = ui["visuals"].spread_color:GetColor(),
        [3] = ui["visuals"].occlusion_color:GetColor(),
        [4] = ui["visuals"].prediction_color:GetColor()
    }

    ffi_handler.color_print("[umbrella] ", colors[shot.reason])
    print(text)
end

local custom_scope_reference = Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Get()
custom_scope.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get()

    if not should_render then Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference) else Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(2) end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local is_scoped = player:GetProp("m_bIsScoped")

    local x = screen.x /2; local y = screen.y /2
    local menu_color = ui["visuals"].custom_scope:GetColor()
    local alpha = animation.new("custom_scope_alpha", (is_scoped and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = Color.new(menu_color.r, menu_color.g, menu_color.b, menu_color.a * alpha)

    local length = ui["visuals"].custom_scope_length:Get()
    local offset = ui["visuals"].custom_scope_offset:Get()
    Render.GradientBoxFilled(Vector2.new(x, y - offset), Vector2.new(x + 1, (y - offset) - length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x + offset, y), Vector2.new((x + offset) + length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x, y + offset), Vector2.new(x + 1, (y + offset) + length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x - offset, y), Vector2.new((x - offset) - length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
end


custom_scope.viewmodel_in_scope = function()
    local fov_cs_debug = CVar.FindVar("fov_cs_debug")
    fov_cs_debug:SetInt((ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get() and ui["visuals"].custom_scope_settings:Get(1)) and 90 or 0)
end

custom_scope.destroy = function()
    Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference)
end

snaplines.normalize_yaw = function(yaw) while yaw > 180 do yaw = yaw - 360 end while yaw < -180 do yaw = yaw + 360 end return yaw end
snaplines.nearest_to_crosshair = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 1
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local eyepos = lPlayer:GetEyePosition()
    local viewangles = EngineClient.GetViewAngles()
    local bestenemy = nil
    local fov = 180
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local pos = player:GetProp('m_vecOrigin')
            local cur_fov = math.abs(snaplines.normalize_yaw(math.deg(math.atan2(eyepos.y - pos.y, eyepos.x - pos.x)) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = player
            end
        end
    end

    if bestenemy == nil then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(EntityList.GetLocalPlayer():GetHitboxCenter(4))
    end
    local position = Render.WorldToScreen(bestenemy:GetProp("m_vecOrigin"))
    local color = ui["visuals"].snaplines:GetColor()
    Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
end


snaplines.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 0
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(lPlayer:GetHitboxCenter(4))
    end

    local color = ui["visuals"].snaplines:GetColor()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local position = Render.WorldToScreen(player:GetProp("m_vecOrigin"))
            Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
        end
    end
end

ui["misc"] = {
    global_switch = Menu.Switch("Misc", "Global", "Global switch", false),
    disable_thirdperson_anim = Menu.Switch("Misc", 'Global', "Disable thirdperson anim", false),
    hitsound = Menu.Switch("Misc", "Global", "Custom hitsound", false),
    hitsound_volume = Menu.SliderInt("Misc", "Global", "Volume", 50, 0, 100),
    trashtalk = Menu.Switch("Misc", "Bullying", "Trashtalk", false),
    trashtalk_language = Menu.Combo("Misc", "Bullying", "Trashtalk language", {"Russian", "English"}, 1)
}

ui["misc"].global_controller = function()
    local global_switch = ui["misc"].global_switch:Get()
    ui["misc"].hitsound:SetVisible(global_switch)
    ui["misc"].hitsound_volume:SetVisible(global_switch and ui["misc"].hitsound:Get())

    ui["misc"].disable_thirdperson_anim:SetVisible(global_switch)

    ui["misc"].trashtalk:SetVisible(global_switch)
    ui["misc"].trashtalk_language:SetVisible(global_switch and ui["misc"].trashtalk:Get())
end

disable_thirdperson_anim.apply = function()
    if not ui["misc"].global_switch:Get() or not ui["misc"].disable_thirdperson_anim:Get() then return end

    Cheat.SetThirdPersonAnim(false)
end

ffi_handler.sound_client = ffi.cast("uintptr_t**", Utils.CreateInterface("engine.dll", "IEngineSoundClient003"))
ffi_handler.play_sound = ffi_handler.selfcall(ffi.cast("void*(__thiscall*)(void*, const char*, float, int, int, float)", ffi_handler.sound_client[0][12]), ffi_handler.engine_sound_client)
local hitsound_reference = Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Get()
hitsound.apply = function(event)
    if event:GetName() ~= "player_hurt" then return end

    if not ui["misc"].hitsound:Get() or not ui["misc"].global_switch:Get() then return end
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(false)

    local victim =  event:GetInt("userid", -1337)
    local attacker = event:GetInt("attacker", -1337)
    if (victim == -1337 or attacker == -1337) or victim == attacker then return end

    attacker = EntityList.GetPlayerForUserID(attacker)
    if attacker == nil or attacker ~= EntityList.GetLocalPlayer() then return end

    local volume = ui["misc"].hitsound_volume:Get()
    ffi_handler.play_sound("buttons/arena_switch_press_02.wav", volume / 100, 100, 0, 0)
end

hitsound.destroy = function()
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(hitsound_reference)
end

--Пиздец, магистр, мне по-настоящему страшно с тобой общаться, ты ненормальный
trashtalk.russian_phrases = {
    "ебанный тапочек чё делаешь", "лоляка ну ты упал башмак", "пипец ты сандалина тупая","я хуею ты крендель", "ты чо упал казёл",
    "хахахаха попущ изи", "ЕБАТЬ ТЫ СВАЛИЛСЯ", "Я ХУЕЮ ТЫ ПЕДИК", "маму ебал кек", "нихуя ты слабак",
    "пипец ты рухнул как СССР", "я твой дед взрывал", "сдох как твоя бабка в 43", "чо сдох хохол",
    "на нахуй ракету по черевякалке", "хуяк пулю в печень", "на сука в пиздак", "ХАХАХАХАХ ЕБАТЬ ВПЕНИЛ ТАПКОМ ПО ШАПКЕ",
    "ХАХАХАХАХА КАК ЖЕ ЛЕГКО БЫЛО ДЛЯ UMBRELLA.lua", "НА СУЧЕНЫШ ПУЛЮ", "ЛУЧШАЯ ЛУА ДЛЯ НЕВЕРЛУЗА UMBRELLA.lua", "ЛОВИ ГРАНАТУ УКРОНАЦИСТ",
    "EZ FOR UMBRELLA.lua", "ХУЯК ПО ПИЗДОПРОЁБИНЕ", "ЛОВИ МАСЛИНУ УЕБАН ССАНЫЙ АХАХХАХА", "хахахаха ну ты пиздец семью позоришь",
    "бать ты мусорила чё творишь ваще", "ХАХХАХАХАХА КУПИ ГАЙДЫ КАК ИГРАТЬ", "ЕБАТЬ ТЫ ИЗИЧНЫЙ КУПИ UMBRELLA.lua", "хахах куколд ссаный чё всосал",
    "на хуяку под горло", "ахахаах купи лучше луашку для нла UMBRELLA.lua", "чувак что ты вытворяешь убогий купи скриптик на нл UMBRELLA.lua",
    "на те сучара фашистская", "лови тапыча ублюдошный", "АРФЫВОЛОРАФАВРФОА КРИПЯРА ЕБАННАЯ", "БОЖЕ ПРОСТО СФАРМИЛ ЛОШКА", "ЕБАТЬ ТЫ ВСОСАЛ МОЙ ХУЕЦ",
    "какой же ты убогий парень мусор", "бу нахуй шакал", "на по харе ублюдошный утырок", "НА ТЕ МРАЗЬ ЗА ВСЮ БОЛЬ", "ИЗИ ШАЛАШОВКА ССАНАЯ",
    "ИЗИ ПИДОРАСИНКА", "ИДИ ГЕРЫЧА ЕБНИ ЛУЧШЕ ПИДОРАС", "НА СУЧАРА ВЫГУ ВЫГУ СДЕЛАЛ ТЕБЕ", "АВХАВХАВХАВХ ПСИНА НА ЦЕПИ ЗАДОХНУЛСЯ",
    "ЕБАТЬ ТЫ ПОМЕР КАК ТВОЙ ДЕД В 45", "АЛКАШ ИЗИЧКА ПРОСТО ХАХАХ", "аввахавхав говноедик ебанный", "оправдайся в носик шалава", "просто на нахуй в черемякалку",
    "лови пулю в черемушку", "всоси мой автомат лошара", "апхаххаха как ебать ты сосешь у UMBRELLA,js", "чел не позорься купи луашку для нла UMBRELLA.lua", "лошпедик на нахуй ору ботик",
    "кек слабак сдох", "вшатал нефору жи есть", "лови маслину", "изи вацок бля иууу", "порешал барашка бля", "изи трахнул овечку", "боже ахахахах лошпеда слабая", "чееееел позор",
    "слабак изи кек лол орбидол", "хахахаха смешнявку словил с тя", "ХАХАХХАХА собачка с цепи слетела", "ОРУ БЛЯ ХАЧ СДОХ", "изи обоссыш", "хуесос иди в геншин поиграй", "ору трапика трахнул",
    "пиздюк словил хачапури по ебалу", "шалава в хуй мне подуй", "на изях ублюдок", "возьми в ротик мой большой", "ору шлюх конченный изизизи", "ЕБАННЫЙ БЕЗУМЕЦ ТЫ ДУМАЛ УБЬЕШЬ ЧТОЛЬ",
    "НАПОЛУВЯЛЫМ ПО ЕБАЛУ ЧУРБАН ССАНЫЙ", "ОРУ ХОХЛУША ССАНАЯ СОСИ МОЙ ЧИКИБАМБОНИ", "какая ситуация с юидом балбес)0))0)", "крендель поломанный ору", "ебать ты как москвич разволился",
    "найс юид мать свою шлюху убей иди", "овней бай артур рататуйкин228"
}

trashtalk.english_phrases = {
    "My 80-year-old grandmother plays better than you", "I may be fat but you are ugly and I can diet", "Wow I thought the average iq was above money's. It seems that I was wrong...",
    "Yo momma's so fat, the probability of her being in an arbitrary point in a room is 1.", "I used to fuck guys like you in prison", "You suck more than a suck machine set on 'suck a lot'",
    "You suck more than a hooker at a vacuum cleaner convention", "Man, you're like school on Sunday. No Class...", "Man, you're like school on a Sunday. You're fucking gay...",
    "i'll fuck you 'til you love me, faggot'", "You should go to paypal, report a problem and demand a refund of your shit paste", "Unfortunately I didn't choose the talent that makes me play better",
    "You miss more shots than a fucking Stormtrooper", "Do you mind leaving the game? I would rather play with the AI...", "Don't be coming up in my kitchen with your weaksauce",
    "If I wanted to commit suicide, I'd jump from your ego to your kd", "Guys, if we want to win this, stop writing fucking Klingon, can't understand shit.",
    "You dropped that bomb just like your mom dropped you on your head as a kid.", "Sorry, I don't speak star wars.", "Don't be upsetti, have some spaghetti",
    "If CS:GO is too hard for you maybe consider a game that requires less skill, like idk.... solitaire?", "It's time for a mapchange, isn't it ?",
    "Protip: Using a mouse is recommended.", "You guys were ecoing as well?", "Even Noah can't carry these animals...", "Yo mama so fat when she plays Overpass, you can shoot her on Mirage.",
    "Was that your spray on the wall or are you just happy to see me?", "Your mom is so fat when she boosts she teamkills", "If you would chew your food you wouldn't be choking so hard.",
    "Mad cuz bad", "Hey mate, what controller are you using?", "Did you know that csgo is free to uninstall?", "You're about as useful as pedals on a wheelchair.",
    "You shoot like an AI designed by a 10 year old", "Shut up, I fucked your dad.", "With aim like that, I pity whoever has to clean the floor around your toilet.",
    "We may have lost the game, but at the end of the day we, unlike you, are not Russians", "Atleast hitler knew when to kill himself.", "Atleast hitler knew when to kill himself.",
    "You must be fat because you have a nice voice, and the air needs enough space in your lungs to articulate the sound right.", "Can't hear you from the bottom of the scoreboard.",
    "now ᴘʟᴀʏɪɴɢ: Who asked (Feat: Nobody did)", "Your family must have a motto of Incest is Wincest for you to be that retarded.",
    "If this guy was the shooter harambe would still be alive."
}
--Артур рататуйкин)))00))0)
--Бесплатная трава за сабку неверлуза только у dermagister

trashtalk.apply = function(event)
    if event:GetName() ~= "player_death" then return end

    if not ui["misc"].global_switch:Get() or not ui["misc"].trashtalk:Get() then return end
   
    local player = EntityList.GetLocalPlayer()
    local victim = EntityList.GetPlayerForUserID(event:GetInt("userid"))
    local attacker = EntityList.GetPlayerForUserID(event:GetInt("attacker"))

    if victim == attacker or attacker ~= player then return end
    local phrases = trashtalk.english_phrases
    if ui["misc"].trashtalk_language:Get() == 0 then phrases = trashtalk.russian_phrases end

    EngineClient.ExecuteClientCmd('say "'..phrases[Utils.RandomInt(1, #phrases)]..'"')
end

ui["antiaim"].default_config:RegisterCallback(function()
    ui["antiaim"].global_switch:Set(true); ui["antiaim"].antiaim_type:Set(1); ui["antiaim"].manual_yawbase:Set(0)
    for i = 1, 2 do ui["antiaim"].tweaks:Set(i, true) end

    local types = {"Global", "Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"switch", "pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "modifier_degree", "left_limit", "right_limit", "lby_mode", "desync_freestanding", "desync_on_shot"}
    local config = { globals = {true, 1, 4, 0, 0, 0, 0, 60, 60, 0, 0, 0}, standing = {true, 1, 4, -12, 20, 1, 28, 60, 60, 0, 0, 2}, walking = {true, 1, 4, -18, 18, 1, 54, 59, 48, 1, 0, 2}, slowwalk = {true, 1, 4, -14, 14, 1, 44, 59, 59, 0, 0, 1}, duck = {true, 1, 4, -12, 14, 1, 35, 60, 60, 1, 0, 2},
    jump = {true, 1, 4, -5, 0, 2, 60, 60, 60, 0, 0, 2}, air_c = {true, 1, 4 -5, 0,  2, 60, 60, 60, 0, 0, 2} }

    for i, element in pairs(elements) do ui["antiaim"].conditional["Stand"][element]:Set(config.standing[i]); ui["antiaim"].conditional["Walk"][element]:Set(config.walking[i]); ui["antiaim"].conditional["Slow-walk"][element]:Set(config.slowwalk[i]);
        ui["antiaim"].conditional["Crouch"][element]:Set(config.duck[i]); ui["antiaim"].conditional["Air"][element]:Set(config.jump[i]); ui["antiaim"].conditional["Air-C"][element]:Set(config.jump[i]) end
   
    for _, el in pairs(types) do ui["antiaim"].conditional[el]["fake_options"]:Set(2, true) end
end)

Cheat.RegisterCallback("events", function(event)
    hitlogs.on_round_start(event)
    hitsound.apply(event)
    trashtalk.apply(event)
end)

Cheat.RegisterCallback("registered_shot", function(shot)
    hitlogs.store_data(shot)
    hitlogs.console(shot)
end)

Cheat.RegisterCallback("draw", function()
    ui["ragebot"].global_controller()
    conditional_antiaim.ui_controller()
    ui["antiaim"].global_controller()
    antiaim_tweaks.disable_fakelag_with_hs()
    ui["visuals"].global_controller()
    menu_background.apply()
    widgets.watermark()
    widgets.fake()
    widgets.fakelag()
    widgets.keybinds()
    widgets.spectators()
    indicators.umbrella()
    indicators.ideal_yaw()
    hitlogs.apply()
    hitlogs.reset_data()
    custom_scope.apply()
    custom_scope.viewmodel_in_scope()
    snaplines.nearest_to_crosshair()
    snaplines.apply()
    ui["misc"].global_controller()
    disable_thirdperson_anim.apply()
end)


Cheat.RegisterCallback("pre_prediction", function(cmd)
    conditional_antiaim.apply_condition(cmd)
end)

Cheat.RegisterCallback("prediction", function(cmd)
    ragebot_improvements.baim_if_lethal()
    ragebot_improvements.doubletap_tickbase()
    conditional_hitchance.noscope()
    conditional_hitchance.air()
    discharge.apply()
end)

Cheat.RegisterCallback("createmove", function(cmd)
    antiaim_tweaks.disable_on_warmup()
end)

Cheat.RegisterCallback("destroy", function()
    conditional_antiaim.destroy()
    custom_scope.destroy()
    hitsound.destroy()
end)
ahahajha
 
Начинающий
Статус
Оффлайн
Регистрация
16 Июн 2022
Сообщения
6
Реакции[?]
1
Поинты[?]
0
Ну кароч хуйню напастил да
(Premium ru trashtalk phrases by magi1337)

code_language.lua:
local buttons_list = { IN_ATTACK = bit.lshift(1, 0), IN_JUMP = bit.lshift(1, 1), IN_DUCK = bit.lshift(1, 2), IN_FORWARD = bit.lshift(1, 3), IN_BACK = bit.lshift(1, 4), IN_USE = bit.lshift(1, 5), IN_CANCEL = bit.lshift(1, 6), IN_LEFT = bit.lshift(1, 7), IN_RIGHT = bit.lshift(1, 8), IN_MOVELEFT = bit.lshift(1, 9), IN_MOVERIGHT = bit.lshift(1, 10), IN_ATTACK2 = bit.lshift(1, 11),IN_RUN = bit.lshift(1, 12), IN_RELOAD = bit.lshift(1, 13), IN_ALT1 = bit.lshift(1, 14), IN_ALT2 = bit.lshift(1, 15), IN_SCORE = bit.lshift(1, 16), IN_SPEED = bit.lshift(1, 17), IN_WALK = bit.lshift(1, 18), IN_ZOOM = bit.lshift(1, 19), IN_WEAPON1 = bit.lshift(1, 20), IN_WEAPON2 = bit.lshift(1, 21), IN_BULLRUSH = bit.lshift(1, 22) }
local flags_list = { FL_ONGROUND = bit.lshift(1, 0), FL_DUCKING = bit.lshift(1, 1), FL_WATERJUMP = bit.lshift(1, 3), FL_ONTRAIN = bit.lshift(1, 4), FL_INRAIN = bit.lshift(1, 5), FL_FROZEN = bit.lshift(1, 6), FL_ATCONTROLS = bit.lshift(1, 7), FL_CLIENT = bit.lshift(1, 8), FL_FAKECLIENT = bit.lshift(1, 9), FL_INWATER = bit.lshift(1, 10) }
local screen = {
    x = EngineClient.GetScreenSize().x,
    y = EngineClient.GetScreenSize().y
}

local animation = {data={}}
local ffi_handler = {}
local ui = {}
local references = {}
local conditional_hitchance = {}
local discharge = {}
local ragebot_improvements = {}
local conditional_antiaim = {}
local antiaim_tweaks = {}
local animation_breaker = {
    offsets = {
        m_pStudioHdr = 0x2950,
        animstate = 0x9960,
        on_landing = 0x109
    }
}
local antibackstab = {}
local menu_background = {}
local fonts = {
    smallest_pixel = Render.InitFont("nl\\umbrella\\smallest_pixel-7.ttf", 10),
    widgets = Render.InitFont("Verdana", 12, {"r"}),
    widget_text = Render.InitFont("Verdana", 11, {"r"}),
    ideal_yaw = Render.InitFont("Verdana", 12)
}
local widgets = {}
local indicators = {}
local hitlogs = {}
local custom_scope = {}
local snaplines = {}
local disable_thirdperson_anim = {}
local hitsound = {}
local trashtalk = {}
local default_config = {}

ffi_handler.selfcall = function(fn, arg)
    return function(...)
        return fn(arg, ...)
    end
end

ffi.cdef([[
    bool CreateDirectoryA(const char* lpPathName, void* lpSecurityAttributes);
    bool DeleteUrlCacheEntryA(const char* lpszUrlName);
    void* __stdcall URLDownloadToFileA(void* LPUNKNOWN, const char* LPCSTR, const char* LPCSTR2, int a, int LPBINDSTATUSCALLBACK);
]])

ffi_handler.urlmon = ffi.load "UrlMon"
ffi_handler.wininet = ffi.load "WinInet"
ffi_handler.download_file = function(url, path)
    ffi_handler.wininet.DeleteUrlCacheEntryA(url)
    ffi_handler.urlmon.URLDownloadToFileA(nil, url, path, 0, 0)
end

ffi.C.CreateDirectoryA("nl\\umbrella", nil)
ffi_handler.download_file("https://cdn.discordapp.com/attachments/947882111312998400/980079332934418502/smallest_pixel-7.ttf", "nl\\umbrella\\smallest_pixel-7.ttf")

ui["globals"] = {
    info = Menu.Text("Globals", "Global", "Umbrella.lua\nLast update: 30.05.22"),
    button = Menu.Button("Globals", "Global", "Join discord server", "Open discord server invite link in browser", function()
    end),
    get_role = Menu.Text("Globals", "Global", "How to get role:\n1. Create ticket in discord server\n2. Send a screenshot with script on neverlose forum\n3. Wait for accept"),

    neverlose_cfg = Menu.Button("Globals", "Additional things", "Neverlose CFG", "Neverlose CFG", function()
    end)
}

conditional_antiaim.create_settings = function(name)
    return {  
        ["switch"] = name == "Global" and true or Menu.Switch("AntiAim", "Conditional", ""..name.." switch", false),
        ["pitch"] = Menu.Combo("AntiAim", "Conditional", "Pitch", {"Disabled", "Down", "Fake down", "Fake up"}, 1),
        ["yaw_base"] = Menu.Combo("AntiAim", "Conditional", "Yaw Base", {"Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 4),
        ["yaw_add_left"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Left", 0, -180, 180),
        ["yaw_add_right"] = Menu.SliderInt("AntiAim", "Conditional", "Yaw add Right", 0, -180, 180),
        ["yaw_modifier"] = Menu.Combo("AntiAim", "Conditional", "Yaw modifier", {"Disabled", "Center", "Offset", "Random"}, 0),
        ["modifier_degree"] = Menu.SliderInt("AntiAim", "Conditional", "Modifier degree", 0, -180, 180),
        ["gap"] = Menu.Text("AntiAim", "Conditional", ""),
        ["left_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Left limit", 60, 0, 60),
        ["right_limit"] = Menu.SliderInt("AntiAim", "Conditional", "Right limit", 60, 0, 60),
        ["fake_options"] = Menu.MultiCombo("AntiAim", "Conditional", "Fake options", {"Avoid overlap", "Jitter", "Randomize jitter", "Anti bruteforce"}, 0),
        ["lby_mode"] = Menu.Combo("AntiAim", "Conditional", "LBY mode", {"Disabled", "Opposite", "Sway"}, 0),
        ["desync_freestanding"] = Menu.Combo("AntiAim", "Conditional", "Freestanding", {"Off", "Peek Fake", "Peek Real"}, 0),
        ["desync_on_shot"] = Menu.Combo("AntiAim", "Conditional", "Desync on shot", {"Disabled", "Opposite", "Freestanding", "Switch"}, 0)
    }
end

ui["ragebot"] = {
    global_switch = Menu.Switch("Ragebot", "Global", "Global switch", false),
    conditional_hitchance = Menu.MultiCombo("Ragebot", "Global", "Hitchance", {"Noscope", "In air"}, 0),
    noscope_hitchance_value = Menu.SliderInt("Ragebot", "Global", "Noscope value", 55, 0, 100),
    in_air_hitchance_value = Menu.SliderInt("Ragebot", "Global", "In air value", 0, 0, 100),

    discharge = Menu.Switch("Ragebot", "Global", "Teleport exploit", false),
    discharge_weapons = Menu.MultiCombo("Ragebot", "Global", "Weapons", {"Pistols", "Scout", "Autosniper", "AWP", "Taser", "Knife"}, 0),

    improvements = Menu.MultiCombo("Ragebot", "Other", "Improvements", {"Doubletap speed", "Force baim if lethal"}, 0),
    doubletap_tickbase = Menu.SliderInt("Ragebot", "Other", "Tickbase", 14, 4, 16),
    scout_lethal_value = Menu.SliderInt("Ragebot", "Other", "Scout lethal value", 70, 0, 100),
}

ui["ragebot"].global_controller = function()
    local global_switch = ui["ragebot"].global_switch:Get()
    ui["ragebot"].conditional_hitchance:SetVisible(global_switch)
    ui["ragebot"].noscope_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(1))
    ui["ragebot"].in_air_hitchance_value:SetVisible(global_switch and ui["ragebot"].conditional_hitchance:Get(2))

    ui["ragebot"].discharge:SetVisible(global_switch)
    ui["ragebot"].discharge_weapons:SetVisible(global_switch and ui["ragebot"].discharge:Get())

    ui["ragebot"].improvements:SetVisible(global_switch)
    ui["ragebot"].doubletap_tickbase:SetVisible(global_switch and ui["ragebot"].improvements:Get(1))
    ui["ragebot"].scout_lethal_value:SetVisible(global_switch and ui["ragebot"].improvements:Get(2))
end

conditional_hitchance.noscope = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(1)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if me:GetProp("m_bIsScoped") then return end

    local noscope_allowed = { [261] = true, [267] = true, [233] = true, [242] = true } --Было бы неплохо заменить на что нибудь, кроме имени, но эт потом
    if not noscope_allowed[weapon:GetClassId()] then return end

    local hitchance = ui["ragebot"].noscope_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

conditional_hitchance.air = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].conditional_hitchance:Get(2)
    if not should_work then return end

    local me = EntityList.GetLocalPlayer()
    if me == nil then return end

    local weapon = me:GetActiveWeapon()
    if weapon == nil then return end

    if bit.band(me:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0 then return end

    local hitchance = ui["ragebot"].in_air_hitchance_value:Get()
    for i = 1, 64 do
        RageBot.OverrideHitchance(i, hitchance)
    end
end

discharge.apply = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].discharge:Get() and ui["ragebot"].discharge_weapons:Get() ~= 0
    if not should_work then return end

    if not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then return end

    local weapons = ui["ragebot"].discharge_weapons
    local allow_discharge = {
        --BIG BRAIN TIMEEEEEEEEEEEEEEEEEEEEEEEEEE
        [245] = weapons:Get(1), [258] = weapons:Get(1), [241] = weapons:Get(1), [46] = weapons:Get(1), [239] = weapons:Get(1), [269] = weapons:Get(1), [246] = weapons:Get(1), --pistols
        [267] = weapons:Get(2),
        [242] = weapons:Get(3), [261] = weapons:Get(3), --autosnipers
        [233] = weapons:Get(4),
        [268] = weapons:Get(5),
        [107] = weapons:Get(6)
    }

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end

    local should_discharge = allow_discharge[weapon:GetClassId()]
    if should_discharge == nil then return end

    local in_air = bit.band(lPlayer:GetProp("m_fFlags"), flags_list.FL_ONGROUND) == 0
    local chest_center = lPlayer:GetRenderOrigin()

    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= EntityList.GetLocalPlayer() and player:IsTeamMate() == false and player:IsAlive() then
            if in_air and player:IsVisible(player:GetRenderOrigin()) and should_discharge then
                Exploits.ForceTeleport()
            end
        end
    end
end

ragebot_improvements.doubletap_tickbase = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(1)
    if not should_work then return end

    local value = ui["ragebot"].doubletap_tickbase:Get()
    local maxusrcmdprocessticks = CVar.FindVar("sv_maxusrcmdprocessticks")
    maxusrcmdprocessticks:SetInt(value + 2)
    Exploits.OverrideDoubleTapSpeed(value)
end

ragebot_improvements.force_baim = function(index)
    RageBot.EnableHitbox(index, 0, false)
end

ragebot_improvements.baim_if_lethal = function()
    local should_work = ui["ragebot"].global_switch:Get() and ui["ragebot"].improvements:Get(2)
    if not should_work then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if not lPlayer then return end

    local weapon = lPlayer:GetActiveWeapon()
    if weapon == nil then return end
    if weapon:GetClassId() ~= 267 then return end

    local damage = ui["ragebot"].scout_lethal_value:Get()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player:IsTeamMate() == false and player:IsAlive() then
            local health = player:GetProp("m_iHealth")
            if health < 0 or health == nil then return end

            if health < damage then
                ragebot_improvements.force_baim(i)
            end
        end
    end
end

ui["antiaim"] = {
    global_switch = Menu.Switch("AntiAim", "Global", "Global switch", false),
    antiaim_type = Menu.Combo("AntiAim", "Global", "Anti Aim type", {"Default", "Conditional"}, 0),
    manual_yawbase = Menu.Combo("AntiAim", "Global", "Manual yaw base", {"Disabled", "Forward", "Backward", "Right", "Left", "At target", "Freestanding"}, 0),
    tweaks = Menu.MultiCombo("AntiAim", "Global", "AntiAim tweaks", {"Disable on warmup", "HS w/o fakelags"}, 0),
    default_config = Menu.Button("AntiAim", "Global", "                       Load default config                       ", "Load default antiaim config"),
    condition = Menu.Combo("AntiAim", "Conditional", "Condition", {"Global", "Standing", "Walking", "Slowwalking", "Crouch", "Jumping", "Air crouch"}, 0),
    conditional = {
        ["Global"] = conditional_antiaim.create_settings("Global"),
        ["Stand"] = conditional_antiaim.create_settings("Standing"),
        ["Walk"] = conditional_antiaim.create_settings("Walking"),
        ["Slow-walk"] = conditional_antiaim.create_settings("Slow-walking"),
        ["Crouch"] = conditional_antiaim.create_settings("Crouching"),
        ["Air"] = conditional_antiaim.create_settings("Jumping"),
        ["Air-C"] = conditional_antiaim.create_settings("Air-crouching"),
    },
}

ui["antiaim"].global_controller = function()
    local global_switch = ui["antiaim"].global_switch:Get()
    ui["antiaim"].antiaim_type:SetVisible(global_switch)
    ui["antiaim"].manual_yawbase:SetVisible(global_switch and ui["antiaim"].antiaim_type:Get() == 1)
    ui["antiaim"].tweaks:SetVisible(global_switch)
end

conditional_antiaim.ui_controller = function()
    local global_force = false
    if ui["antiaim"].antiaim_type:Get() == 1 and ui["antiaim"].global_switch:Get() then global_force = true end

    ui["antiaim"].condition:SetVisible(global_force)

    local current_condition = ui["antiaim"].condition:Get()
    local type_force = { ["Global"] = current_condition == 0, ["Stand"] = current_condition == 1, ["Walk"] = current_condition == 2, ["Slow-walk"] = current_condition == 3, ["Crouch"] = current_condition == 4, ["Air"] = current_condition == 5, ["Air-C"] = current_condition == 6, ["Use"] = current_condition == 7 }

    local types = {"Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "gap", "left_limit", "right_limit", "fake_options", "lby_mode", "desync_freestanding", "desync_on_shot"}

    --Лучше бы я это не делал, страшно пиздец
    for _, element in pairs(elements) do
        local global_modifier = false
        ui["antiaim"].conditional["Global"][element]:SetVisible(global_force and type_force["Global"])
        if ui["antiaim"].conditional["Global"]["yaw_modifier"]:Get() ~= 0 then global_modifier = true end

        ui["antiaim"].conditional["Global"]["modifier_degree"]:SetVisible(global_force and type_force["Global"] and global_modifier)

        for _, _type in pairs(types) do
            ui["antiaim"].conditional[_type]["switch"]:SetVisible(global_force and type_force[_type])
            local switcher = ui["antiaim"].conditional[_type]["switch"]:Get()
            local this_show = global_force and type_force[_type] and switcher

            ui["antiaim"].conditional[_type][element]:SetVisible(this_show)
            local this_modifier = false
            if ui["antiaim"].conditional[_type]["yaw_modifier"]:Get() ~= 0 then this_modifier = true end

            ui["antiaim"].conditional[_type]["modifier_degree"]:SetVisible(this_show and this_modifier)
        end
    end
end

conditional_antiaim.get_condition = function()
    local condition = "Global"
    local me = EntityList.GetLocalPlayer()
    if me == nil then return nil end

    local velocity = math.floor(Vector.new(me:GetProp("m_vecVelocity[0]"), me:GetProp("m_vecVelocity[1]"), 0):Length2D())
    local flags = me:GetProp("m_fFlags")

    local air = bit.band(flags, flags_list.FL_ONGROUND) == 0
    local crouch = bit.band(flags, flags_list.FL_DUCKING) ~= 0

    if velocity <= 2 then condition = "Stand" end
    if velocity > 1 and (not air or not crouch) then condition = "Walk" end
    if Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Slow Walk"):Get() and not (air or crouch) then condition = "Slow-walk" end
    if crouch and not (air) then condition = "Crouch" end
    if air then condition = "Air" end
    if air and crouch then condition = "Air-C" end
   
    return condition
end

conditional_antiaim.references = {
    pitch =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Get(),
    yaw_base = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get(),
    yaw_add = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Get(),
    yaw_modifier =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Get(),
    modifier_degree =  Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Get(),
    fake_options = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Get(),
    lby_mode = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Get(),
    freestanding_desync = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Get(),
    desync_on_shot = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Get()
}
conditional_antiaim.apply_condition = function(cmd)
    if ui["antiaim"].global_switch:Get() == false then return end
    if ui["antiaim"].antiaim_type:Get() == 0 then return end

    local condition = conditional_antiaim.get_condition()
    local settings = ui["antiaim"].conditional[condition]
    if settings["switch"]:Get() == false then settings = ui["antiaim"].conditional["Global"] end

    --Overriding pitch
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(settings["pitch"]:Get())

    --Overriding yaw base
    local manual_yaw_base = ui["antiaim"].manual_yawbase:Get()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(manual_yaw_base == 0 and settings["yaw_base"]:Get() or manual_yaw_base - 1)
   
    --Yaw add
    local yaw_add = 0
    if AntiAim.GetInverterState() then yaw_add = settings["yaw_add_left"]:Get() else yaw_add = settings["yaw_add_right"]:Get() end
    local yaw_modifier_state = settings["yaw_modifier"]
    local yaw_modifier = 0
    if yaw_modifier_state:Get() == 1 then
        if cmd.command_number % 4 > 1 then
            yaw_modifier = -settings["modifier_degree"]:Get() /2
        else
            yaw_modifier = settings["modifier_degree"]:Get() /2
        end
    end

    AntiAim.OverrideYawOffset(yaw_add + yaw_modifier)

    --Fake limit
    local fake_limit = 0
    if AntiAim.GetInverterState() then fake_limit = settings["left_limit"]:Get() else fake_limit = settings["right_limit"]:Get() end
    AntiAim.OverrideLimit(fake_limit)

    --Fake options
    for i = 1, 4 do
        Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(i, settings["fake_options"]:Get(i))
    end
   
    --Lby mode
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(settings["lby_mode"]:Get())

    --Freestanding
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(settings["desync_freestanding"]:Get())

    --Desync on shot
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(settings["desync_on_shot"]:Get())
end

conditional_antiaim.destroy = function()
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Pitch"):Set(conditional_antiaim.references.pitch)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Set(conditional_antiaim.references.yaw_base)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add"):Set(conditional_antiaim.references.yaw_add)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier"):Set(conditional_antiaim.references.yaw_modifier)
    Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree"):Set(conditional_antiaim.references.modifier_degree)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options"):Set(conditional_antiaim.references.fake_options)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode"):Set(conditional_antiaim.references.lby_mode)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync"):Set(conditional_antiaim.references.freestanding_desync)
    Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot"):Set(conditional_antiaim.references.desync_on_shot)
end

antiaim_tweaks.disable_on_warmup = function()
    if not ui["antiaim"].global_switch:Get() then return end
    if not ui["antiaim"].tweaks:Get(1) then return end

    local gamerules = EntityList.GetGameRules()
    local warmup_period = gamerules:GetProp("m_bHasMatchStarted")

    if warmup_period == false then
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(false)
    else
        Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim"):Set(true)
    end
end

antiaim_tweaks.disable_fakelag_with_hs = function()
    local should_work = ui["antiaim"].global_switch:Get() and ui["antiaim"].tweaks:Get(2)
    if not should_work then return end

    Menu.FindVar("Aimbot", "Anti Aim", "Fake Lag", "Enable Fake Lag"):Set(not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get())
end

ui["visuals"] = {
    global_switch = Menu.Switch("Visuals", 'Global', "Global switch", false),
    menu_background = Menu.Combo("Visuals", "Global", "Menu background", {"Disabled", "Blur", "Dark"}, 0),
    enable_animation = Menu.Switch("Visuals", "Global", "Enable animations", true),
    animation_speed = Menu.SliderInt("Visuals", "Global", "Animations speed", 16, 2, 24),

    custom_scope = Menu.SwitchColor("Visuals", "World", "Custom scope", false, Color.RGBA(212, 255, 0, 255)),
    custom_scope_length = Menu.SliderInt("Visuals", "World", "Length", 50, 50, 500),
    custom_scope_offset = Menu.SliderInt("Visuals", "World", "Offset", 10, 0, 300),
    custom_scope_settings = Menu.MultiCombo("Visuals", "World", "Settings", {"Viewmodel in scope"}, 0),

    snaplines = Menu.SwitchColor("Visuals", "World", "Snaplines", false, Color.new(1.0, 1.0, 1.0, 0.5)),
    snaplines_type = Menu.Combo("Visuals", "World", "Snaplines type", {"Every enemy", "Nearest to crosshair"}, 1),

    indicators = Menu.Switch("Visuals", "UI", "Indicators", false),
    indicators_type = Menu.Combo("Visuals", "UI", "Indicators type", {"Umbrella", "Ideal yaw"}, 0),
    umbrella_elements = Menu.MultiCombo("Visuals", "UI", "Elements to show", {"Desync line", "Player state", "Doubletap", "Hide shots", "Body aim", "Minimum damage", "Fake duck"}, 0),
    umbrella_real_color = Menu.ColorEdit("Visuals", "UI", "Real color", Color.new(1.0, 1.0, 1.0, 1.0)),
    umbrella_fake_color = Menu.ColorEdit("Visuals", "UI", "Fake color", Color.RGBA(212, 255, 0, 255)),
    indicators_offset = Menu.Switch("Visuals", "UI", "Offset indicators in scope", false),

    widgets = Menu.MultiCombo("Visuals", "UI", "Widgets", {"Watermark", "DT/FL indicator", "Fake indicator", "Keybinds list", "Spectators list"}, 0),
    widgets_style = Menu.Combo("Visuals", "UI", "Widgets style", {"Default", "Rounding", "Full rounding", "Gradient line"}, 0),
    widgets_background_style = Menu.Combo("Visuals", "UI", "Background style", {"Default", "Blur"}, 0),
    widgets_background = Menu.ColorEdit("Visuals", "UI", "Widgets background color", Color.new(0.0, 0.0, 0.0, 0.8)),
    widgets_color = Menu.ColorEdit("Visuals", "UI", "Widgets color", Color.RGBA(212, 255, 0, 255)),

    hitlogs = Menu.MultiCombo("Visuals", "Hitlogs", "Hitlogs", {"Under crosshair", "On screen", "Console"}, 0),
    hitlogs_count = Menu.SliderInt("Visuals", "Hitlogs", "Max hitlogs count", 5, 3, 10),
    hit_color = Menu.ColorEdit("Visuals", "Hitlogs", "Hit color", Color.RGBA(211, 255, 66, 255)),
    resolver_color = Menu.ColorEdit("Visuals", "Hitlogs", "Resolver color", Color.RGBA(255, 94, 94, 255)),
    spread_color = Menu.ColorEdit("Visuals", "Hitlogs", "Spread color", Color.RGBA(255, 180, 94, 255)),
    occlusion_color = Menu.ColorEdit("Visuals", "Hitlogs", "Occlusion color", Color.RGBA(94, 169, 255, 255)),
    prediction_color = Menu.ColorEdit("Visuals", "Hitlogs", "Prediction error color", Color.RGBA(255, 94, 94, 255)),

    utils = {
        keybinds_x = Menu.SliderInt("Visuals", "Utils", "Keybinds x", 100, 0, screen.x),
        keybinds_y = Menu.SliderInt("Visuals", "Utils", "Keybinds y", 100, 0, screen.y),
        spectators_x = Menu.SliderInt("Visuals", "Utils", "Spectators x", 300, 0, screen.x),
        spectators_y = Menu.SliderInt("Visuals", "Utils", "Spectators y", 300, 0, screen.y)
    }
}

ui["visuals"].global_controller = function()
    local global_switch = ui["visuals"].global_switch:Get()
    ui["visuals"].menu_background:SetVisible(global_switch)
    ui["visuals"].enable_animation:SetVisible(global_switch)
    ui["visuals"].animation_speed:SetVisible(global_switch and ui["visuals"].enable_animation:Get())

    ui["visuals"].custom_scope:SetVisible(global_switch)
    local custom_scope = ui["visuals"].custom_scope:Get()
    ui["visuals"].custom_scope_offset:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_length:SetVisible(custom_scope and global_switch)
    ui["visuals"].custom_scope_settings:SetVisible(custom_scope and global_switch)

    ui["visuals"].snaplines:SetVisible(global_switch)
    ui["visuals"].snaplines_type:SetVisible(global_switch and ui["visuals"].snaplines:Get())

    ui["visuals"].indicators:SetVisible(global_switch)
    local indicators = ui["visuals"].indicators:Get()
    ui["visuals"].indicators_type:SetVisible(global_switch and indicators)
    ui["visuals"].umbrella_elements:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_real_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].umbrella_fake_color:SetVisible(global_switch and ui["visuals"].indicators_type:Get() == 0 and indicators)
    ui["visuals"].indicators_offset:SetVisible(global_switch and indicators)

    ui["visuals"].hitlogs:SetVisible(global_switch)
    local hitlogs = ui["visuals"].hitlogs
    ui["visuals"].hitlogs_count:SetVisible(global_switch and hitlogs:Get(1) or hitlogs:Get(2))
    ui["visuals"].hit_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].resolver_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].spread_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].occlusion_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)
    ui["visuals"].prediction_color:SetVisible(hitlogs:Get() ~= 0 and global_switch)

    ui["visuals"].widgets:SetVisible(global_switch)
    local widgets = ui["visuals"].widgets:Get()
    ui["visuals"].widgets_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_background_style:SetVisible(widgets ~= 0 and global_switch)
    ui["visuals"].widgets_color:SetVisible(widgets ~= 0 and global_switch)

    ui["visuals"].utils.keybinds_x:SetVisible(false)
    ui["visuals"].utils.keybinds_y:SetVisible(false)
    ui["visuals"].utils.spectators_x:SetVisible(false)
    ui["visuals"].utils.spectators_y:SetVisible(false)
end

local animation = {data = {}}
animation.lerp = function(s, e, t) --prince1337
    if type(s) == 'userdata' then
        local color_data = {0, 0, 0, 0}

        for i, color_key in ipairs({'r', 'g', 'b', 'a'}) do
            color_data[i] = animation.lerp(s[color_key], e[color_key], t)
        end

        return Color.new(unpack(color_data))
    end

    return s + (e - s) * GlobalVars.frametime * t
end

animation.new = function(name, value, time)
    if animation.data[name] == nil then
        animation.data[name] = value
    end

    animation.data[name] = animation.lerp(animation.data[name], value, time)

    return ui["visuals"].enable_animation:Get() and animation.data[name] or value
end

menu_background.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local alpha = animation.new("menu_blur_alpha", Cheat.IsMenuVisible() and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
   
    if alpha ~= 0.0 then
        if ui["visuals"].menu_background:Get() == 1 then
            Render.Blur(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(1.0, 1.0, 1.0, alpha))
        end

        if ui["visuals"].menu_background:Get() == 2 then
            Render.BoxFilled(Vector2.new(0, 0), Vector2.new(screen.x, screen.y), Color.new(0.0, 0.0, 0.0, alpha - 0.5))
        end
    end
end

widgets.create_interface = function(x, y, w, h, color, outline, style)
    local is_metamod = style == 0
    local func = Render.BoxFilled
    if ui["visuals"].widgets_background_style:Get() == 1 then func = Render.Blur end

    func(Vector2.new(x , y), Vector2.new(x + w, y + h), color, is_metamod and 0 or 2) --Background
    Render.BoxFilled(Vector2.new(is_metamod and x or x + 3, y - 1), Vector2.new(is_metamod and x + w or x + w - 3, y), outline)           --Top line
    if not is_metamod then
        Render.Circle(Vector2.new(x + 3, y + 3), 4, 10, outline, 1, -203, -85)                    -- left rounding
        Render.Circle(Vector2.new(x + w - 3, y + 3), 4, 10, outline, 1, 22, -98)
    end

    if style == 2 then
        Render.BoxFilled(Vector2.new(x - 1 , y + 4), Vector2.new(x, y + h - 3), outline)          -- left line
        Render.BoxFilled(Vector2.new(x + w, y + 4), Vector2.new(x + w + 1, y + h - 3), outline)
        Render.Circle(Vector2.new(x + 3, y + h - 3), 4, 10, outline, 1, -290, -174)               -- bot-left rounding
        Render.Circle(Vector2.new(x + w - 3, y + h - 3), 4, 10, outline, 1, 0, 103)              
        Render.BoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + w - 2, y + h), outline)   -- bot line
    else
        if style == 3 then
            Render.GradientBoxFilled(Vector2.new(x + 2, y + h + 1), Vector2.new(x + (w  / 2), y + h), Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline) -- gradient c-l
            Render.GradientBoxFilled(Vector2.new(x + (w / 2), y + h), Vector2.new(x + w - 2, y + h + 1), outline, Color.new(outline.r, outline.g, outline.b, 0.0), outline, Color.new(outline.r, outline.g, outline.b, 0.0)) --gradient c-r
        end

        if not is_metamod then
            Render.GradientBoxFilled(Vector2.new(x - 1, y + 3), Vector2.new(x, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0)) -- left line
            Render.GradientBoxFilled(Vector2.new(x + w, y + 3), Vector2.new(x + w + 1, y + h - 2), outline, outline, Color.new(outline.r, outline.g, outline.b, 0.0), Color.new(outline.r, outline.g, outline.b, 0.0))   --right line
        end
    end

end

widgets.is_howered = function(x, y, w, h)
    return (
        Cheat.GetMousePos().x > x and
        Cheat.GetMousePos().x < x + w and
        Cheat.GetMousePos().y > y and
        Cheat.GetMousePos().y < y + h
    )
end

ffi.cdef([[
    typedef uint16_t WORD;

    typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
    } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

    void GetLocalTime(LPSYSTEMTIME lpSystemTime);
]])


widgets.watermark = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(1)

    local ip = "offline"
   
    if EngineClient.GetNetChannelInfo() ~= nil then
        ip = EngineClient.GetNetChannelInfo():GetAddress() == "loopback" and "local host" or EngineClient.GetNetChannelInfo():GetAddress()
    end
    local time = ffi.new("SYSTEMTIME")
    ffi.C.GetLocalTime(time)
   
    local text = string.format("umbrella [live] | %s | %s | %02d:%02d:%02d", Cheat.GetCheatUserName(), ip, time.wHour, time.wMinute, time.wSecond)
   
    local w = Render.CalcTextSize(text, 12, fonts.widgets).x + 10; local h = 18
    local x = screen.x - w - 10; local y = 10

    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    local alpha = animation.new("watermark_alpha", should_render and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 5, y + 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Text("rella", Vector2.new(x + 5 + Render.CalcTextSize("umb", 12, fonts.widgets).x, y + 2), Color.new(color.r, color.g, color.b, alpha), 12, fonts.widgets)
    end
end

widgets.fake = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(3)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60-0.5))) --ФЫВПДЖРФЫРДОДФЫВПРФЫПРД КАК ЖЕ ЭТО СТРАШНО АААААААААААААААААААААА
    local text = string.format("FAKE: %.1f°", desync)
    local offset_y = animation.new("fake_offset_y", not ui["visuals"].widgets:Get(1) and 28 or 0, ui["visuals"].animation_speed:Get())
    local offset_x = animation.new("fake_offset_x", not ui["visuals"].widgets:Get(2) and 80 or 0, ui["visuals"].animation_speed:Get())
    local w = 72; local h = 18
    local x = screen.x - w - 105 + offset_x; local y = 38 - offset_y

    local alpha = animation.new("fake_alpha", (player:IsAlive() and player ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w + 15, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x  + 18, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.Circle(Vector2.new(x + 10, y + 9), 5.0, 0, Color.new(color.r, color.g, color.b, alpha), 2, 0, desync * 7)
    end
end

widgets.fakelag = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(2)

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local fakelag = ClientState.m_choked_commands <= 1 and 1 or ClientState.m_choked_commands
    local charge = Exploits.GetCharge()
    local state = "FL"

    local offset = animation.new("fakelag_offset", (not ui["visuals"].widgets:Get(1)) and 28 or 0, ui["visuals"].animation_speed:Get())
    local x = screen.x - 2 - 80; local y = 38 - offset
    local w = 71; h = 18

    local modifier = x + 20 + math.min(4.7 * fakelag, 48)
    if Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() then
        state = "DT"
        modifier = x + 20 + 48 * charge
    end
    local text = string.format("%s", state)

    local alpha = animation.new("fakelag_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text(text, Vector2.new(x + 2, y + 3), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets)
        Render.BoxFilled(Vector2.new(x + 20, y + (h/2) - 2), Vector2.new(modifier , y + (h/2) + 3), Color.new(color.r, color.g, color.b, alpha), 2)
    end
end

widgets.keybinds_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,

    width = 66
}
widgets.keybinds = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(4)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(1, false)
    end

    local binds = Cheat.GetBinds()
    local offset = 21
    local x = ui["visuals"].utils.keybinds_x:Get(); local y = ui["visuals"].utils.keybinds_y:Get()
    local final_width = 66
    local active = {}

    for i = 1, #binds do
        bind = binds[i]
        local bind_state = "["..bind:GetValue().."]"

        local alpha = animation.new(bind:GetName(), (bind:IsActive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

        if alpha ~= 0.0 then
            Render.Text(bind:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)
            Render.Text(bind_state, Vector2.new(x + 75 +  widgets.keybinds_settings.width - Render.CalcTextSize(bind_state, 11, fonts.widget_text).x - 10, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text, false, false)
        end

        if Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x > final_width and bind:IsActive() then
            final_width = Render.CalcTextSize(bind:GetName(), 11, fonts.widget_text).x - 5
        end

        offset = offset + 14 * alpha
        if bind:IsActive() then table.insert(active, bind) end
    end
    local alpha = animation.new("keybinds_alpha", ((Cheat.IsMenuVisible() or #active > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    widgets.keybinds_settings.width = animation.new("keybinds_width", final_width, ui["visuals"].animation_speed:Get())
    local background = ui["visuals"].widgets_background:GetColor()
    local color = ui["visuals"].widgets_color:GetColor()
    if alpha ~= 0.0 then
        widgets.create_interface(x, y, 70 + widgets.keybinds_settings.width, 18, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
        Render.Text("keybinds", Vector2.new(x + (75 + widgets.keybinds_settings.width) /2, y + 18 / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)
    end

    if not ui["visuals"].widgets:Get(4) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, 70 + widgets.keybinds_settings.width, 18) and Cheat.IsMenuVisible() then
            if not widgets.keybinds_settings.stored then
                widgets.keybinds_settings.x_off = mouse_pos.x - x
                widgets.keybinds_settings.y_off = mouse_pos.y - y
                widgets.keybinds_settings.stored = true
            end
            ui["visuals"].utils.keybinds_x:Set(mouse_pos.x - widgets.keybinds_settings.x_off)
            ui["visuals"].utils.keybinds_y:Set(mouse_pos.y - widgets.keybinds_settings.y_off)
        end
    else if widgets.keybinds_settings.stored then widgets.keybinds_settings.stored = false end
    end
end

widgets.get_spectators = function()
    local spectators = {}
    local players = EntityList.GetPlayers()
    for i, player in pairs(players) do
        if EntityList.GetPlayerFromHandle(player:GetProp("m_hObserverTarget")) == EntityList.GetLocalPlayer() and not player:IsDormant() then
            table.insert(spectators, player)
        end
    end
    return spectators
end

widgets.spectators_settings = {
    stored = false,
    x_off = 0,
    y_off = 0,
}
widgets.spectators = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].widgets:Get(5)
    if should_render then
        Menu.FindVar("Miscellaneous", "Main", "Other", "Windows"):Set(2, false)
    end

    local spectators = widgets.get_spectators()
    local offset = 21
    local x = ui["visuals"].utils.spectators_x:Get(); local y = ui["visuals"].utils.spectators_y:Get()
    local w = 132; local h = 18

    for i = 1, #spectators do
        local spectator = spectators[i]
       
        local alpha = animation.new(spectator:EntIndex(), (animation.data[spectator:EntIndex()] ~= nil and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        Render.Text(spectator:GetName(), Vector2.new(x + 5, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 11, fonts.widget_text)

        offset = offset + 14 * alpha
    end
    local alpha = animation.new("spectators_alpha", ((Cheat.IsMenuVisible() or #spectators > 0) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = ui["visuals"].widgets_color:GetColor()
    local background = ui["visuals"].widgets_background:GetColor()
    widgets.create_interface(x, y, w, h, Color.new(background.r, background.g, background.b, background.a * alpha), Color.new(color.r, color.g, color.b, alpha), ui["visuals"].widgets_style:Get())
    Render.Text("spectators", Vector2.new(x + 132 /2, y + h / 2), Color.new(1.0, 1.0, 1.0, alpha), 12, fonts.widgets, false, true)

    if not ui["visuals"].widgets:Get(5) then return end
    local mouse_pos = Cheat.GetMousePos()
    if Cheat.IsKeyDown(0x1) then
        if widgets.is_howered(x, y, w, h) and Cheat.IsMenuVisible() then
            if not widgets.spectators_settings.stored then
                widgets.spectators_settings.x_off = mouse_pos.x - x
                widgets.spectators_settings.y_off = mouse_pos.y - y
                widgets.spectators_settings.stored = true
            end
            ui["visuals"].utils.spectators_x:Set(mouse_pos.x - widgets.spectators_settings.x_off)
            ui["visuals"].utils.spectators_y:Set(mouse_pos.y - widgets.spectators_settings.y_off)
        end
    else if widgets.spectators_settings.stored then widgets.spectators_settings.stored = false end
    end
end

indicators.umbrella = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 0
    local elements = ui["visuals"].umbrella_elements

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then is_mindmg = i:IsActive() end
    end

    indicators.elements = {
        {check = should_render and elements:Get(2), name = conditional_antiaim.get_condition():upper()},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get() and elements:Get(3), name = "DT"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and elements:Get(4), name = "HS"},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Misc", "Body Aim"):Get() == 2 and elements:Get(5), name = "BAIM"},
        {check = is_mindmg and elements:Get(6), name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)},
        {check = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Fake Duck"):Get() and elements:Get(7), name = "FD"}
    }

    local x = screen.x /2; local y = screen.y /2 + 27

    local alpha = animation.new("umbrella_alpha", (player:IsAlive() and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local desync_alpha = animation.new("desync_alpha", (player:IsAlive() and elements:Get(1) and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())

    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("umbrella_offset_x", (player:IsAlive() and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, ui["visuals"].animation_speed:Get())

    local inverter = AntiAim.GetInverterState()
    local real_color = ui["visuals"].umbrella_real_color:GetColor(); local fake_color = ui["visuals"].umbrella_fake_color:GetColor()
    local umbr = animation.new("umbr", inverter and Color.new(real_color.r, real_color.g, real_color.b, alpha) or Color.new(fake_color.r, fake_color.g, fake_color.b, alpha), 10)
    local ella = animation.new("ella", inverter and Color.new(fake_color.r, fake_color.g, fake_color.b, alpha) or Color.new(real_color.r, real_color.g, real_color.b, alpha), 10)
    if alpha ~= 0.0 then
        Render.Text("umb", Vector2.new(x - Render.CalcTextSize("rella", 13).x /2 + offset_x, y), umbr, 12, fonts.widgets, true, true)
        Render.Text("rella", Vector2.new(x + Render.CalcTextSize("umb", 13).x /2 + offset_x, y), ella, 12, fonts.widgets, true, true)

        if desync_alpha ~= 0.0 then
            local desync = math.abs(math.max(-60, math.min(60, (player:GetProp("m_flPoseParameter")[12] or 0)*120-60)))
            Render.BoxFilled(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x - 20 + (desync / 1.5) + offset_x, y + 10), Color.new(fake_color.r, fake_color.g, fake_color.b, desync_alpha), 2)
            Render.Box(Vector2.new(x - 20 + offset_x, y + 6), Vector2.new(x + 20 + offset_x, y + 10), Color.new(0.0, 0.0, 0.0, desync_alpha - 0.6), 2)
        end
    end

    local offset = 10 + (5 * desync_alpha)
    for _, var in pairs(indicators.elements) do
        local alpha = animation.new("umbrella_"..var.name.."", (player:IsAlive() and should_render and var.check) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
        if var.check then
            if alpha ~= 0.0 then
                Render.Text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(1.0, 1.0, 1.0, alpha), 10, fonts.smallest_pixel, true, true)
            end
        end
        offset = offset + 8 * alpha
    end
end

indicators.shadow_text = function(text, pos, color, size, font, centered)
    Render.Text(text, Vector2.new(pos.x + 1, pos.y + 1), Color.new(0.0, 0.0, 0.0, color.a), size, font, false, centered)
    Render.Text(text, pos, color, size, font, false, centered)
end

indicators.ideal_yaw = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].indicators:Get() and ui["visuals"].indicators_type:Get() == 1
    local animation_speed = ui["visuals"].animation_speed:Get()

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local mindmg = false
    for _, i in pairs(Cheat.GetBinds()) do
        if i:GetName() == "Minimum Damage" then mindmg = i:IsActive() end
    end

    local dt_color = animation.new("dt_color", Exploits.GetCharge() == 1 and Color.new(0.0, 1.0, 0.0, 1.0) or Color.new(1.0, 0.0, 0.0, 1.0), animation_speed)
    local elements = {
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "DT", color = dt_color},
        {check = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots"):Get() and not Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):Get(), name = "AA", color = Color.new(0.8, 0.5, 0.9, 1.0)},
        {check = mindmg, name = "DMG", color = Color.new(1.0, 1.0, 1.0, 1.0)}
    }

    local x = screen.x /2; local y = screen.y /2 + 25

    local alpha = animation.new("ideal_alpha", (should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
    local is_scoped = player:GetProp("m_bIsScoped")
    local offset_x = animation.new("ideal_offset_x", (should_render and ui["visuals"].indicators_offset:Get() and is_scoped) and 50 or 0, animation_speed)

    local inverter = AntiAim.GetInverterState()
    local umbr = animation.new("UMBRELLA", inverter and Color.new(0.8, 0.5, 0.1, alpha) or Color.new(1.0, 1.0, 1.0, alpha), 10)
    local ella = animation.new("YAW", inverter and Color.new(1.0, 1.0, 1.0, alpha) or Color.new(0.8, 0.5, 0.1, alpha), 10)
    local is_manual = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 2 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 3)

    if is_manual then
        indicators.shadow_text("FAKE YAW", Vector2.new(x + offset_x, y), Color.new(0.8, 0.5, 0.1, alpha), 12, fonts.ideal_yaw, true)
    else
        indicators.shadow_text("UMBRELLA", Vector2.new(x - Render.CalcTextSize("YAW", 12, fonts.ideal_yaw).x /2 + offset_x - 1, y), umbr, 12, fonts.ideal_yaw, true)
        indicators.shadow_text("YAW", Vector2.new(x + Render.CalcTextSize("UMBRELLA", 12, fonts.ideal_yaw).x /2 + offset_x + 1, y), ella, 12, fonts.ideal_yaw, true)
    end

    local is_dynamic = (Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 4 or Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base"):Get() == 5)
    indicators.shadow_text(is_dynamic and "DYNAMIC" or "DEFAULT", Vector2.new(x + offset_x, y + 13), is_dynamic and Color.new(0.8, 0.5, 0.9, alpha) or Color.new(1.0, 0.0, 0.0, alpha), 12, fonts.ideal_yaw, true)

    local offset = 26
    for _, var in pairs(elements) do
        local alpha = animation.new("ideal_"..var.name.."", (var.check and should_render and player:IsAlive()) and 1.0 or 0.0, animation_speed)
        if var.check then
            indicators.shadow_text(var.name, Vector2.new(x + offset_x, y + offset), Color.new(var.color.r, var.color.g, var.color.b, alpha), 12, fonts.ideal_yaw, true)
        end
        offset = offset + 13 * alpha
    end
end

hitlogs.hitboxes = { [0] = "neck", [1] = "head", [2] = "pelvis", [3] = "stomach", [4] = "lower chest", [5] = "chest", [6] = "upper chest", [7] = "right thigh", [8] = "left thigh", [9] = "right calf", [10] = "left calf", [11] = "right foot", [12] = "left foot", [13] = "right hand", [14] = "left hand", [15] = "right upper arm", [16] = "right forearm", [17] = "left upper arm", [18] = "left forear" }
hitlogs.reasons = { [0] = "hit",[1] = "resolver", [2] = "spread", [3] = "occlusion",  [4] = "prediction error" }
hitlogs.colors = { [0] = ui["visuals"].hit_color:GetColor(), [1] = ui["visuals"].resolver_color:GetColor(), [2] = ui["visuals"].spread_color:GetColor(), [3] = ui["visuals"].occlusion_color:GetColor(), [4] = ui["visuals"].prediction_color:GetColor() }

hitlogs.data = {}
hitlogs.store_data = function(shot)
    local target = EntityList.GetPlayer(shot.target_index)
    local health = target:GetProp("m_iHealth")

    table.insert(hitlogs.data, {
        reason = shot.reason,
        name = target:GetName(),
        hitchance = shot.hitchance,
        backtrack = shot.backtrack,
        hitgroup = shot.hitgroup,
        wanted_hitgroup = shot.wanted_hitgroup,
        hitchance = shot.hitchance,
        damage = shot.damage,
        wanted_damage = shot.wanted_damage,
        health_remaining = health - shot.damage < 0 and 0 or health - shot.damage,
        hit_time = GlobalVars.curtime,
        color = hitlogs.colors[shot.reason],
        alpha = 0.0
    })
end

hitlogs.on_round_start = function(event)
    if event:GetName() == "round_start" then
        hitlogs.data = {}
    end
end

hitlogs.reset_data = function()
    local player = EntityList.GetLocalPlayer()
    if player == nil then
        hitlogs.data = {}
    end
end

ffi.cdef([[
    typedef struct {
        uint8_t r;
        uint8_t g;
        uint8_t b;
        uint8_t a;
    } color_struct;

    typedef void (__cdecl* console_color_print)(void*,const color_struct&, const char*, ...);
]])

ffi_handler.color_print_fn = ffi.cast("console_color_print", ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007"))[0][25])
ffi_handler.color_print = function(text, color, event)
    local color_s = ffi.new("color_struct")
    color_s.r = color.r * 255; color_s.g = color.g * 255; color_s.b = color.b * 255; color_s.a = color.a * 255
    ffi_handler.color_print_fn(ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007")), color_s, text)
end

hitlogs.apply = function()
    local should_render = ui["visuals"].global_switch:Get()
    if not should_render then return end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local x = screen.x; local y = screen.y
    local under_y_offset = 20
    local screen_y_offset = 0
    for i, var in pairs(hitlogs.data) do

        var.alpha = animation.lerp(var.alpha, ((GlobalVars.curtime - var.hit_time > 5)) and 0.0 or 1.0, ui["visuals"].animation_speed:Get())

        local under_text = string.format("Hurt %s's %s for %d (%d remaining)", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining)

        if var.reason ~= 0 then
            under_text = string.format("Missed shot to %s`s %s due to %s", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason])
        end

        if ui["visuals"].hitlogs:Get(1) then
            indicators.shadow_text(under_text, Vector2.new(x /2, y /2 + 200 + under_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, true)
        end

        local screen_text = string.format("Hurt %s's %s for %d (%d remaining) [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], var.damage, var.health_remaining, var.backtrack, var.hitchance)
        if var.wanted_damage ~= var.damage then
            screen_text = screen_text..string.format(" [missmatch damage: %d]", var.wanted_damage)
        elseif var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[var.wanted_hitgroup])
        elseif var.wanted_damage ~= var.damage and var.wanted_hitgroup ~= var.hitgroup then
            screen_text = screen_text..string.format(" [missmatch damage: %d; hitbox: %s]", var.wanted_damage, hitlogs.hitboxes[var.wanted_hitgroup])
        end

        if var.reason ~= 0 then
            screen_text = string.format("Missed shot to %s`s %s due to %s [bt = %d; hc = %d]", var.name, hitlogs.hitboxes[var.hitgroup], hitlogs.reasons[var.reason], var.backtrack, var.hitchance)
        end

        if ui["visuals"].hitlogs:Get(2) then
            indicators.shadow_text("[umbrella] ", Vector2.new(10, 5 + screen_y_offset), Color.new(var.color.r, var.color.g, var.color.b, var.alpha), 12, fonts.ideal_yaw, false)
            indicators.shadow_text(screen_text, Vector2.new(10 + Render.CalcTextSize("[umbrella] ", 12, fonts.ideal_yaw).x, 5 + screen_y_offset), Color.new(1.0,1.0,1.0, var.alpha), 12, fonts.ideal_yaw, false)
        end

        if var.alpha == 0.0 or #hitlogs.data > ui["visuals"].hitlogs_count:Get() then
            table.remove(hitlogs.data, i)
        end
        under_y_offset = under_y_offset + 15 * var.alpha
        screen_y_offset = screen_y_offset + 15 * var.alpha
    end
end

hitlogs.console = function(shot)
    local should_work = ui["visuals"].global_switch:Get() and ui["visuals"].hitlogs:Get(3)
    if not should_work then return end

    local remaining = EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage < 0 and 0 or EntityList.GetPlayer(shot.target_index):GetProp("m_iHealth") - shot.damage
    local text = string.format("Hurt %s`s %s for %d (%d remaining) [bt = %d; hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.damage, remaining, shot.backtrack, shot.hitchance)
    if shot.wanted_damage ~= shot.damage then
        text = text..string.format(" [missmatch damage: %d]", shot.wanted_damage)
    elseif shot.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch hitbox: %s]", hitlogs.hitboxes[shot.wanted_hitgroup])
    elseif shot.wanted_damage ~= shot.damage and var.wanted_hitgroup ~= shot.hitgroup then
        text = text..string.format(" [missmatch damage: %d; hitbox: %s]", shot.wanted_damage, hitlogs.hitboxes[shot.wanted_hitgroup])
    end

    if shot.reason ~= 0 then
        text = string.format("Missed %s's %s for %d due to %s [bt = %d, hc = %d]", EntityList.GetPlayer(shot.target_index):GetName(), hitlogs.hitboxes[shot.hitgroup], shot.wanted_damage, hitlogs.reasons[shot.reason], shot.backtrack, shot.hitchance)
    end
   
    local colors = {
        [0] = ui["visuals"].hit_color:GetColor(),
        [1] = ui["visuals"].resolver_color:GetColor(),
        [2] = ui["visuals"].spread_color:GetColor(),
        [3] = ui["visuals"].occlusion_color:GetColor(),
        [4] = ui["visuals"].prediction_color:GetColor()
    }

    ffi_handler.color_print("[umbrella] ", colors[shot.reason])
    print(text)
end

local custom_scope_reference = Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Get()
custom_scope.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get()

    if not should_render then Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference) else Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(2) end

    local player = EntityList.GetLocalPlayer()
    if player == nil then return end

    local is_scoped = player:GetProp("m_bIsScoped")

    local x = screen.x /2; local y = screen.y /2
    local menu_color = ui["visuals"].custom_scope:GetColor()
    local alpha = animation.new("custom_scope_alpha", (is_scoped and should_render) and 1.0 or 0.0, ui["visuals"].animation_speed:Get())
    local color = Color.new(menu_color.r, menu_color.g, menu_color.b, menu_color.a * alpha)

    local length = ui["visuals"].custom_scope_length:Get()
    local offset = ui["visuals"].custom_scope_offset:Get()
    Render.GradientBoxFilled(Vector2.new(x, y - offset), Vector2.new(x + 1, (y - offset) - length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x + offset, y), Vector2.new((x + offset) + length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x, y + offset), Vector2.new(x + 1, (y + offset) + length * alpha), color, color, Color.new(color.r, color.g, color.b, 0), Color.new(color.r, color.g, color.b, 0))
    Render.GradientBoxFilled(Vector2.new(x - offset, y), Vector2.new((x - offset) - length * alpha, y + 1), color, Color.new(color.r, color.g, color.b, 0), color, Color.new(color.r, color.g, color.b, 0))
end


custom_scope.viewmodel_in_scope = function()
    local fov_cs_debug = CVar.FindVar("fov_cs_debug")
    fov_cs_debug:SetInt((ui["visuals"].global_switch:Get() and ui["visuals"].custom_scope:Get() and ui["visuals"].custom_scope_settings:Get(1)) and 90 or 0)
end

custom_scope.destroy = function()
    Menu.FindVar("Visuals", "View", "Camera", "Remove Scope"):Set(custom_scope_reference)
end

snaplines.normalize_yaw = function(yaw) while yaw > 180 do yaw = yaw - 360 end while yaw < -180 do yaw = yaw + 360 end return yaw end
snaplines.nearest_to_crosshair = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 1
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local eyepos = lPlayer:GetEyePosition()
    local viewangles = EngineClient.GetViewAngles()
    local bestenemy = nil
    local fov = 180
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local pos = player:GetProp('m_vecOrigin')
            local cur_fov = math.abs(snaplines.normalize_yaw(math.deg(math.atan2(eyepos.y - pos.y, eyepos.x - pos.x)) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = player
            end
        end
    end

    if bestenemy == nil then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(EntityList.GetLocalPlayer():GetHitboxCenter(4))
    end
    local position = Render.WorldToScreen(bestenemy:GetProp("m_vecOrigin"))
    local color = ui["visuals"].snaplines:GetColor()
    Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
end


snaplines.apply = function()
    local should_render = ui["visuals"].global_switch:Get() and ui["visuals"].snaplines:Get() and ui["visuals"].snaplines_type:Get() == 0
    if not should_render then return end

    local lPlayer = EntityList.GetLocalPlayer()
    if lPlayer == nil or not lPlayer:IsAlive() then return end

    local start = Vector2.new(screen.x /2, screen.y)
    if Menu.FindVar("Visuals", "View", "Thirdperson", "Enable Thirdperson"):Get() then
        start = Render.WorldToScreen(lPlayer:GetHitboxCenter(4))
    end

    local color = ui["visuals"].snaplines:GetColor()
    for i = 1, 64 do
        local player = EntityList.GetPlayer(i)
        if player ~= nil and player ~= lPlayer and player:IsAlive() and not player:IsDormant() and not player:IsTeamMate() then
            local position = Render.WorldToScreen(player:GetProp("m_vecOrigin"))
            Render.Line(position, start, Color.new(color.r, color.g, color.b, color.a))
        end
    end
end

ui["misc"] = {
    global_switch = Menu.Switch("Misc", "Global", "Global switch", false),
    disable_thirdperson_anim = Menu.Switch("Misc", 'Global', "Disable thirdperson anim", false),
    hitsound = Menu.Switch("Misc", "Global", "Custom hitsound", false),
    hitsound_volume = Menu.SliderInt("Misc", "Global", "Volume", 50, 0, 100),
    trashtalk = Menu.Switch("Misc", "Bullying", "Trashtalk", false),
    trashtalk_language = Menu.Combo("Misc", "Bullying", "Trashtalk language", {"Russian", "English"}, 1)
}

ui["misc"].global_controller = function()
    local global_switch = ui["misc"].global_switch:Get()
    ui["misc"].hitsound:SetVisible(global_switch)
    ui["misc"].hitsound_volume:SetVisible(global_switch and ui["misc"].hitsound:Get())

    ui["misc"].disable_thirdperson_anim:SetVisible(global_switch)

    ui["misc"].trashtalk:SetVisible(global_switch)
    ui["misc"].trashtalk_language:SetVisible(global_switch and ui["misc"].trashtalk:Get())
end

disable_thirdperson_anim.apply = function()
    if not ui["misc"].global_switch:Get() or not ui["misc"].disable_thirdperson_anim:Get() then return end

    Cheat.SetThirdPersonAnim(false)
end

ffi_handler.sound_client = ffi.cast("uintptr_t**", Utils.CreateInterface("engine.dll", "IEngineSoundClient003"))
ffi_handler.play_sound = ffi_handler.selfcall(ffi.cast("void*(__thiscall*)(void*, const char*, float, int, int, float)", ffi_handler.sound_client[0][12]), ffi_handler.engine_sound_client)
local hitsound_reference = Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Get()
hitsound.apply = function(event)
    if event:GetName() ~= "player_hurt" then return end

    if not ui["misc"].hitsound:Get() or not ui["misc"].global_switch:Get() then return end
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(false)

    local victim =  event:GetInt("userid", -1337)
    local attacker = event:GetInt("attacker", -1337)
    if (victim == -1337 or attacker == -1337) or victim == attacker then return end

    attacker = EntityList.GetPlayerForUserID(attacker)
    if attacker == nil or attacker ~= EntityList.GetLocalPlayer() then return end

    local volume = ui["misc"].hitsound_volume:Get()
    ffi_handler.play_sound("buttons/arena_switch_press_02.wav", volume / 100, 100, 0, 0)
end

hitsound.destroy = function()
    Menu.FindVar("Visuals", "World", "Hit", "Hit Sound"):Set(hitsound_reference)
end

--Пиздец, магистр, мне по-настоящему страшно с тобой общаться, ты ненормальный
trashtalk.russian_phrases = {
    "ебанный тапочек чё делаешь", "лоляка ну ты упал башмак", "пипец ты сандалина тупая","я хуею ты крендель", "ты чо упал казёл",
    "хахахаха попущ изи", "ЕБАТЬ ТЫ СВАЛИЛСЯ", "Я ХУЕЮ ТЫ ПЕДИК", "маму ебал кек", "нихуя ты слабак",
    "пипец ты рухнул как СССР", "я твой дед взрывал", "сдох как твоя бабка в 43", "чо сдох хохол",
    "на нахуй ракету по черевякалке", "хуяк пулю в печень", "на сука в пиздак", "ХАХАХАХАХ ЕБАТЬ ВПЕНИЛ ТАПКОМ ПО ШАПКЕ",
    "ХАХАХАХАХА КАК ЖЕ ЛЕГКО БЫЛО ДЛЯ UMBRELLA.lua", "НА СУЧЕНЫШ ПУЛЮ", "ЛУЧШАЯ ЛУА ДЛЯ НЕВЕРЛУЗА UMBRELLA.lua", "ЛОВИ ГРАНАТУ УКРОНАЦИСТ",
    "EZ FOR UMBRELLA.lua", "ХУЯК ПО ПИЗДОПРОЁБИНЕ", "ЛОВИ МАСЛИНУ УЕБАН ССАНЫЙ АХАХХАХА", "хахахаха ну ты пиздец семью позоришь",
    "бать ты мусорила чё творишь ваще", "ХАХХАХАХАХА КУПИ ГАЙДЫ КАК ИГРАТЬ", "ЕБАТЬ ТЫ ИЗИЧНЫЙ КУПИ UMBRELLA.lua", "хахах куколд ссаный чё всосал",
    "на хуяку под горло", "ахахаах купи лучше луашку для нла UMBRELLA.lua", "чувак что ты вытворяешь убогий купи скриптик на нл UMBRELLA.lua",
    "на те сучара фашистская", "лови тапыча ублюдошный", "АРФЫВОЛОРАФАВРФОА КРИПЯРА ЕБАННАЯ", "БОЖЕ ПРОСТО СФАРМИЛ ЛОШКА", "ЕБАТЬ ТЫ ВСОСАЛ МОЙ ХУЕЦ",
    "какой же ты убогий парень мусор", "бу нахуй шакал", "на по харе ублюдошный утырок", "НА ТЕ МРАЗЬ ЗА ВСЮ БОЛЬ", "ИЗИ ШАЛАШОВКА ССАНАЯ",
    "ИЗИ ПИДОРАСИНКА", "ИДИ ГЕРЫЧА ЕБНИ ЛУЧШЕ ПИДОРАС", "НА СУЧАРА ВЫГУ ВЫГУ СДЕЛАЛ ТЕБЕ", "АВХАВХАВХАВХ ПСИНА НА ЦЕПИ ЗАДОХНУЛСЯ",
    "ЕБАТЬ ТЫ ПОМЕР КАК ТВОЙ ДЕД В 45", "АЛКАШ ИЗИЧКА ПРОСТО ХАХАХ", "аввахавхав говноедик ебанный", "оправдайся в носик шалава", "просто на нахуй в черемякалку",
    "лови пулю в черемушку", "всоси мой автомат лошара", "апхаххаха как ебать ты сосешь у UMBRELLA,js", "чел не позорься купи луашку для нла UMBRELLA.lua", "лошпедик на нахуй ору ботик",
    "кек слабак сдох", "вшатал нефору жи есть", "лови маслину", "изи вацок бля иууу", "порешал барашка бля", "изи трахнул овечку", "боже ахахахах лошпеда слабая", "чееееел позор",
    "слабак изи кек лол орбидол", "хахахаха смешнявку словил с тя", "ХАХАХХАХА собачка с цепи слетела", "ОРУ БЛЯ ХАЧ СДОХ", "изи обоссыш", "хуесос иди в геншин поиграй", "ору трапика трахнул",
    "пиздюк словил хачапури по ебалу", "шалава в хуй мне подуй", "на изях ублюдок", "возьми в ротик мой большой", "ору шлюх конченный изизизи", "ЕБАННЫЙ БЕЗУМЕЦ ТЫ ДУМАЛ УБЬЕШЬ ЧТОЛЬ",
    "НАПОЛУВЯЛЫМ ПО ЕБАЛУ ЧУРБАН ССАНЫЙ", "ОРУ ХОХЛУША ССАНАЯ СОСИ МОЙ ЧИКИБАМБОНИ", "какая ситуация с юидом балбес)0))0)", "крендель поломанный ору", "ебать ты как москвич разволился",
    "найс юид мать свою шлюху убей иди", "овней бай артур рататуйкин228"
}

trashtalk.english_phrases = {
    "My 80-year-old grandmother plays better than you", "I may be fat but you are ugly and I can diet", "Wow I thought the average iq was above money's. It seems that I was wrong...",
    "Yo momma's so fat, the probability of her being in an arbitrary point in a room is 1.", "I used to fuck guys like you in prison", "You suck more than a suck machine set on 'suck a lot'",
    "You suck more than a hooker at a vacuum cleaner convention", "Man, you're like school on Sunday. No Class...", "Man, you're like school on a Sunday. You're fucking gay...",
    "i'll fuck you 'til you love me, faggot'", "You should go to paypal, report a problem and demand a refund of your shit paste", "Unfortunately I didn't choose the talent that makes me play better",
    "You miss more shots than a fucking Stormtrooper", "Do you mind leaving the game? I would rather play with the AI...", "Don't be coming up in my kitchen with your weaksauce",
    "If I wanted to commit suicide, I'd jump from your ego to your kd", "Guys, if we want to win this, stop writing fucking Klingon, can't understand shit.",
    "You dropped that bomb just like your mom dropped you on your head as a kid.", "Sorry, I don't speak star wars.", "Don't be upsetti, have some spaghetti",
    "If CS:GO is too hard for you maybe consider a game that requires less skill, like idk.... solitaire?", "It's time for a mapchange, isn't it ?",
    "Protip: Using a mouse is recommended.", "You guys were ecoing as well?", "Even Noah can't carry these animals...", "Yo mama so fat when she plays Overpass, you can shoot her on Mirage.",
    "Was that your spray on the wall or are you just happy to see me?", "Your mom is so fat when she boosts she teamkills", "If you would chew your food you wouldn't be choking so hard.",
    "Mad cuz bad", "Hey mate, what controller are you using?", "Did you know that csgo is free to uninstall?", "You're about as useful as pedals on a wheelchair.",
    "You shoot like an AI designed by a 10 year old", "Shut up, I fucked your dad.", "With aim like that, I pity whoever has to clean the floor around your toilet.",
    "We may have lost the game, but at the end of the day we, unlike you, are not Russians", "Atleast hitler knew when to kill himself.", "Atleast hitler knew when to kill himself.",
    "You must be fat because you have a nice voice, and the air needs enough space in your lungs to articulate the sound right.", "Can't hear you from the bottom of the scoreboard.",
    "now ᴘʟᴀʏɪɴɢ: Who asked (Feat: Nobody did)", "Your family must have a motto of Incest is Wincest for you to be that retarded.",
    "If this guy was the shooter harambe would still be alive."
}
--Артур рататуйкин)))00))0)
--Бесплатная трава за сабку неверлуза только у dermagister

trashtalk.apply = function(event)
    if event:GetName() ~= "player_death" then return end

    if not ui["misc"].global_switch:Get() or not ui["misc"].trashtalk:Get() then return end
   
    local player = EntityList.GetLocalPlayer()
    local victim = EntityList.GetPlayerForUserID(event:GetInt("userid"))
    local attacker = EntityList.GetPlayerForUserID(event:GetInt("attacker"))

    if victim == attacker or attacker ~= player then return end
    local phrases = trashtalk.english_phrases
    if ui["misc"].trashtalk_language:Get() == 0 then phrases = trashtalk.russian_phrases end

    EngineClient.ExecuteClientCmd('say "'..phrases[Utils.RandomInt(1, #phrases)]..'"')
end

ui["antiaim"].default_config:RegisterCallback(function()
    ui["antiaim"].global_switch:Set(true); ui["antiaim"].antiaim_type:Set(1); ui["antiaim"].manual_yawbase:Set(0)
    for i = 1, 2 do ui["antiaim"].tweaks:Set(i, true) end

    local types = {"Global", "Stand", "Walk", "Slow-walk", "Crouch", "Air", "Air-C"}
    local elements = {"switch", "pitch", "yaw_base", "yaw_add_left", "yaw_add_right", "yaw_modifier", "modifier_degree", "left_limit", "right_limit", "lby_mode", "desync_freestanding", "desync_on_shot"}
    local config = { globals = {true, 1, 4, 0, 0, 0, 0, 60, 60, 0, 0, 0}, standing = {true, 1, 4, -12, 20, 1, 28, 60, 60, 0, 0, 2}, walking = {true, 1, 4, -18, 18, 1, 54, 59, 48, 1, 0, 2}, slowwalk = {true, 1, 4, -14, 14, 1, 44, 59, 59, 0, 0, 1}, duck = {true, 1, 4, -12, 14, 1, 35, 60, 60, 1, 0, 2},
    jump = {true, 1, 4, -5, 0, 2, 60, 60, 60, 0, 0, 2}, air_c = {true, 1, 4 -5, 0,  2, 60, 60, 60, 0, 0, 2} }

    for i, element in pairs(elements) do ui["antiaim"].conditional["Stand"][element]:Set(config.standing[i]); ui["antiaim"].conditional["Walk"][element]:Set(config.walking[i]); ui["antiaim"].conditional["Slow-walk"][element]:Set(config.slowwalk[i]);
        ui["antiaim"].conditional["Crouch"][element]:Set(config.duck[i]); ui["antiaim"].conditional["Air"][element]:Set(config.jump[i]); ui["antiaim"].conditional["Air-C"][element]:Set(config.jump[i]) end
   
    for _, el in pairs(types) do ui["antiaim"].conditional[el]["fake_options"]:Set(2, true) end
end)

Cheat.RegisterCallback("events", function(event)
    hitlogs.on_round_start(event)
    hitsound.apply(event)
    trashtalk.apply(event)
end)

Cheat.RegisterCallback("registered_shot", function(shot)
    hitlogs.store_data(shot)
    hitlogs.console(shot)
end)

Cheat.RegisterCallback("draw", function()
    ui["ragebot"].global_controller()
    conditional_antiaim.ui_controller()
    ui["antiaim"].global_controller()
    antiaim_tweaks.disable_fakelag_with_hs()
    ui["visuals"].global_controller()
    menu_background.apply()
    widgets.watermark()
    widgets.fake()
    widgets.fakelag()
    widgets.keybinds()
    widgets.spectators()
    indicators.umbrella()
    indicators.ideal_yaw()
    hitlogs.apply()
    hitlogs.reset_data()
    custom_scope.apply()
    custom_scope.viewmodel_in_scope()
    snaplines.nearest_to_crosshair()
    snaplines.apply()
    ui["misc"].global_controller()
    disable_thirdperson_anim.apply()
end)


Cheat.RegisterCallback("pre_prediction", function(cmd)
    conditional_antiaim.apply_condition(cmd)
end)

Cheat.RegisterCallback("prediction", function(cmd)
    ragebot_improvements.baim_if_lethal()
    ragebot_improvements.doubletap_tickbase()
    conditional_hitchance.noscope()
    conditional_hitchance.air()
    discharge.apply()
end)

Cheat.RegisterCallback("createmove", function(cmd)
    antiaim_tweaks.disable_on_warmup()
end)

Cheat.RegisterCallback("destroy", function()
    conditional_antiaim.destroy()
    custom_scope.destroy()
    hitsound.destroy()
end)
if health < damage then
ragebot_improvements.force_baim(i)
end


почему нельзя сделать трейсом? если вы поставите 92 и отойдете подальше то у вас чит попросту стрелять не будет изза говнокода
 
Сверху Снизу