Crack Lua Alien.lua neverlose

Забаненный
Статус
Оффлайн
Регистрация
31 Дек 2018
Сообщения
442
Реакции[?]
212
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

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

code_language.asm6502:
local ffi = require 'ffi'
-- local variables for API functions. any changes to the line below will be lost on re-generation
AntiAim_GetCurrentRealRotation, AntiAim_GetInverterState, AntiAim_OverrideInverter, AntiAim_OverrideLimit, bit_band, bit_lshift, Cheat_AddNotify, Cheat_GetBinds, Cheat_GetCheatUserName, Cheat_GetMousePos, Cheat_IsKeyDown, Cheat_IsMenuVisible, Cheat_RegisterCallback, Color_new, Color_RGBA, EngineClient_ExecuteClientCmd, EngineClient_GetNetChannelInfo, EngineClient_GetScreenSize, EngineClient_GetViewAngles, EngineClient_IsConnected, EngineClient_IsInGame, EntityList_GetClientEntity, EntityList_GetEntitiesByClassID, EntityList_GetLocalPlayer, EntityList_GetPlayerForUserID, EntityList_GetPlayerFromHandle, EntityList_GetPlayers, Exploits_GetCharge, Exploits_OverrideDoubleTapSpeed, math_abs, math_atan2, math_cos, math_deg, math_floor, math_max, math_min, math_sin, Menu_Button, Menu_ColorEdit, Menu_Combo, Menu_FindVar, Menu_MultiCombo, Menu_SliderInt, Menu_Switch, Menu_Text, Utils_PatternScan, Utils_RandomInt, pairs, Panorama_Open, Render_Box, Render_BoxFilled, Render_CalcTextSize, Render_Circle, Render_GradientBoxFilled, Render_InitFont, Render_PolyFilled, Render_Text, string_sub, tostring, Vector2_new, print, string_format, table_insert, table_remove, ipairs, Vector_new, EngineClient_GetLocalPlayer, EntityList_GetEntitiesByName, math_pi, QAngle_new, Cheat_FireBullet, math_sqrt, bit_bor, ffi_cdef, ffi_typeof, ffi_cast, EngineClient_GetGameDirectory, string_gsub, ffi_C, ffi_string, RageBot_OverrideMinDamage, math_ceil, Menu_SwitchColor, string_lower, Utils_CreateInterface, CVar_FindVar, table_concat, AntiAim_GetFakeRotation, ffi_new, EntityList_GetClientEntityFromHandle, string_find, Render_LoadImage, ffi_copy, AntiAim_OverrideYawOffset, Render_WorldToScreen, Render_Blur, Panorama_LoadString, ffi_sizeof, string_char, Render_Circle3DFilled, RageBot_OverrideHitchance, Exploits_ForceTeleport, math_rad = AntiAim.GetCurrentRealRotation, AntiAim.GetInverterState, AntiAim.OverrideInverter, AntiAim.OverrideLimit, bit.band, bit.lshift, Cheat.AddNotify, Cheat.GetBinds, Cheat.GetCheatUserName, Cheat.GetMousePos, Cheat.IsKeyDown, Cheat.IsMenuVisible, Cheat.RegisterCallback, Color.new, Color.RGBA, EngineClient.ExecuteClientCmd, EngineClient.GetNetChannelInfo, EngineClient.GetScreenSize, EngineClient.GetViewAngles, EngineClient.IsConnected, EngineClient.IsInGame, EntityList.GetClientEntity, EntityList.GetEntitiesByClassID, EntityList.GetLocalPlayer, EntityList.GetPlayerForUserID, EntityList.GetPlayerFromHandle, EntityList.GetPlayers, Exploits.GetCharge, Exploits.OverrideDoubleTapSpeed, math.abs, math.atan2, math.cos, math.deg, math.floor, math.max, math.min, math.sin, Menu.Button, Menu.ColorEdit, Menu.Combo, Menu.FindVar, Menu.MultiCombo, Menu.SliderInt, Menu.Switch, Menu.Text, Utils.PatternScan, Utils.RandomInt, pairs, Panorama.Open, Render.Box, Render.BoxFilled, Render.CalcTextSize, Render.Circle, Render.GradientBoxFilled, Render.InitFont, Render.PolyFilled, Render.Text, string.sub, tostring, Vector2.new, print, string.format, table.insert, table.remove, ipairs, Vector.new, EngineClient.GetLocalPlayer, EntityList.GetEntitiesByName, math.pi, QAngle.new, Cheat.FireBullet, math.sqrt, bit.bor, ffi.cdef, ffi.typeof, ffi.cast, EngineClient.GetGameDirectory, string.gsub, ffi.C, ffi.string, RageBot.OverrideMinDamage, math.ceil, Menu.SwitchColor, string.lower, Utils.CreateInterface, CVar.FindVar, table.concat, AntiAim.GetFakeRotation, ffi.new, EntityList.GetClientEntityFromHandle, string.find, Render.LoadImage, ffi.copy, AntiAim.OverrideYawOffset, Render.WorldToScreen, Render.Blur, Panorama.LoadString, ffi.sizeof, string.char, Render.Circle3DFilled, RageBot.OverrideHitchance, Exploits.ForceTeleport, math.rad
Cheat_AddNotify('Alien.lua', 'Welcome to alien.lua, '..Cheat_GetCheatUserName()..'!')
Clipboard = {}
ffi.cdef[[
typedef void*(__thiscall* getnetchannel_t)(void*); // engineclient 78
typedef unsigned short WORD;
typedef struct _SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
}
SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

typedef int(__thiscall* get_clipboard_text_length)(void*);
typedef void(__thiscall* set_clipboard_text)(void*, const char*, int);
typedef void(__thiscall* get_clipboard_text)(void*, int, const char*, int);

void GetLocalTime(
LPSYSTEMTIME lpSystemTime
);
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);
typedef struct {
    uint8_t r; uint8_t g; uint8_t b; uint8_t a;
} color_struct_t;

typedef void (*console_color_print)(const color_struct_t&, const char*, ...);
void* GetProcAddress(void* hModule, const char* lpProcName);
void* GetModuleHandleA(const char* lpModuleName);

int       CreateDirectoryA(const char*, void*);
void*     CreateFileA(const char*, uintptr_t, uintptr_t, void*, uintptr_t, uintptr_t, void*);
uintptr_t GetFileSize(void*, uintptr_t*);
int       ReadFile(void*, void*, uintptr_t, uintptr_t*, void*);
int       WriteFile(void*, const void*, uintptr_t, uintptr_t*, void*);
int       CloseHandle(void*);
typedef float*(__thiscall* bound)(void*);

]]

color_print_fn = ffi.cast("console_color_print", ffi.C.GetProcAddress(ffi.C.GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXABVColor@@PBDZZ"))

function colored_print(color, text)
    local col = ffi.new("color_struct_t")
    for i, v in pairs({"r", "g", "b", "a"}) do
        col[v] = color[v] * 255
    end
    color_print_fn(col, text)
end

local urlmon = ffi.load 'UrlMon'
local wininet = ffi.load 'WinInet'
local screen_size = EngineClient_GetScreenSize()

local default_cfg = Menu_Button('Global', 'Configs', 'Load Default Config', '')
local export_cfg = Menu_Button('Global', 'Configs', 'Export Config', '')
local import_cfg = Menu_Button('Global', 'Configs', 'Import Config', '')
Menu_Text('Global', 'Information', 'Welcome '..Cheat_GetCheatUserName()..'!

 Version: Live 0.1!')

local dormant_aim = Menu_Switch('Rage', 'Ragebot', 'Dormant Aimbot', false)
local dormant_mindmg = Menu_SliderInt('Rage', 'Ragebot', 'Dormant MinDmg', 10, 1, 100)
local air_hitchance = Menu_Switch('Rage', 'Ragebot', 'Custom Air Hitchance', false)
local air_hitchance_value = Menu_SliderInt('Rage', 'Ragebot', 'Air Hitchance', 1, 1, 100)
local noscope_hitchance = Menu_Switch('Rage', 'Ragebot', 'Custom Noscope Hitchance', false)
local noscope_hitchance_value = Menu_SliderInt('Rage', 'Ragebot', 'Noscope Hitchance', 1, 1, 100)
local auto_teleport_in_air = Menu_Switch('Rage', 'Ragebot', 'Automatic Cross Teleport in Air', false)
local teleport_weapons = Menu_MultiCombo('Rage', 'Ragebot', 'Teleport weapons', {'AWP', 'AutoSnipers', 'Scout', 'Deagle', 'Revolver', 'Nades', 'Other', 'Pistols', 'Rifle/LMG', 'SMG', 'Shotgun', 'Taser'}, 0)
local proper_baim = Menu_Switch('Rage', 'Ragebot', 'Force Baim if Lethal', false)

local enable__aa = Menu_Switch('Anti Aim', 'Anti Aim', 'Enable', false)
local avoid_backstab = Menu_Switch('Anti Aim', 'Anti Aim', 'Avoid Backstab', false)
local conditions = Menu_Switch('Anti Aim', 'Anti Aim', 'Conditions', false)
local type = Menu_Combo('Anti Aim', 'Anti Aim', 'Currect Condition', {'Shared', 'On Use', 'Stay', 'Crouch', 'Slow Walk', 'Move', 'Air', 'Manual', 'Anti-Bruteforce'}, 0)
local manual_yaw_base = Menu_Combo('Anti Aim', 'Anti Aim', 'Manual Yaw Base', {'Disabled', 'Forward', 'Backward', 'Right', 'Left', 'At Target', 'Freestanding'}, 0)
local override_on_use = Menu_Switch('Anti Aim', 'Anti Aim', 'Override On Use', false)
local override_stand = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Stay', false)
local override_crouch = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Crouch', false)
local override_slowwalk = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Slow Walk', false)
local override_move = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Move', false)
local override_air = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Air', false)
local enabled_antibrute = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Anti Bruteforce', false)
local override_manual = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Manual', false)

local types = {}
local numtotext = {
    [0] = 'Shared',
    [1] = 'On Use',
    [2] = 'Stay',
    [3] = 'Crouch',
    [4] = 'Slow Walk',
    [5] = 'Move',
    [6] = 'Air',
    [7] = 'Manual',
    [8] = 'Anti Aim Preset',
}
local i = 0
local yaw_on_use = Menu_Combo('Anti Aim', 'On Use', 'Yaw Base', {'Forward', 'Backward', 'Right', 'Left', 'At Target', 'Freestanding'}, 0)
while #types ~= 9 do
    table_insert(types, {
        yaw_add_l = Menu_SliderInt('Anti Aim', numtotext[i], 'Yaw Add Left', 0, -180, 180),
        yaw_add_r = Menu_SliderInt('Anti Aim', numtotext[i], 'Yaw Add Right', 0, -180, 180),
        jitter_mode = Menu_Combo('Anti Aim', numtotext[i], 'Yaw Modifier Mode', {'Disabled', 'Random'}, 0),
        jitter = Menu_Combo('Anti Aim', numtotext[i], 'Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0),
        --jitter_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree',0, -180, 180),
        jitter_value_min = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree Min',0, -180, 180),
        jitter_value_max = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree Max',0, -180, 180),
        fake_limit_type = Menu_Combo('Anti Aim', numtotext[i], 'Fake Limit Type', {'Static', 'Jitter'}, 0),
        left_desync_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Left Limit', 0, 0, 60),
        right_desync_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Right Limit', 0, 0, 60),
        fake_option = Menu_MultiCombo('Anti Aim', numtotext[i], 'Fake Options', {'Avoid Overlap', 'Jitter', 'Randomize Jitter', 'Anti Bruteforce'}, 0),
        lby_mode = Menu_Combo('Anti Aim', numtotext[i], 'LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0),
        freestand_desync = Menu_Combo('Anti Aim', numtotext[i], 'Freestanding Desync', {'Off', 'Peek Fake', 'Peek Real'}, 0),
        desync_on_shot = Menu_Combo('Anti Aim', numtotext[i], 'Desync On Shot', {'Disabled', 'Opposite', 'Freestanding', 'Switch'}, 0),
        fakelag = Menu_Switch('Anti Aim', numtotext[i], 'Enable Fake Lag', false),
        fakelag_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Limit', 0, 0, 14),
        random_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Randomization', 0, 0, 14),
        mega_shit = Menu_Switch('Anti Aim', numtotext[i], 'Roll AA', false),
    })
    i = i + 1
end

yaw_add_l_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Yaw Add Left', 0, -180, 180)
yaw_add_r_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Yaw Add Right', 0, -180, 180)
jitter_b1 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[1] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Modifier Degree',0,-180,180)
lby_mode_b1 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[1] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Fake Limit', 0, -60, 60)

enable_b2 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 2', false)
yaw_add_l_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Yaw Add Left', 0, -180, 180)
yaw_add_r_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Yaw Add Right', 0, -180, 180)
jitter_b2 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[2] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Modifier Degree',0,-180,180)
lby_mode_b2 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[2] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Fake Limit', 0, -60, 60)

enable_b3 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 3', false)
yaw_add_l_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Yaw Add Left', 0, -180, 180)
yaw_add_r_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Yaw Add Right', 0, -180, 180)
jitter_b3 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[3] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Modifier Degree',0,-180,180)
lby_mode_b3 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[3] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Fake Limit', 0, -60, 60)

enable_b4 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 4', false)
yaw_add_l_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Yaw Add Left', 0, -180, 180)
yaw_add_r_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Yaw Add Right', 0, -180, 180)
jitter_b4 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[4] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Modifier Degree',0,-180,180)
lby_mode_b4 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[4] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Fake Limit', 0, -60, 60)

local indicators_style = Menu_MultiCombo('Visuals', 'Visuals', 'Crosshair Indicators', {'Drain yaw', 'Acatel', 'Medusa', 'Arctic', 'Half-Life'}, 0)
local indicators_add = Menu_MultiCombo('Visuals', 'Visuals', 'Indicators Add', {'Script Name', 'Inverter', 'Anti-Aim Arrow',  'Anti-Aim State', 'Double-Tap', 'Hide Shots', 'Minimum Damage', 'Force Body Aim', 'Force Safe Points', 'Freestanding', 'Ideal tick'}, 0)
local windows_value = Menu_MultiCombo('Visuals', 'Visuals', 'Windows', {'Watermark', 'Hotkey list', 'Anti-aimbot indication', 'Frequency update information'}, 0)
local teamskeet_kb = Menu_Combo('Visuals', 'Visuals', 'Hotkey list theme', {'Teamskeet', "Default"}, 0)
local gradient = Menu_Switch('Visuals', 'Visuals', 'Hotkey list Gradient', false)
local custom_scope_switch = Menu_Switch('Visuals', 'Visuals', 'Custom Scope', false)
local auto_peek = Menu_SwitchColor('Visuals', 'Visuals', 'Glow AutoPeek', false, Color_RGBA(255, 0, 0, 255))
local arrows_ind = Menu_Combo('Visuals', 'Visuals', 'Arrows', {'Disable', 'Teamskeet', 'Modern', "Default", 'Drain yaw'}, 0)
local vel_mod_ind = Menu_Switch('Visuals', 'Visuals', 'Velocity Modifier Indicator', false)
local screen_dmg = Menu_Switch('Visuals', 'Visuals', 'Min damage Indicator', false)
local Hitmarker = Menu_SwitchColor('Visuals', 'Visuals', 'Hitmarker', false, Color_RGBA(255, 255, 255, 255))
local penetration = Menu_SwitchColor('Visuals', 'Visuals', 'Penetration indicator', false, Color_RGBA(255, 195, 13, 255))

local accent_color = Menu_ColorEdit('Visuals', 'Settings', 'Accent Color', Color_RGBA(177, 171, 255, 255))
local alpha_slider = Menu_SliderInt('Visuals', 'Settings', 'Background Alpha', 222, 0, 255)
local blur_back = Menu_Switch('Visuals', 'Settings', 'Background Blur', false)
local keybinds_x = Menu_SliderInt('Visuals', 'Settings', 'x_pos', screen_size.x/2-250, 1, screen_size.x)
local keybinds_y = Menu_SliderInt('Visuals', 'Settings', 'y_pos', screen_size.y/2-50, 1, screen_size.y)
local ind_clr = Menu_ColorEdit('Visuals', 'Settings', 'Arrow Color', Color_RGBA(175, 255, 0, 255))
local ind_clr2 = Menu_ColorEdit('Visuals', 'Settings', 'Arrow Desync Color', Color_RGBA(0, 200, 255, 255))
local vel_mod_add_x = Menu_SliderInt('Visuals', 'Settings', 'Velocity Modifier X', 22, -screen_size.x, screen_size.x)
local vel_mod_add_y = Menu_SliderInt('Visuals', 'Settings', 'Velocity Modifier Y', 200, -screen_size.y, screen_size.y)
local screen_dmg_x = Menu_SliderInt('Visuals', 'Settings', 'Mindamage Add X', 0, -100, 100)
local screen_dmg_y = Menu_SliderInt('Visuals', 'Settings', 'Mindamage Add Y', 0, -100, 100)
local scope_size = Menu_SliderInt('Visuals', 'Settings', 'Custom Scope Size', 50, 50, screen_size.y/2)
local scope_gap = Menu_SliderInt('Visuals', 'Settings', 'Custom Scope Gap', 10, 0, screen_size.y/2)

local scope_color = Menu_ColorEdit('Visuals', 'Settings', 'Scope Color', Color_RGBA(255, 255, 255, 255))
local scope_color1 = Menu_ColorEdit('Visuals', 'Settings', 'Scope Color 1', Color_RGBA(255, 255, 255, 0))
local penetration_position = Menu_SliderInt('Visuals', 'Settings', 'Position indicator', -25, -50, 50)
local penetration_rainbow = Menu_Switch('Visuals', 'Settings', 'Rainbow mode', false)
local penetration_speed = Menu_SliderInt('Visuals', 'Settings', 'Speed rainbow', 50, 1, 100)
scope_color1:SetVisible(false)
download_file_from_url = function(from, to)
wininet.DeleteUrlCacheEntryA(from)
urlmon.URLDownloadToFileA(nil, from, to, 0,0)
end

ct = ffi_typeof('char[?]')
c_invalid_handle_value = ffi_cast('void*', -1)
local netChannelInt = ffi_typeof('int(__thiscall*)(void*, int)')
local netChannelBool = ffi_typeof('bool(__thiscall*)(void*)')
local netChannelBoolWithArgs = ffi_typeof('bool(__thiscall*)(void*, int, int)')
local netChannelFloat = ffi_typeof('float(__thiscall*)(void*, int)')
function GetNetChannel(netChannelInfo)
if netChannelInfo == nil then
    return
end

local SequenceNr = ffi_cast(netChannelInt, netChannelInfo[0][17])(netChannelInfo, 1)

return {
    SequenceNr = SequenceNr,

    IsLoopback = ffi_cast(netChannelBool, netChannelInfo[0][6])(netChannelInfo),
    IsTimingOut = ffi_cast(netChannelBool, netChannelInfo[0][7])(netChannelInfo),

    Latency = {
        RTT = function(flow) return ffi_cast(netChannelFloat, netChannelInfo[0][9])(netChannelInfo, flow) end,
        AvgLatency = function(flow) return ffi_cast(netChannelFloat, netChannelInfo[0][10])(netChannelInfo, flow) end,
    },

    AvgLoss = ffi_cast(netChannelFloat, netChannelInfo[0][11])(netChannelInfo, 1),
    AvgChoke = ffi_cast(netChannelFloat, netChannelInfo[0][12])(netChannelInfo, 1),
    InputBytes = ffi_cast(netChannelFloat, netChannelInfo[0][13])(netChannelInfo, 1),
    SendBytes = ffi_cast(netChannelFloat, netChannelInfo[0][13])(netChannelInfo, 0),

    IsValidPacket = ffi_cast(netChannelBoolWithArgs, netChannelInfo[0][18])(netChannelInfo, 1, SequenceNr-1),
}
end

function package.loaded.readfile(filename)
local fp = ffi_C.CreateFileA(filename, 0x80000000, 3, nil, 3, 128, nil)
if c_invalid_handle_value ~= fp then
    local size = ffi_C.GetFileSize(fp, nil)
    local buf = ct(size + 1)
    ffi_C.ReadFile(fp, buf, size, nil, nil)
    ffi_C.CloseHandle(fp)
    return ffi_string(buf, size)
end
end

game_path_str = EngineClient_GetGameDirectory()
game_path = string_gsub(game_path_str, '\csgo', '\')

if (package.loaded.readfile('nl\alien\fonts\small_pixel.ttf') and package.loaded.readfile('nl\alien\fonts\arrows.ttf')) then

else
ffi.C.CreateDirectoryA('nl\alien\', NULL)
ffi.C.CreateDirectoryA('nl\alien\fonts\', NULL)

download_file_from_url('https://fontsforyou.com/downloads/99851-smallestpixel97', 'nl\alien\fonts\small_pixel.ttf')
download_file_from_url('https://cdn.discordapp.com/attachments/947429839101624320/952177029867003924/arrows.ttf', 'nl\alien\fonts\arrows.ttf')
Menu_Text('Global', 'Information', 'Dear User, Restart script!')
Cheat_AddNotify('alien', 'Files downloaded, restart script!')
end

local anti_bruteforce_work = {
phases = stagesb,
work = false,
work_value = 0.0,
work_memory = {

},
memory = {

}
}

for i = 0, 64 do
table_insert(anti_bruteforce_work.memory,i,{count = 0})
end


local advanced_shot_logger = Menu_Switch('Misc', 'Misc', 'Advanced Shot Logger', false)
local hitsound_custom = Menu_Switch('Misc', 'Misc', 'Skeet Hitsound', false)
local clan_tag = Menu_Switch('Misc', 'Misc', 'Clan-Tag Changer', false)
local shit_talk = Menu_Switch('Misc', 'Misc', 'TrashTalk', false)
local idealpeek = Menu_Switch('Misc', 'Misc', 'Ideal Peek', false)

local Shared = 1
local On_Use = 2
local Stay = 3
local Crouch = 4
local SlowWalk = 5
local Move = 6
local Air = 7
local Manual = 8
local legitaa_time = GlobalVars.realtime
local anti_aim_preset = 9
local ConVar = {
yaw = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'),
yaw_add = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Add'),
jitter = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Modifier'),
jitter_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Modifier Degree'),
left_desync_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Left Limit'),
right_desync_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Right Limit'),
fake_option = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Fake Options'),
lby_mode = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'LBY Mode'),
freestand_desync = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Freestanding Desync'),
desync_on_shot = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Desync On Shot'),
fakelag = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Enable Fake Lag'),
fakelag_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Limit'),
random_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Randomization'),

slowwalk = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Slow Walk'),
fakeduck = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Fake Duck'),
}
local original_aa = true

function modify_velocity(cmd, goalspeed)
local minspeed = math_sqrt((cmd.forwardmove * cmd.forwardmove) + (cmd.sidemove * cmd.sidemove))
if goalspeed <= 0 or minspeed <= 0 then
    return
end

if EntityList_GetLocalPlayer():GetProp('m_flDuckAmount') >= 1 then
    goalspeed = goalspeed * 2.94117647
end

if minspeed <= goalspeed then
    return
end

local speedfactor = goalspeed / minspeed
cmd.forwardmove = cmd.forwardmove * speedfactor
cmd.sidemove = cmd.sidemove * speedfactor
end

roundStarted = 0
player_info_prev = {}
dormant_flag = false

for i = 1, 64 do
player_info_prev[i] = {
    origin = Vector_new(0, 0, 0),
}
end

function calc_angle(src, dst)
local vecdelta = Vector_new(dst.x - src.x, dst.y - src.y, dst.z - src.z)
local angles = QAngle_new(math_atan2(-vecdelta.z, vecdelta:Length2D()) * 180.0 / math_pi, (math_atan2(vecdelta.y, vecdelta.x) * 180.0 / math_pi), 0.0)
return angles
end

min = Vector_new()
max = Vector_new()
target_correct = true
last_value = 0
should = false
dmg_type = 0
once = false
prsd_damage = 0


function dormant_aimbot(cmd)

local players = EntityList_GetPlayers()
local m_bIsScoped = EntityList_GetLocalPlayer():GetProp('m_bIsScoped')
local is_in_air = bit_band(EntityList_GetLocalPlayer():GetProp('m_fFlags'), bit_lshift(1,0)) ~= 0
local weapon = EntityList_GetLocalPlayer():GetActiveWeapon()
if weapon == nil then return end
for _, enemy in ipairs(players) do
    if not enemy:IsTeamMate() and enemy ~= EntityList_GetLocalPlayer() then
        local enemy_index = enemy:EntIndex()
        if air_hitchance:GetBool() and not is_in_air then
            RageBot_OverrideHitchance(enemy_index, air_hitchance_value:GetInt())
        elseif noscope_hitchance:GetBool() and not m_bIsScoped and weapon:IsSniper() then
            RageBot_OverrideHitchance(enemy_index, noscope_hitchance_value:GetInt())
        end
    end
end
if dormant_aim:GetBool() then
    local lp = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if lp == nil then return end

    local ent = lp:GetActiveWeapon()
    if not ent then
        return
    end

    --local ent = native_GetClientEntity(my_weapon)
    --if ent == nil or not native_IsWeapon(ent) then
    --    return
    --end

    local inaccuracy = ent:GetInaccuracy(ent)
    if inaccuracy == nil then
        return
    end

    local tickcount = GlobalVars.tickcount
    local eyepos = lp:GetEyePosition()
    local simtime = lp:GetProp('m_flSimulationTime')
    local weapon = ent:GetWeaponID()
    local scoped = lp:GetProp('m_bIsScoped')

    local onground = bit_band(lp:GetProp('m_fFlags'), bit_lshift(1, 0))
    if tickcount < roundStarted then return end -- to prevent shooting at ghost dormant esp @ the beginning of round
    local is_AWP = weapon == 9
    local is_auto = (weapon == 38 or weapon == 11)
    local is_scout = weapon == 40
    if ent:IsKnife() or ent:IsGrenade() or weapon == 31 then return end
    local can_shoot
    local hs_fix = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Hide Shots'):GetBool() and 0.3 or 0
    if weapon == 64 then -- for some reason can_shoot returns always false with r8 despite all 3 props being true, no idea why
        can_shoot = simtime > ent:GetProp('m_flNextPrimaryAttack') + hs_fix -- doing this fixes it ><
    elseif ent:IsPistol() and not weapon == 64 and not weapon == 1 then
        can_shoot = false
    else
        can_shoot = simtime > math_max(lp:GetProp('m_flNextAttack') + hs_fix, ent:GetProp('m_flNextPrimaryAttack') + hs_fix, ent:GetProp('m_flNextSecondaryAttack'))
    end

    -- new player info
    local players = EntityList_GetEntitiesByName('CCSPlayer')
    local player_info = {}
    for i = 1, #players do
        local player = players[i]:GetPlayer()
        if EngineClient_IsConnected() and lp:IsAlive() then
            --if plist_get(player, 'Add to whitelist') then goto skip end
            if player:IsDormant() and not player:IsTeamMate() and player:GetProp('m_iHealth') > 0 and player ~= lp then
                local can_hit

                local origin = player:GetProp('m_vecOrigin')
                local min = Vector_new()
                local max = Vector_new()
                local bounds = player:GetRenderBounds(min, max)
                local alpha_multiplier = player:GetESPAlpha() -- grab alpha of the dormant esp

                if player_info_prev[i] ~= nil and origin.x ~= 0 and alpha_multiplier > 0 then -- if origin / dormant esp is valid
                    -- update check
                    local dormant_accurate = alpha_multiplier > 0.1 -- for debug purposes lower this to 0.1

                    if dormant_accurate then
                        local target_points = {
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 28) or Vector_new(0, 0, 38)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 30) or Vector_new(0, 0, 40)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 32) or Vector_new(0, 0, 42)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 40) or Vector_new(0, 0, 50))
                        }

                        for i = 1, #target_points do
                            local target = target_points[i]
                            --local target = origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 30) or Vector_new(0, 0, 40))
                            local target_pos = calc_angle(eyepos, target)
                            local dmg = Cheat_FireBullet(lp, eyepos, target)

                            if is_AWP then
                                max_player_speed_alt = 100
                            elseif is_auto then
                                max_player_speed_alt = 120
                            else
                                max_player_speed_alt = is_scout and ent:GetMaxSpeed() * 0.8 or ent:GetMaxSpeed()
                            end
                            can_hit = (dmg.trace.hit_entity == nil or dmg.trace.hit_entity:EntIndex() == player:EntIndex()) and (dmg.damage > dormant_mindmg:GetInt()) and (not player:IsVisible(target)) -- added visibility check to mitigate shooting at anomalies?
                            if can_shoot and can_hit then
                                modify_velocity(cmd, (scoped and max_player_speed_alt or ent:GetMaxSpeed())*0.33)
                                dormant_flag = true
                                -- autoscope
                                if not scoped and ent:IsSniper() and onground == 1 then
                                    cmd.buttons = bit_bor(cmd.buttons, 2048)
                                end

                                if inaccuracy < 0.009 and ClientState.m_choked_commands == 0 then
                                    cmd.viewangles.pitch = target_pos.pitch
                                    cmd.viewangles.yaw = target_pos.yaw
                                    cmd.viewangles.roll = 0
                                    cmd.buttons = bit_bor(cmd.buttons, 1)
                                    dormant_flag = true
                                    -- dont shoot again
                                    can_shoot = false
                                end
                            elseif can_hit == false then
                                dormant_flag = false
                            end
                        end
                    end
                end
                player_info[i] = {origin, alpha_multiplier, can_hit}
            end
        end
        --::skip::
    end
    player_info_prev = player_info
end

end

function resetter(e)
if e:GetName() ~= 'round_prestart' then return end
local lp = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
if lp == nil then return end
local freezetime = (CVar_FindVar('mp_freezetime'):GetFloat()+1) / GlobalVars.interval_per_tick -- get freezetime plus 1 second and disable dormantbob for that amount of ticks
roundStarted = GlobalVars.tickcount + freezetime
origin = nil
for i = 1, 64 do
    player_info_prev[i] = {
        origin = Vector_new(0, 0, 0),
    }
end
frametimes = {}
player_info_prev = {}
player_info = {}
end

function normalize_yaw(yaww) while yaww > 180 do yaww = yaww - 360 end while yaww < -180 do yaww = yaww + 360 end return yaww end
function math_deg_atan(xdelta, ydelta)
    if xdelta == 0 and ydelta == 0 then
        return 0
    end
    return math_deg(math_atan2(ydelta, xdelta))
end
function nearest()
    function IsValid(ent)
        if ent == nil then
            return false
        else
            if ent:IsAlive() then
                return true
            else
                return false
            end
        end
    end
    if EngineClient_IsConnected() == nil or EngineClient_GetNetChannelInfo() == nil then return end
    local eyepos = EntityList_GetLocalPlayer():GetEyePosition()
    local viewangles = EngineClient_GetViewAngles()
    local bestenemy = nil
    local fov = 180
    for i=1, #EntityList_GetPlayers() do
        if(EntityList_GetPlayers()[i] ~= EntityList_GetLocalPlayer() and EntityList_GetPlayers()[i]:IsTeamMate() ~= true and IsValid(EntityList_GetPlayers()[i]) == true) then
            local cur = EntityList_GetPlayers()[i]:GetProp('m_vecOrigin')
            local cur_fov = math_abs(normalize_yaw(math_deg_atan(eyepos.x - cur.x, eyepos.y - cur.y) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = EntityList_GetPlayers()[i]
            end
        end
    end
    return bestenemy == nil and EntityList_GetLocalPlayer() or bestenemy
end

function override_limit(angle, isoverride)
    if roll_aa_active == true then return end
    if angle < 0 then
        if isoverride == true then AntiAim_OverrideInverter(true) end
        AntiAim_OverrideLimit(math_abs(angle))
        if anti_bruteforce_work_count+1 == 1 then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b1:Get() or yaw_add_l_b1:Get())
            ConVar.jitter:Set(jitter_b1:Get())
            ConVar.jitter_value:Set(jitter_value_b1:Get())
            ConVar.lby_mode:Set(lby_mode_b1:Get())
        elseif anti_bruteforce_work_count+1 == 2 and enable_b2:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b2:Get() or yaw_add_l_b2:Get())
            ConVar.jitter:Set(jitter_b2:Get())
            ConVar.jitter_value:Set(jitter_value_b2:Get())
            ConVar.lby_mode:Set(lby_mode_b2:Get())
        elseif anti_bruteforce_work_count+1 == 3 and enable_b3:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b3:Get() or yaw_add_l_b3:Get())
            ConVar.jitter:Set(jitter_b3:Get())
            ConVar.jitter_value:Set(jitter_value_b3:Get())
            ConVar.lby_mode:Set(lby_mode_b3:Get())
        elseif anti_bruteforce_work_count+1 == 4 and enable_b4:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b4:Get() or yaw_add_l_b4:Get())
            ConVar.jitter:Set(jitter_b4:Get())
            ConVar.jitter_value:Set(jitter_value_b4:Get())
            ConVar.lby_mode:Set(lby_mode_b4:Get())
        end
    elseif angle == 0 or angle > 0  then
        if isoverride == true then AntiAim_OverrideInverter(false) end
        AntiAim_OverrideLimit(angle)
        if anti_bruteforce_work_count+1 == 1 then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b1:Get() or yaw_add_l_b1:Get())
            ConVar.jitter:Set(jitter_b1:Get())
            ConVar.jitter_value:Set(jitter_value_b1:Get())
            ConVar.lby_mode:Set(lby_mode_b1:Get())
        elseif anti_bruteforce_work_count+1 == 2 and enable_b2:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b2:Get() or yaw_add_l_b2:Get())
            ConVar.jitter:Set(jitter_b2:Get())
            ConVar.jitter_value:Set(jitter_value_b2:Get())
            ConVar.lby_mode:Set(lby_mode_b2:Get())
        elseif anti_bruteforce_work_count+1 == 3 and enable_b3:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b3:Get() or yaw_add_l_b3:Get())
            ConVar.jitter:Set(jitter_b3:Get())
            ConVar.jitter_value:Set(jitter_value_b3:Get())
            ConVar.lby_mode:Set(lby_mode_b3:Get())
        elseif anti_bruteforce_work_count+1 == 4 and enable_b4:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b4:Get() or yaw_add_l_b4:Get())
            ConVar.jitter:Set(jitter_b4:Get())
            ConVar.jitter_value:Set(jitter_value_b4:Get())
            ConVar.lby_mode:Set(lby_mode_b4:Get())
        end
    end
end

function vec_closest_point_on_ray(target, ray_start, ray_end)
    local to = target - ray_start
    local direction = ray_end - ray_start
    local ray_length = #direction

    direction.x = direction.x / ray_length
    direction.y = direction.y / ray_length
    direction.z = direction.z / ray_length

    local direction_along = direction.x * to.x + direction.y * to.y + direction.z * to.z
    if direction_along < 0 then return ray_start end
    if direction_along > ray_length then return ray_end end

    return Vector_new(ray_start.x + direction.x * direction_along, ray_start.y + direction.y * direction_along, ray_start.z + direction.z * direction_along)
end

anti_bruteforce_work.tick_work = 0
anti_bruteforce_work.distance = 0
function bullet_impact(eye_pos, eyepos, impact)
    if not enabled_antibrute:GetBool() and roll_aa_active == true then return end
    anti_bruteforce_work.distance = vec_closest_point_on_ray(eye_pos, eyepos, impact):DistTo(eye_pos)
    if anti_bruteforce_work.distance > 65 then return end
    anti_bruteforce_work.tick_work = GlobalVars.tickcount
end

function handle_brutforcetime()
    if not enabled_antibrute:GetBool() and roll_aa_active == true then return end

    for i, var in ipairs(anti_bruteforce_work.work_memory) do
        if i > 1 then
            table_remove(anti_bruteforce_work.work_memory,i)
        end
        anti_bruteforce_work.work = true
        anti_bruteforce_work.work_value = GlobalVars.realtime - var.time
        if anti_bruteforce_work.work_value > 4 then
            anti_bruteforce_work.work_value = 0
            anti_bruteforce_work.work = false
            table_remove(anti_bruteforce_work.work_memory, i)
        end
    end
end
anti_bruteforce_work_count = 0

local hitlogs = {}
function anti_bruteforcee(e)
    if e:GetName() ~= 'bullet_impact' then return end
    if anti_bruteforce_work.tick_work == GlobalVars.tickcount then return end
    if EngineClient_GetNetChannelInfo() == nil then return end
    if not EngineClient_IsConnected() then return end
    if not EntityList_GetLocalPlayer():IsAlive() then return end
    if not EntityList_GetPlayerForUserID(e:GetInt('userid')) then return end
    if not e:GetInt('userid') then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsAlive() == false then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsDormant() == true then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsTeamMate() == true then return end
    if roll_aa_active == true then return end
    if not enabled_antibrute:GetBool() then return end
    if enable_b2:GetBool() and not enable_b3:GetBool() and not enable_b4:GetBool() then
        stagesb = 1
    elseif enable_b3:GetBool() and enable_b2:GetBool() and not enable_b4:GetBool() then
        stagesb = 2
    elseif enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() then
        stagesb = 3
    else
        stagesb = 0
    end
    local impact = Vector_new(e:GetInt('x'), e:GetInt('y'), e:GetInt('z'))
    local eyepos = EntityList_GetPlayerForUserID(e:GetInt('userid')):GetEyePosition()
    local eye_pos = EntityList_GetLocalPlayer():GetEyePosition()

    local head_vec = bullet_impact(eye_pos, eyepos, impact)

    if anti_bruteforce_work.distance < 65 then
        anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count + 1
        --print(stagesb)
        if stagesb < anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count then
            anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = 0
        end
        anti_bruteforce_work_count = anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count
        text = string_format('Switch due to shot [dst: %.0f]', anti_bruteforce_work.distance)

        print(text)
        table_insert(hitlogs, {text = text, time = GlobalVars.realtime})
        table_insert(anti_bruteforce_work.work_memory, 1, {time = GlobalVars.realtime})
    end
end

function C_BasePlayer:GetFlag(shift)
    return bit_band(self:GetProp('m_fFlags'), bit_lshift(1, shift)) ~= 0
end

function get_enemies()
    local enemies = {}

    for _, player in pairs(EntityList_GetPlayers()) do
        if (not player:IsTeamMate() and player:IsAlive()) then
            table_insert(enemies, player:GetPlayer())
        end
    end

    return enemies
end

function C_BasePlayer:CanHit()
    local trace_info = Cheat_FireBullet(self, self:GetEyePosition(), EntityList_GetLocalPlayer():GetEyePosition())

    if (trace_info.damage > 0 and ((trace_info.trace.hit_entity and trace_info.trace.hit_entity:GetPlayer() == EntityList_GetLocalPlayer()) or false)) then
        return true
    end

    return false
end

function teleport_in_air()
    if (auto_teleport_in_air:GetBool() and teleport_weapons:Get() ~= 0 and Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):Get()) then
        local allow_teleport = false
        local enable_teleport = false

        local active_weapon = EntityList_GetLocalPlayer():GetActiveWeapon()
        if active_weapon == nil then return end
        local weapon_id = active_weapon:GetWeaponID()

        local is_AWP = weapon_id == 9
        local is_auto = (weapon_id == 38 or weapon_id == 11)
        local is_scout = weapon_id == 40
        local is_deagle = weapon_id == 1
        local is_r8 = weapon_id == 64
        local is_nades = active_weapon:IsGrenade()
        local is_pistols = active_weapon:IsPistol() and not is_deagle and not is_r8
        local is_smg = (weapon_id == 34 or weapon_id == 23 or weapon_id == 24 or weapon_id == 19 or weapon_id == 26 or weapon_id == 33 or weapon_id == 17)
        local is_shotguns = (weapon_id == 35 or weapon_id == 25 or weapon_id == 27 or weapon_id == 29)
        local is_rifle = active_weapon:IsRifle() and not is_smg and not is_shotguns
        local is_taser = weapon_id == 31

        for _, weapons in pairs({
            {Value = 1, active_weapon = is_AWP},
            {Value = 2, active_weapon = is_auto},
            {Value = 3, active_weapon = is_scout},
            {Value = 4, active_weapon = is_deagle},
            {Value = 5, active_weapon = is_r8},
            {Value = 6, active_weapon = is_nades},
            {Value = 7, active_weapon = not (is_AWP or is_auto or is_scout or is_deagle or is_r8 or is_nades or is_pistols or is_rifle or is_smg or is_shotguns or is_taser)},
            {Value = 8, active_weapon = is_pistols},
            {Value = 9, active_weapon = is_rifle},
            {Value = 10, active_weapon = is_smg},
            {Value = 11, active_weapon = is_shotguns},
            {Value = 12, active_weapon = is_taser}
        }) do
        if (teleport_weapons:Get(weapons.Value) and weapons.active_weapon) then
            allow_teleport = true
        end
    end

    if (allow_teleport) then
        for _, enemy in pairs(get_enemies()) do
            if (not enemy:IsDormant() and enemy:CanHit()) then
                enable_teleport = true
            end
        end
    end

    if (enable_teleport and not EntityList_GetLocalPlayer():GetFlag(0) and EntityList_GetLocalPlayer():GetProp('m_vecVelocity'):Length2D() > 25) then
        Exploits_ForceTeleport()
    end
end
end


function ang_vector(ang)
local forward, right = Vector_new(), Vector_new()

local pitch, yaw, roll = ang.pitch * math_pi / 180, ang.yaw * math_pi / 180, ang.roll * math_pi / 180
local cp = math_cos(pitch)
local sp = math_sin(pitch)

local cy = math_cos(yaw)
local sy = math_sin(yaw)

local cr = math_cos(roll)
local sr = math_sin(roll)

forward.x = cp * cy
forward.y = cp * sy
forward.z = -sp

right.x = -1 * sr * sp * cy + -1 * cr * -sy
right.y = -1 * sr * sp * sy + -1 * cr * cy
right.z = -1 * sr * cp

return forward, right
end

actual_move = Vector2_new(0, 0)

function roll_move_fix(cmd)
local frL, riL = ang_vector(QAngle_new(0, cmd.viewangles.yaw, 0))
local frC, riC = ang_vector(cmd.viewangles)

frL.z = 0
riL.z = 0
frC.z = 0
riC.z = 0

frL = frL / Vector_new(0, 0, 0).Length(frL)
riL = riL / Vector_new(0, 0, 0).Length(riL)
frC = frC / Vector_new(0, 0, 0).Length(frC)
riC = riC / Vector_new(0, 0, 0).Length(riC)

local world_coord = frL * actual_move.x + riL * actual_move.y;

cmd.sidemove = (frC.x * world_coord.y - frC.y * world_coord.x) / (riC.y * frC.x - riC.x * frC.y)
cmd.forwardmove = (riC.y * world_coord.x - riC.x * world_coord.y) / (riC.y * frC.x - riC.x * frC.y)
end
stagesb = 0
function anti_aims(cmd)
local entity_get_local_player = EntityList_GetLocalPlayer()
if entity_get_local_player == nil then return end
local velocity = entity_get_local_player:GetProp('m_vecVelocity'):Length2D()
if velocity == nil then return end
local ground = bit_band(entity_get_local_player:GetProp('m_hGroundEntity'), 1)
if ground == nil then return end
local crouch = entity_get_local_player:GetProp('m_flDuckAmount')
if crouch == nil then return end
local weapon = entity_get_local_player:GetActiveWeapon()
if weapon == nil then return end
local tickcount = GlobalVars.tickcount % 4 > 1
if anti_bruteforce_work.work == false then
    if conditions:GetBool() and enable__aa:GetBool() then
        if Cheat_IsKeyDown(0x45) and override_on_use:GetBool() then
            local C4 = EntityList_GetEntitiesByClassID(129);
            for C4i = 1, #C4 do
                defuse = entity_get_local_player:GetRenderOrigin():DistTo(C4[C4i]:GetRenderOrigin()) < 100
            end
            local plant = entity_get_local_player:GetProp('m_bInBombZone')
            local host = entity_get_local_player:GetProp('m_bIsGrabbingHostage')


            local weapon_id = weapon:GetWeaponID()
            if weapon_id == nil then return end
            if defuse then
                check = true
            elseif weapon_id == 49 and plant == true then
                check = true
            elseif host == true then
                check = true
            else
                check = false
            end
            if check == false then
                if original_aa then pitch_cache = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Get() original_aa = false end
                state_aa = 'legit'
                Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Set(0)
                ConVar.yaw:Set(yaw_on_use:Get())
                ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[On_Use].yaw_add_r:Get() or types[On_Use].yaw_add_l:Get())
                if types[On_Use].jitter_mode:Get() == 1 then
                    ConVar.jitter:Set(math.random(1, 4))
                else
                    ConVar.jitter:Set(types[On_Use].jitter:Get())
                end

                ConVar.jitter_value:Set(math.random(types[On_Use].jitter_value_min:Get(), types[On_Use].jitter_value_max:Get()))
                ConVar.left_desync_value:Set((types[On_Use].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[On_Use].left_desync_value:Get()) or types[On_Use].left_desync_value:Get()))
                ConVar.right_desync_value:Set((types[On_Use].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[On_Use].right_desync_value:Get()) or types[On_Use].right_desync_value:Get()))
                ConVar.fake_option:Set(types[On_Use].fake_option:Get())
                ConVar.lby_mode:Set(types[On_Use].lby_mode:Get())
                ConVar.freestand_desync:Set(types[On_Use].freestand_desync:Get())
                ConVar.desync_on_shot:Set(types[On_Use].desync_on_shot:Get())
                ConVar.fakelag:Set(types[On_Use].fakelag:Get())
                ConVar.fakelag_value:Set(types[On_Use].fakelag_value:Get())
                ConVar.random_value:Set(types[On_Use].random_value:Get())
                if types[On_Use].mega_shit:Get() and not weapon:IsGrenade() then
                    cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                    roll_aa_active = true
                    if ConVar.yaw:Get() == 2 then
                        ConVar.yaw_add:Set(-15)
                        AntiAim_OverrideInverter(false)
                    elseif ConVar.yaw:Get() == 3 then
                        ConVar.yaw_add:Set(15)
                        AntiAim_OverrideInverter(true)
                    else
                        ConVar.yaw_add:Set(5)
                        AntiAim_OverrideInverter(false)
                    end
                    AntiAim_OverrideLimit(60)

                else
                    roll_aa_active = false
                end
                if Cheat_IsKeyDown(0x45) then E = false if GlobalVars.realtime > legitaa_time + 0.2 then if E == false then EngineClient_ExecuteClientCmd('+use') E = true end if E == true then EngineClient_ExecuteClientCmd('-use') end end else  if E == true then EngineClient_ExecuteClientCmd('-use') E = false end end
            end
        elseif (ConVar.yaw:Get() == 3 or ConVar.yaw:Get() == 2) and override_manual:GetBool() then
            state_aa = 'manual'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Manual].yaw_add_r:Get() or types[Manual].yaw_add_l:Get())
            if types[Manual].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Manual].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Manual].jitter_value_min:Get(), types[Manual].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Manual].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Manual].left_desync_value:Get()) or types[Manual].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Manual].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Manual].right_desync_value:Get()) or types[Manual].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Manual].fake_option:Get())
            ConVar.lby_mode:Set(types[Manual].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Manual].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Manual].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Manual].fakelag:Get())
            ConVar.fakelag_value:Set(types[Manual].fakelag_value:Get())
            ConVar.random_value:Set(types[Manual].random_value:Get())
            if types[Manual].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif ground == 1 and override_air:GetBool() then
            state_aa = 'air'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Air].yaw_add_r:Get() or types[Air].yaw_add_l:Get())
            if types[Air].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Air].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Air].jitter_value_min:Get(), types[Air].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Air].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Air].left_desync_value:Get()) or types[Air].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Air].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Air].right_desync_value:Get()) or types[Air].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Air].fake_option:Get())
            ConVar.lby_mode:Set(types[Air].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Air].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Air].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Air].fakelag:Get())
            ConVar.fakelag_value:Set(types[Air].fakelag_value:Get())
            ConVar.random_value:Set(types[Air].random_value:Get())
            if types[Air].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif (crouch >= 0.7) and override_crouch:GetBool() then
            state_aa = 'crouching'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Crouch].yaw_add_r:Get() or types[Crouch].yaw_add_l:Get())
            if types[Crouch].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Crouch].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Crouch].jitter_value_min:Get(), types[Crouch].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Crouch].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Crouch].left_desync_value:Get()) or types[Crouch].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Crouch].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Crouch].right_desync_value:Get()) or types[Crouch].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Crouch].fake_option:Get())
            ConVar.lby_mode:Set(types[Crouch].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Crouch].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Crouch].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Crouch].fakelag:Get())
            ConVar.fakelag_value:Set(types[Crouch].fakelag_value:Get())
            ConVar.random_value:Set(types[Crouch].random_value:Get())
        elseif ConVar.slowwalk:Get() and override_slowwalk:GetBool() then
            state_aa = 'slowwalking'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[SlowWalk].yaw_add_r:Get() or types[SlowWalk].yaw_add_l:Get())
            if types[SlowWalk].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[SlowWalk].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[SlowWalk].jitter_value_min:Get(), types[SlowWalk].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[SlowWalk].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[SlowWalk].left_desync_value:Get()) or types[SlowWalk].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[SlowWalk].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[SlowWalk].right_desync_value:Get()) or types[SlowWalk].right_desync_value:Get()))
            ConVar.fake_option:Set(types[SlowWalk].fake_option:Get())
            ConVar.lby_mode:Set(types[SlowWalk].lby_mode:Get())
            ConVar.freestand_desync:Set(types[SlowWalk].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[SlowWalk].desync_on_shot:Get())
            ConVar.fakelag:Set(types[SlowWalk].fakelag:Get())
            ConVar.fakelag_value:Set(types[SlowWalk].fakelag_value:Get())
            ConVar.random_value:Set(types[SlowWalk].random_value:Get())
            if types[SlowWalk].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif velocity > 5 and override_move:GetBool() then
            state_aa = 'moving'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Move].yaw_add_r:Get() or types[Move].yaw_add_l:Get())
            if types[Move].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Move].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Move].jitter_value_min:Get(), types[Move].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Move].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Move].left_desync_value:Get()) or types[Move].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Move].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Move].right_desync_value:Get()) or types[Move].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Move].fake_option:Get())
            ConVar.lby_mode:Set(types[Move].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Move].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Move].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Move].fakelag:Get())
            ConVar.fakelag_value:Set(types[Move].fakelag_value:Get())
            ConVar.random_value:Set(types[Move].random_value:Get())
            if types[Move].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif (velocity <= 2 and crouch < 0.7) and override_stand:GetBool() then
            state_aa = 'standing'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Stay].yaw_add_r:Get() or types[Stay].yaw_add_l:Get())
            if types[Stay].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Stay].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Stay].jitter_value_min:Get(), types[Stay].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Stay].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Stay].left_desync_value:Get()) or types[Stay].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Stay].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Stay].right_desync_value:Get()) or types[Stay].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Stay].fake_option:Get())
            ConVar.lby_mode:Set(types[Stay].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Stay].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Stay].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Stay].fakelag:Get())
            ConVar.fakelag_value:Set(types[Stay].fakelag_value:Get())
            ConVar.random_value:Set(types[Stay].random_value:Get())
            if types[Stay].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        else
            state_aa = 'shared'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Shared].yaw_add_r:Get() or types[Shared].yaw_add_l:Get())
            if types[Shared].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Shared].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Shared].jitter_value_min:Get(), types[Shared].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Shared].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Shared].left_desync_value:Get()) or types[Shared].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Shared].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Shared].right_desync_value:Get()) or types[Shared].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Shared].fake_option:Get())
            ConVar.lby_mode:Set(types[Shared].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Shared].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Shared].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Shared].fakelag:Get())
            ConVar.fakelag_value:Set(types[Shared].fakelag_value:Get())
            ConVar.random_value:Set(types[Shared].random_value:Get())
            if types[Shared].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        end
    elseif not conditions:GetBool() and anti_bruteforce_work.work == false and enable__aa:GetBool() then
        state_aa = 'off'
        ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[anti_aim_preset].yaw_add_r:Get() or types[anti_aim_preset].yaw_add_l:Get())
        if types[anti_aim_preset].jitter_mode:Get() == 1 then
            ConVar.jitter:Set(math.random(1, 4))
        else
            ConVar.jitter:Set(types[anti_aim_preset].jitter:Get())
        end
        ConVar.jitter_value:Set(math.random(types[anti_aim_preset].jitter_value_min:Get(), types[anti_aim_preset].jitter_value_max:Get()))
        ConVar.left_desync_value:Set((types[anti_aim_preset].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[anti_aim_preset].left_desync_value:Get()) or types[anti_aim_preset].left_desync_value:Get()))
        ConVar.right_desync_value:Set((types[anti_aim_preset].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[anti_aim_preset].right_desync_value:Get()) or types[anti_aim_preset].right_desync_value:Get()))
        ConVar.fake_option:Set(types[anti_aim_preset].fake_option:Get())
        ConVar.lby_mode:Set(types[anti_aim_preset].lby_mode:Get())
        ConVar.freestand_desync:Set(types[anti_aim_preset].freestand_desync:Get())
        ConVar.desync_on_shot:Set(types[anti_aim_preset].desync_on_shot:Get())
        ConVar.fakelag:Set(types[anti_aim_preset].fakelag:Get())
        ConVar.fakelag_value:Set(types[anti_aim_preset].fakelag_value:Get())
        ConVar.random_value:Set(types[anti_aim_preset].random_value:Get())
        if types[anti_aim_preset].mega_shit:Get() and not weapon:IsGrenade() then
            cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
            roll_aa_active = true
            if ConVar.yaw:Get() == 2 then
                ConVar.yaw_add:Set(-15)
                AntiAim_OverrideInverter(false)
            elseif ConVar.yaw:Get() == 3 then
                ConVar.yaw_add:Set(15)
                AntiAim_OverrideInverter(true)
            else
                ConVar.yaw_add:Set(5)
                AntiAim_OverrideInverter(false)
            end
            AntiAim_OverrideLimit(60)
        else
            roll_aa_active = false
        end
    end
elseif anti_bruteforce_work.work == true and  enabled_antibrute:GetBool() then

    local phase = {
        [0] = phase1,
        [1] = phase2,
        [2] = phase3,
        [3] = phase4
    }
    override_limit(phase[anti_bruteforce_work.memory[nearest():EntIndex()].count]:Get(),true)

    --ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b:Get() or yaw_add_l_b:Get())
    --ConVar.jitter:Set(jitter_b:Get())
    --ConVar.jitter_value:Set(jitter_value_b:Get())
    --ConVar.lby_mode:Set(lby_mode_b:Get())
    --yaw_add_l_b
    --yaw_add_r_b
    --jitter_b
    --jitter_value_b
    --lby_mode_b

end
if manual_yaw_base:Get() ~= 0 and not (Cheat_IsKeyDown(0x45) and override_on_use:GetBool()) then ConVar.yaw:Set(manual_yaw_base:Get() - 1) end
if not Cheat_IsKeyDown(0x45) then legitaa_time = GlobalVars.realtime if not original_aa then Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Set(pitch_cache) original_aa = true end end
if avoid_backstab:GetBool() then
    all_players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #all_players do
        enemy = all_players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and not enemy:IsDormant() and enemy:IsAlive() and enemy:GetActiveWeapon() ~= nil and enemy:GetActiveWeapon():IsKnife() then
            enemy_origin = enemy:GetProp('m_vecOrigin')
            if 300 >= EntityList_GetLocalPlayer():GetRenderOrigin():DistTo(enemy:GetProp('m_vecOrigin')) then
                AntiAim_OverrideYawOffset(180)
            end
        end
    end
end

end


baim_hitboxes = {2,3,4}

function extrapolate_position(xpos,ypos,zpos,ticks,player)
    local x,y,z = player:GetProp('m_vecVelocity').x, player:GetProp('m_vecVelocity').y, player:GetProp('m_vecVelocity').z
    for i = 0, ticks do
        xpos =  xpos + (x * GlobalVars.interval_per_tick)
        ypos =  ypos + (y * GlobalVars.interval_per_tick)
        zpos =  zpos + (z * GlobalVars.interval_per_tick)
    end
    return xpos,ypos,zpos
end

lethalplayer = false

function is_baimable(ent, localplayer)   
    local final_damage = 0

    local eyepos = EntityList_GetLocalPlayer():GetEyePosition()
    local fs_stored_eyepos

    eyepos_x = extrapolate_position(eyepos.x, eyepos.y, eyepos.z, 20, localplayer)

    fs_stored_eyepos = eyepos

    for k,v in pairs(baim_hitboxes) do
        local hitbox = ent:GetHitboxCenter(v)

        local dmg = Cheat_FireBullet(localplayer, fs_stored_eyepos, Vector_new(hitbox.x, hitbox.y, hitbox.z)).damage
        
        if ( dmg > final_damage) then
            final_damage = dmg
        end
    end
    
    return final_damage
end

function proper_baim_lethal()
    local me = EntityList_GetLocalPlayer()
    local weapon = me:GetActiveWeapon()
    if weapon == nil or weapon:IsKnife() or weapon:IsGrenade() then
        lethalplayer = false
        return
    end
    
    all_players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #all_players do
        enemy = all_players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and enemy:IsAlive() and not enemy:IsDormant() then
            local enemy_index = enemy:EntIndex()
            if enemy_index == nil then return end
            local target_health = enemy:GetProp('m_iHealth')
            local is_lethal = is_baimable(enemy, me) >= target_health
            if target_health <= 0 then return end

            if is_lethal then
                lethalplayer = true
                
                RageBot.EnableHitbox(enemy_index, 0, false)
                RageBot.EnableHitbox(enemy_index, 1, false)
                for i=5, 18 do
                    RageBot.ForceHitboxSafety(enemy_index, 2)
                    RageBot.ForceHitboxSafety(enemy_index, 4)
                    RageBot.SetHitboxPriority(enemy_index, 3, 100)
                    RageBot.EnableHitbox(enemy_index, 2, true)
                    RageBot.EnableHitbox(enemy_index, 3, true)
                    RageBot.EnableHitbox(enemy_index, 4, true)
                    RageBot.EnableHitbox(enemy_index, i, false)
                    
                end
            else
                lethalplayer = false
            end
        else
            lethalplayer = false
        end
    end
end
ESP.CustomText('Proper Body Aim if Lethal', 'enemies', 'BAIM', function(ent)
    if not EntityList_GetLocalPlayer() or ent == nil then return end
    local target_health = ent:GetProp('m_iHealth')
    if target_health == nil or EntityList_GetLocalPlayer():GetActiveWeapon() == nil or EntityList_GetLocalPlayer():GetActiveWeapon():GetWeaponDamage() == nil then return end
    is_lethal = EntityList_GetLocalPlayer():GetActiveWeapon():GetWeaponDamage() >= target_health
    if lethalplayer and is_lethal then
        return 'BAIM'
    else
        return false
    end
end)
local original_aaa = true
local legitaa_timea = GlobalVars.realtime
function ideal_peek()
if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() then
    if original_aaa then
        yaw_base_cache = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Get()
        original_aaa = false
    end
    Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Set(5)
elseif Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() and (manual_yaw_base:Get() == 4 or manual_yaw_base:Get() == 5) then
    if not original_aaa then
        Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Set(yaw_base_cache)
        original_aaa = true
    end
    legitaa_timea = GlobalVars.realtime
end
end
local pixel9 = Render_InitFont('nl\alien\fonts\small_pixel.ttf', 9)
local verdanabd11 = Render_InitFont('Verdana', 11, {'b'})
local verdana11_r = Render_InitFont('verdana', 11, {'r'})
local verdana12 = Render_InitFont('verdana', 12)
local verdana23 = Render_InitFont('verdana', 20, {'b'})
local lucida_console = Render_InitFont('lucida console', 10, {'r'})
local arrows = Render_InitFont('nl\alien\fonts\arrows.ttf', 14)
local arrows18 = Render_InitFont('nl\alien\fonts\arrows.ttf', 20)
local dt_circle = 0

function update_enemies()
    local localplayer = EntityList_GetClientEntity(EngineClient_GetLocalPlayer())
    if not localplayer then return end
 
    local my_index = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not my_index then return end

    if EngineClient_IsConnected() and my_index:IsAlive() then
        local players = EntityList_GetEntitiesByName('CCSPlayer')
        local fov_enemy, maximum_fov = nil, 180
      
        for i = 1, #players do
            local enemy = players[i]:GetPlayer()
            if enemy ~= my_index and not enemy:IsTeamMate() and enemy:IsAlive() then
                local my_origin = my_index:GetRenderOrigin()
                local enemy_origin = enemy:GetRenderOrigin()

                local world_to_screen = (my_origin.x - enemy_origin.x == 0 and my_origin.y - enemy_origin.z == 0) and 0 or math_deg(math_atan2( my_origin.y - enemy_origin.y, my_origin.x - enemy_origin.x)) - EngineClient_GetViewAngles().yaw + 180

                local calculated_fov = math_abs(normalize_yaw(world_to_screen))
                if not fov_enemy or calculated_fov <= maximum_fov then
                    fov_enemy = enemy
                    maximum_fov = calculated_fov
                end
            end
        end

        return ({enemy = fov_enemy, fov = maximum_fov})
    end
end
function deg2rad(x)
return x * (math.pi / 180.0)
end

function Render_pd_Indicator(text, y2, y1, color, size, font, outline)
local textsize = Render_CalcTextSize(text, size, font)
Render_Text(text, Vector2_new(screen_size.x/2-textsize.x/2-y1, screen_size.y/2+y2), color, size, font, outline)
end
cock1 = false
cock = false
local function render_text(text, pos, color, size, text_font, outline, align)
local text_size = Render.CalcTextSize(text, size, text_font)
if outline == 1 then
    cock = true
    cock1 = false
elseif outline == 2 then
    cock1 = true
    cock = false
else
    cock1 = false
    cock = false
end
if align == 0 then -- To the left
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x+1 - text_size.x, pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, Vector2.new(pos.x - text_size.x, pos.y), color, size, text_font, cock)
elseif align == 1 then -- To the center
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x + 1 - (text_size.x / 2), pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, Vector2.new(pos.x - (text_size.x / 2), pos.y), color, size, text_font, cock)
elseif align == 2 then -- To the right
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x + 1, pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, pos, color, size, text_font, cock)
end
end

function lerp(a, b, t)
return a + (b - a) * t
end

function angle_to_vec(pitch, yaw)
    local p = pitch / 180 * math_pi
    local y = yaw / 180 * math_pi

    local sin_p = math_sin(p)
    local cos_p = math_cos(p)
    local sin_y = math_sin(y)
    local cos_y = math_cos(y)

    return {cos_p * cos_y, cos_p * sin_y, -sin_p}
end

function calculate_angles(local_x, local_y, enemy_x, enemy_y)
    local delta_y = local_y - enemy_y
    local delta_x = local_x - enemy_x

    local relative_yaw = math.atan(delta_y / delta_x)
    relative_yaw = normalize_yaw(relative_yaw * 180 / math_pi)

    if delta_x >= 0 then
        relative_yaw = normalize_yaw(relative_yaw + 180)
    end
 
    return relative_yaw
end

function deg2rad(x)
    return x * (math_pi / 180.0)
end

function get_hit_side()
    local local_player = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not local_player then return end

    if EngineClient_IsConnected() and local_player:IsAlive() then
        local data, current_enemy = update_enemies(), nil
        if data ~= nil then
            current_enemy = data.enemy
        end
      
        if current_enemy ~= nil and current_enemy:IsAlive() then
            local predict_damage = function(x, y, z)
                local a, b, c = {}, {}, {}
                local enemy_head_position = current_enemy:GetHitboxCenter(1)
                local ticks = 40

                a[1], b[1], c[1] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z
                a[2], b[2], c[2] = enemy_head_position.x + ticks, enemy_head_position.y, enemy_head_position.z
                a[3], b[3], c[3] = enemy_head_position.x - ticks, enemy_head_position.y, enemy_head_position.z
              
                a[4], b[4], c[4] = enemy_head_position.x, enemy_head_position.y + ticks, enemy_head_position.z
                a[5], b[5], c[5] = enemy_head_position.x, enemy_head_position.y - ticks, enemy_head_position.z

                a[6], b[6], c[6] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z + ticks
                a[7], b[7], c[7] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z - ticks

                for i = 1, 7, 1 do
                    local damage = 0
                    local trace_damage = Cheat_FireBullet(current_enemy, Vector_new(a[i], b[i], c[i]), Vector_new(x, y, z)).damage
          
                    if trace_damage > damage then
                        damage = trace_damage
                    end
          
                    return damage
                end
            end

            local my_eye_position = local_player:GetEyePosition()
            local enemy_head_position = current_enemy:GetHitboxCenter(0)
            local calculated_yaw = calculate_angles(my_eye_position.x, my_eye_position.y, enemy_head_position.x, enemy_head_position.y)

            local left_direction_x, left_direction_y = angle_to_vec(0, (calculated_yaw + 90)), angle_to_vec(0, (calculated_yaw + 90))

            local right_direction_x, right_direction_y = angle_to_vec(0, (calculated_yaw - 90)), angle_to_vec(0, (calculated_yaw - 90))
          
            local rend_x = my_eye_position.x + right_direction_x[1] * 10
            local rend_y = my_eye_position.y + right_direction_y[1] * 10

            local lend_x = my_eye_position.x + left_direction_x[1] * 10
            local lend_y = my_eye_position.y + left_direction_y[1] * 10

            local rend_x_2 = my_eye_position.x + right_direction_x[1] * 100
            local rend_y_2 = my_eye_position.y + left_direction_y[1] * 100

            local lend_x_2 = my_eye_position.x + left_direction_x[1] * 100
            local lend_y_2 = my_eye_position.y + left_direction_y[1] * 100
          
            local left_trace = predict_damage(rend_x, rend_y, my_eye_position.z)
            local right_trace = predict_damage(lend_x, lend_y, my_eye_position.z)
            local left_trace_2 = predict_damage(rend_x_2, rend_y_2, my_eye_position.z)
            local right_trace_2 = predict_damage(lend_x_2, lend_y_2, my_eye_position.z)

            local hit_side = ((left_trace > 0 or right_trace > 0 or left_trace_2 > 0 or right_trace_2 > 0) and (left_trace > right_trace and 0.5 or right_trace > left_trace and -0.5 or left_trace_2 > right_trace_2 and 1 or right_trace_2 > left_trace_2 -1) or 0.0)

            return hit_side
        end
    end
end
function is_defensive()
    local state, shifting = false, 0
    local local_player = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not local_player then return end
    if Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):GetBool() then
        local hit_side = get_hit_side()
        if hit_side == true or hit_side == false then
            hit_side = 0
            state = false
            shifting = nil
        end

        if hit_side ~= nil then
            if hit_side > 0 then
                state = true

                local tickbase = local_player:GetProp('m_nTickBase')
                local next_attack = local_player:GetProp('m_flNextAttack')
                local next_primary_attack = local_player:GetActiveWeapon():GetProp('m_flNextPrimaryAttack')

                local ticks = GlobalVars.interval_per_tick * (tickbase - 16)
                local shifting_tickbase = (ticks - next_primary_attack) * 2

                if shifting_tickbase <= 3 then shifting_tickbase = shifting_tickbase + (next_attack * 0.001) * 2 end

                if shifting_tickbase >= 17 then shifting_tickbase = 17 end
                shifting_tickbase = math_floor(shifting_tickbase)

                shifting = shifting_tickbase
            else
                state = false
                shifting = nil
            end
        else
            state = false
            shifting = nil
        end
    else
        state = false
        shifting = nil
    end

    return ({
        state = state,
        value = shifting
    })
end
function math_lerp(time,a,b)
return a * (1-time) + b * time
end
local pixel7 = Render.InitFont('Smallest Pixel-7', 10)
bar_antibrute = 0
prediction_anim = 0
cur_dmg = 0
verdana25 = Render_InitFont('verdana', 25)
tahoma_bold13 = Render_InitFont('tahoma', 13, {'b'})
a_width = 0
function get_dormant_enemy()
    local ret = {}

    local players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #players do
        local enemy = players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and enemy:IsAlive() then
            if enemy:IsDormant() then
                table_insert(ret, enemy)
            end
        end
    end
                          
    return #ret
end
function indicators()
if not EngineClient_IsConnected() or not EntityList_GetLocalPlayer():IsAlive() then return end
local velocity = Vector_new(EntityList_GetLocalPlayer():GetProp('m_vecVelocity[0]'), EntityList_GetLocalPlayer():GetProp('m_vecVelocity[1]'), EntityList_GetLocalPlayer():GetProp('m_vecVelocity[2]'))
if velocity == nil then return end
local isDoubletap = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):GetBool()
local isPeek = Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool()
local isHideshots = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Hide Shots'):GetBool()
local isSafe = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Safe Points'):Get() == 2
local isBody = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Body Aim'):Get() == 2
local yaw_base = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Get()
local isDuck = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Fake Duck'):GetBool()
local crouch = EntityList_GetLocalPlayer():GetProp('m_flDuckAmount')
if crouch == nil then return end
local ground = bit_band(EntityList_GetLocalPlayer():GetProp('m_fFlags'), bit_lshift(1,0)) == 0
if ground == nil then return end
if dmg_type == 1 or dmg_type == 2 then
    cur_dmg = prsd_damage
else
    cur_dmg = Menu_FindVar('Aimbot', 'Ragebot', 'Accuracy', 'Minimum Damage'):GetInt()
    if cur_dmg == 0 then cur_dmg = 'auto' elseif cur_dmg > 100 then cur_dmg = '+'..cur_dmg-100 end
end
if cur_dmg == nil then return end
local isDmg = false
local isPing = false
local binds = Cheat_GetBinds()
for i = 1, #binds do
    local bind = binds[i]

    if bind:GetName() == 'Minimum Damage' and bind:IsActive() then
        isDmg = true
    end
    if bind:GetName() == 'Fake Ping' and bind:IsActive() then
        isPing = true
    end
end
local frames = GlobalVars.frametime*20
bar_antibrute = math_lerp(GlobalVars.frametime*20,bar_antibrute, (anti_bruteforce_work.work == true) and 1 or 0)
if indicators_style:GetBool(1) then
    add_y = 20

    add_y = add_y + 4
    if indicators_add:GetBool(3) then
        Render_PolyFilled(AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), Vector2_new(screen_size.x/2 + 30 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)), screen_size.y/2 + (30 * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)))), Vector2_new(screen_size.x/2 + 40 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)), screen_size.y/2 + (40) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1))), Vector2_new(screen_size.x/2 + 26 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1) - math_rad(20)), screen_size.y/2 + (26) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1) - math_rad(20))));
        Render_PolyFilled(AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Vector2_new(screen_size.x/2 + (30 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1))), screen_size.y/2 + (30 * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1)))), Vector2_new(screen_size.x/2 + (40) * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1)), screen_size.y/2 + (40) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1))), Vector2_new(screen_size.x/2 + (26) * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1) + math_rad(20)), screen_size.y/2 + (26) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1) + math_rad(20))));
        add_y = add_y + 25
    end
    if indicators_add:GetBool(1) then
        add_y = add_y + 9
        local alpha = math_sin(math_abs(-math_pi + GlobalVars.realtime * 1 % (math_pi * 2.0)))


        --Render_pd_Indicator('beta', add_y-17, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, alpha), 9, pixel9, true)

        Render_pd_Indicator('alien.lua°', add_y-11, -1, Color_new(0, 0, 0, 0.5), 11, verdanabd11, false)
        Render_pd_Indicator('alien', add_y-11, 13, AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 11, verdanabd11, false)
        Render_pd_Indicator('.lua°', add_y-11, -13, AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 11, verdanabd11, false)

    end

    --bar_antibrute*8
    if roll_aa_active == true then
        state = '/roll/'
    elseif ground then
        state = '/aerobic/'
    elseif crouch >= 1 then
        state = '/crouch/'
    elseif isSlow then
        state = '/slowwalk/'
    elseif velocity:Length2D() > 5 then
        state = '/running/'
    else
        state = '/standing/'
    end

    if indicators_add:GetBool(2) then
        if anti_bruteforce_work.work then
            Render_BoxFilled(Vector2_new(screen_size.x/2-26, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+3+add_y+3), Color_new(0, 0, 0, bar_antibrute/1.2))
            Render_BoxFilled(Vector2_new(screen_size.x/2-26 + 1, screen_size.y/2+2+add_y+2), Vector2_new(screen_size.x/2 + math_min((3.5 - anti_bruteforce_work.work_value / 0.569) * 7.2, 26), screen_size.y/2+3+add_y+2), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, bar_antibrute))
        else
            Render_GradientBoxFilled(Vector2_new(screen_size.x/2+25, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+6+add_y+1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0))
            Render_GradientBoxFilled(Vector2_new(screen_size.x/2-25, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2-26, screen_size.y/2+6+add_y+1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0))
            Render_BoxFilled(Vector2_new(screen_size.x/2, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+3+add_y+1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1))
            Render_BoxFilled(Vector2_new(screen_size.x/2, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2-26, screen_size.y/2+3+add_y+1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
        end
        add_y = add_y + 6
    end

    if indicators_add:GetBool(4) then
        Render_pd_Indicator(state, bar_antibrute*1 + add_y, 0, Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(5) and isDoubletap then
        dt_circle = math_lerp(frames/2, dt_circle, Exploits_GetCharge())
        Render_pd_Indicator('dt', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, math_max(0.2, dt_circle)), 9, pixel9, true)
        Render_Circle(Vector2_new(screen_size.x / 2 + 10, screen_size.y / 2 + 5 + bar_antibrute*1 + add_y), 3.6, 32, Color_new(0, 0, 0, math_max(0.2, dt_circle)), 3)
        Render_Circle(Vector2_new(screen_size.x / 2 + 10, screen_size.y / 2 + 5 + bar_antibrute*1 + add_y), 3.6, 32, Color_new(1, 1, 1, math_max(0.2, dt_circle)), 2, -180, -180 + 360 *dt_circle)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(6) and isHideshots then
        Render_pd_Indicator('os', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(7) and isDmg then
        Render_pd_Indicator('dmg', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(8) and isBody then
        Render_pd_Indicator('body', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(9) and isSafe then
        Render_pd_Indicator('safe', bar_antibrute*1 + add_y, 0, isSafe and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(10) and yaw_base == 5 then
        Render_pd_Indicator('fs', bar_antibrute*1 + add_y, 0, yaw_base == 5 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(11) and isPeek and isDoubletap and Exploits_GetCharge() ~= 1.0 then
        Render_pd_Indicator('+CHARGED IDEAL TICK+', -26, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end

end
if indicators_style:GetBool(2) then
    local acatel_style_2 = "-"
    if AntiAim_GetInverterState() then
        acatel_style_2 = "LEFT"
    else
        acatel_style_2 = "RIGHT"
    end
    local ind_dst = 0
    render_text('ALIEN', Vector2.new(screen_size.x/2, screen_size.y/2 + 30), Color.new(1, 1, 1, 1), 10, pixel7, 1, 2)
    render_text('BETA', Vector2.new(screen_size.x/2 + Render.CalcTextSize("ALIEN", 10, pixel7).x, screen_size.y/2 + 30), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, (math.floor(math.sin(GlobalVars.curtime * 2) * 220 + 221)) / 1000 * 6.92), 10, pixel7, 1, 2)
    --

    render_text("SMART:", Vector2.new(screen_size.x/2, screen_size.y/2 + 38.5), Color.RGBA(220, 91, 97, 255), 10, pixel7, 1, 2)
    render_text(acatel_style_2, Vector2.new(screen_size.x/2 + 29, screen_size.y/2 + 38.5), Color.RGBA(138, 137, 204, 255), 10, pixel7, 1, 2)
    --
    if isDoubletap then
        if Exploits_GetCharge() <= 0 then dt_color = Color.RGBA(255, 0, 0, 255) else dt_color = Color.RGBA(0, 255, 0, 255) end
    else
        dt_color = Color.new(0.3, 0.3, 0.3, 1)
    end
    --
    render_text("DT", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + ind_dst), dt_color, 10, pixel7, 1, 2)
    render_text("HS", Vector2.new(screen_size.x/2 + 11, screen_size.y/2 + 46 + ind_dst), isHideshots and Color_new(1, 1, 1, 1) or Color_new(0.3, 0.3, 0.3, 1), 10, pixel7, 1, 2)
    render_text("FS", Vector2.new(screen_size.x/2 + 23, screen_size.y/2 + 46 + ind_dst), yaw_base == 5 and Color.new(1, 1, 1, 1) or Color.new(0.3, 0.3, 0.3, 1), 10, pixel7, 1, 2)
    render_text("M:B", Vector2.new(screen_size.x/2 + 35, screen_size.y/2 + 46 + ind_dst), Color.new(1,1,1,1), 10, pixel7, 1, 2)
end
if indicators_style:GetBool(3) then
    add_y = 0

    if isPing then
        render_text("ping-spike", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 12, verdana12, 2, 1)
        textb = "ping-spike"
        add_y = add_y + 9
    end

    if isDuck then
        render_text("fake-duck", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, crouch), 12, verdana12, 2, 1)
        textb = "fake-duck"
        add_y = add_y + 9
    end

    if isHideshots then
        render_text("on-shot aa", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 12, verdana12, 2, 1)
        textb = "on-shot aa"
        add_y = add_y + 9
    end

    if isDoubletap then
        render_text("double-tap", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Exploits_GetCharge() == 1 and Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(0.4, 0.4, 0.4, 1), 12, verdana12, 2, 1)
        textb = "double-tap"
        add_y = add_y + 9
    end

    if isDmg then
        render_text("damage: "..cur_dmg, Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        textb = "damage: "..cur_dmg
        add_y = add_y + 9
    end

    if yaw_base == 5 then
        render_text("freestanding", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        textb = "freestanding"
        add_y = add_y + 9
    end

    if isDoubletap or isHideshots or yaw_base == 5 or isDmg or isPing or isDuck then
        text_sizeb = Render.CalcTextSize(textb, 12, verdana12)
        render_text("alien.lua", Vector2.new(screen_size.x/2, screen_size.y/2 + 28), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(0, 0, 0, 0.3), Color.new(0, 0, 0, 0.3), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
        Render.BoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+43), Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+44), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 - 4 - text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 + 4 + text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
    end
end
if indicators_style:GetBool(4) then
    render_text('alien.lua', Vector2.new(screen_size.x/2, screen_size.y/2 + 32 ), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 10, pixel7, 1, 1)
    ind_dst = 0
    local aa_status = "STANDING"
    if ground then
        aa_status = "AIR"
    elseif crouch > 0.8 then
        aa_status = "CROUCHING"
    elseif isSlow then
        aa_status = "SLOWWALK"
    else
        aa_status = "STANDING"
    end
    render_text(aa_status, Vector2.new(screen_size.x/2, screen_size.y/2 + 40), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 10, pixel7, 1, 1)

    if isDoubletap then
        if Exploits_GetCharge() <= 0 then dt_color = Color.new(0.5, 0.5, 0.5, 1) else dt_color = Color.RGBA(0, 255, 0, 255) end
    else
        dt_color = Color.new(0.5, 0.5, 0.5, 1)
    end
    render_text("DT", Vector2.new(screen_size.x/2 - 8, screen_size.y/2 + 48), dt_color, 10, pixel7, 1, 0)

    if yaw_base == 5 then arctic_fs =  Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) else arctic_fs = Color.new(0.5, 0.5, 0.5, 1) end
    render_text("FS", Vector2.new(screen_size.x/2, screen_size.y/2 + 48 + ind_dst), arctic_fs, 10, pixel7, 1, 1)

    if isHideshots then arctic_hs =  Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) else arctic_hs = Color.new(0.5, 0.5, 0.5, 1) end
    render_text("HS", Vector2.new(screen_size.x/2 + 8, screen_size.y/2 + 48), arctic_hs, 10, pixel7, 1, 2)
end
if indicators_style:GetBool(5) then
    add_y = 30
    local alpha = math_floor(math_sin(math_abs(-math_pi + (GlobalVars.curtime * (1.25 / .75)) % (math_pi * 2))) * 200)
    Render_Text('alien', Vector2_new(screen_size.x/2, screen_size.y/2+add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    Render_Text('lua', Vector2_new(screen_size.x / 2 + 27, screen_size.y / 2 + add_y), Color_RGBA(200, 200, 200, alpha), 9, pixel9, true)
    add_y = add_y + 9
    --get_dormant_enemy
    local data, current_enemy = update_enemies(), nil
    if data ~= nil then
        current_enemy = data.enemy
    end
    if roll_aa_active then
        Render_Text('EXPLOITING:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

        Render_Text('z°', Vector2_new(screen_size.x / 2 + 50, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    elseif anti_bruteforce_work.work then
        Render_Text('ANTI ', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

        local counter = anti_bruteforce_work_count
        local side = AntiAim_GetInverterState() and 1 or -1
        local timer = math_floor(anti_bruteforce_work.work_value * 25.1)

        Render_Text(('BRUTEFORCE[%s][%s][%s%%]'):format(counter, side, timer), Vector2_new(screen_size.x / 2 + 21, screen_size.y / 2 + add_y),Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    else
        if is_defensive().state then
            if is_defensive().value ~= nil then
                Render_Text('DEFENSIVE:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

                Render_Text(('%s'):format(is_defensive().value), Vector2_new(screen_size.x / 2 + 47, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
            end
        else
            Render_Text('BODY', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(197, 122, 108, 255), 9, pixel9, true)

            Render_Text(' YAW: ', Vector2_new(screen_size.x / 2 + 16, screen_size.y / 2 + add_y), Color_RGBA(197, 122, 108, 255), 9, pixel9, true)

            Render_Text(AntiAim_GetInverterState() and 'R' or 'L', Vector2_new(screen_size.x / 2 + 40, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
        end
    end
    add_y = add_y + 9
    Render_Text('DORMANCY:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 201, 132, 255), 9, pixel9, true)
    Render_Text(('%s'):format(get_dormant_enemy()), Vector2_new(screen_size.x / 2 + 45, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    if isDoubletap then
        add_y = add_y + 9
        Render_Text('DT', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Exploits_GetCharge() == 1 and Color_RGBA(133, 235, 89, 255) or Color_RGBA(244, 11, 12, 255), 9, pixel9, true)
    end
    if isHideshots then
        add_y = add_y + 9
        Render_Text('HS', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 211, 168, 255), 9, pixel9, true)
    end
    if isDmg then
        add_y = add_y + 9
        Render_Text('DMG', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    end
end
if screen_dmg:GetBool() then
    Render_Text(isDmg and '1' or '0', Vector2_new(screen_size.x / 2-25+screen_dmg_x:GetInt(), (screen_size.y - 200) / 2.5+45+screen_dmg_y:GetInt()), Color_RGBA(255, 255, 255, 255), 12, verdana12)
    Render_Text(tostring(cur_dmg), Vector2_new(screen_size.x / 2+screen_dmg_x:GetInt(), (screen_size.y - 200) / 2.5+45 +screen_dmg_y:GetInt()), Color_RGBA(255, 255, 255, 255), 12, verdana12)
end
if arrows_ind:Get() == 1 then
    Render_PolyFilled(yaw_base == 2 and ind_clr:GetColor() or Color_RGBA(35, 35, 35, 150), Vector2_new(screen_size.x / 2 + 55, screen_size.y / 2 - 2 + 2), Vector2_new(screen_size.x / 2 + 42, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 + 42, screen_size.y / 2 - 2 + 11))
    Render_PolyFilled(yaw_base == 3 and ind_clr:GetColor() or Color_RGBA(35, 35, 35, 150), Vector2_new(screen_size.x / 2 - 55, screen_size.y / 2 - 2 + 2), Vector2_new(screen_size.x / 2 - 42, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 - 42, screen_size.y / 2 - 2 + 11))

    Render_BoxFilled(Vector2_new(screen_size.x / 2 + 38, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 + 38 + 2, screen_size.y / 2 - 2 - 7 + 18), AntiAim_GetInverterState() == false and ind_clr2:GetColor() or Color_RGBA(35, 35, 35, 150))
    Render_BoxFilled(Vector2_new(screen_size.x / 2 - 40, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 - 38, screen_size.y / 2 - 2 - 7 + 18), AntiAim_GetInverterState() == true and ind_clr2:GetColor() or Color_RGBA(35, 35, 35, 150))
elseif arrows_ind:Get() == 2 then
    textsize = Render_CalcTextSize('g', 20, arrows18)
    Render_Text('g', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)


    Render_Text('h', Vector2_new(screen_size.x/2+50, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)
    Render_Text('h', Vector2_new(screen_size.x/2+51, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)
elseif arrows_ind:Get() == 3 then
    textsize = Render_CalcTextSize('<', 12, verdana12)
    Render_Text('<', Vector2_new(screen_size.x/2-52-textsize.x, screen_size.y/2-12), Color_RGBA(0, 0, 0, 100), 20, verdana23)
    Render_Text('<', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-13), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, verdana23)


    Render_Text('>', Vector2_new(screen_size.x/2+52, screen_size.y/2-12), Color_RGBA(0, 0, 0, 100), 20, verdana23)
    Render_Text('>', Vector2_new(screen_size.x/2+51, screen_size.y/2-13), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, verdana23)
elseif arrows_ind:Get() == 4 then
    textsize = Render_CalcTextSize('w', 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-50-textsize.x, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-50-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+50, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+51, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+50, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+51, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
end
if vel_mod_ind:GetBool() then
    local me = EntityList_GetLocalPlayer()
    if not me then return end
    if not me:IsAlive() then return end
    local modifier_vel = me:GetProp('m_flVelocityModifier') + 0.01
    if Cheat_IsMenuVisible() then
        modifier_vel = me:GetProp('m_flVelocityModifier')
    end
    if modifier_vel == 1.01 then return end

    local alpha_vel = math_abs(GlobalVars.curtime*4 % 2 - 1)*255

    local text_vel = string_format('Slowed down %.0f%%', math_floor(modifier_vel*100))
    local text_width_vel = 95

    a_width = lerp(a_width, math_floor((text_width_vel - 2) * modifier_vel), GlobalVars.frametime * 8)

    local x_vel = screen_size.x/2 - text_width_vel
    local y_vel = screen_size.y/2 - 350

    Render_PolyFilled(Color_RGBA(16, 16, 16, 255), Vector2_new(x_vel - 14 + vel_mod_add_x:Get(), y_vel - 16 + vel_mod_add_y:Get()), Vector2_new(x_vel + 6 + vel_mod_add_x:Get(), y_vel + 14+ vel_mod_add_y:Get()), Vector2_new(x_vel - 34 + vel_mod_add_x:Get(), y_vel + 14 + vel_mod_add_y:Get()))
    Render_PolyFilled(Color_new((124*2 - 124 * modifier_vel)/255, (195 * modifier_vel)/255, 13/255, alpha_vel/255), Vector2_new(x_vel - 14 + vel_mod_add_x:Get(), y_vel - 14 + vel_mod_add_y:Get()), Vector2_new(x_vel + 4 + vel_mod_add_x:Get(), y_vel + 13+ vel_mod_add_y:Get()), Vector2_new(x_vel - 32 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()))

    Render_Text('!', Vector2_new(x_vel - 18 + vel_mod_add_x:Get(), y_vel - 12+ vel_mod_add_y:Get()), Color_RGBA(16, 16, 16, 255), 25, verdana25)
    Render_Text(text_vel, Vector2_new(x_vel + 22 + vel_mod_add_x:Get(), y_vel - 15 + vel_mod_add_y:Get()), Color_RGBA(0, 0, 0, 255), 13, tahoma_bold13)
    Render_Text(text_vel, Vector2_new(x_vel + 21 + vel_mod_add_x:Get(), y_vel - 16 + vel_mod_add_y:Get()), Color_RGBA(255, 255, 255, 255), 13, tahoma_bold13)

    Render_BoxFilled(Vector2_new(x_vel + 22 + vel_mod_add_x:Get(), y_vel + 2 + vel_mod_add_y:Get()), Vector2_new(text_width_vel + screen_size.x/2-60 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()), Color_RGBA(25, 25, 25, 200))
    Render_BoxFilled(Vector2_new(x_vel + a_width + 37 + vel_mod_add_x:Get(), y_vel + 2 + vel_mod_add_y:Get()), Vector2_new(screen_size.x/2-73 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()), Color_new((124*2 - 124 * modifier_vel)/255, (195 * modifier_vel)/255, 13/255, 1))
    Render_Box(Vector2_new(x_vel + 21 + vel_mod_add_x:Get(), y_vel + 1 + vel_mod_add_y:Get()), Vector2_new(text_width_vel + screen_size.x/2-59 + vel_mod_add_x:Get(), y_vel + 14 + vel_mod_add_y:Get()), Color_RGBA(55, 55, 55, 200))
end
end

particles = {}
hitmarkers = {}
damage_marker_log = {
log = {}
}


function autopeek()
if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() and auto_peek:GetBool() then
    if autopeek_pos == nil then
        autopeek_pos = EntityList_GetLocalPlayer():GetProp('m_vecOrigin')
    end

    if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() then
        for i = 0, 49 do
            Render_Circle3DFilled(autopeek_pos, 16, i / -2.5, Color_new(auto_peek:GetColor().r, auto_peek:GetColor().g, auto_peek:GetColor().b, (i / 10 * auto_peek:GetColor().a) / 255), false)
            Render_Circle3DFilled(autopeek_pos, 8, i / -2.6, Color_new(auto_peek:GetColor().r, auto_peek:GetColor().g, auto_peek:GetColor().b, (i / 20 * auto_peek:GetColor().a) / 255), false)
        end
    end

else
    autopeek_pos = nil
end
end

function damage_markere(e)
if e:GetName() ~= 'player_hurt' then return end
if e:GetInt('attacker') == nil then return end
if e:GetInt('userid') == nil then return end
if EntityList_GetPlayerForUserID(e:GetInt('attacker')) == EntityList_GetLocalPlayer() then
    table_insert(damage_marker_log.log,{size = 120,pos = EntityList_GetPlayerForUserID(e:GetInt('userid')):GetHitboxCenter(e:GetInt('hitgroup')),damage = e:GetInt('dmg_health'),is_lethal = (e:GetInt('health') < 1),time = GlobalVars.realtime})
end
end
local verdana12b = Render_InitFont('verdana', 11, {'b'})
function damage_markerd()
if EntityList_GetLocalPlayer() == nil then return end
for i, mark in ipairs(damage_marker_log.log) do
    mark.pos.z = mark.pos.z + 50*GlobalVars.frametime
    local pos = Render_WorldToScreen(mark.pos)
    mark.size = mark.size - GlobalVars.frametime*55
    Render_Text(tostring(mark.damage), Vector2_new(pos.x+1,pos.y+1), Color_new(0.1,0.1,0.1,1), math_floor(math_min(mark.size,11)),verdana12b,false,true)
    Render_Text(tostring(mark.damage), Vector2_new(pos.x,pos.y), mark.is_lethal and Color_RGBA(155,200,20,255) or Color_RGBA(255,255,255,255), math_floor(math_min(mark.size,11)),verdana12b,false,true)

    if mark.time + 3 < GlobalVars.realtime or mark.size < 0 then table_remove(damage_marker_log.log,i) end
end
end

function reg_shot(shot)
local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
if not localplayer then return end

local my_index = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
if not my_index then return end
if EngineClient.IsConnected() and my_index:IsAlive() then
    local index = EntityList.GetClientEntity(shot.target_index)
    if not index then return end
    local get_player = index:GetPlayer()
    if not get_player then return end
    if shot.reason == 0 then
        local damage = shot.damage
        if damage < 1 then return end
        local bullet_position = get_player:GetHitboxCenter(shot.hitgroup)
        if not bullet_position then
            bullet_position = get_player:GetRenderOrigin()
            bullet_position.y = bullet_position.y + 30
        end

        bullet_position.x = (bullet_position.x - 10) + (math.random() * 20)
        bullet_position.y = (bullet_position.y - 10) + (math.random() * 20)
        bullet_position.z = (bullet_position.z - 15) + (math.random() * 30)
        table.insert(particles, {
            position = bullet_position,
            timer = GlobalVars.tickcount + 80,
            damage = damage,
            is_killed = get_player:GetProp("m_iHealth") - damage <= 0 and true or false
        })
        table.insert(hitmarkers, {
            position = get_player:GetHitboxCenter(shot.hitgroup),
            timer = GlobalVars.realtime,
            alpha = 0,
        })
    end
end
end

function move_position()
if #particles > 0 then
    for k, information in pairs(particles) do
        local delta = information.timer - GlobalVars.tickcount
        if delta > 0 then
            information.position.z = information.position.z + 0.3
        end
    end
end
end

function on_round_prestart(e)
if e:GetName() ~= "round_prestart" then return end
particles = {}
hitmarkers = {}
end

function on_self_connected(e)
if e:GetName() ~= "player_connect_full" then return end
particles = {}
hitmarkers = {}
end

function load_markers_modules(e)
damage_markere(e)
on_round_prestart(e)
on_self_connected(e)
end


ref_remove_scope = Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):GetInt()

anim_num = 0

function custom_scope()
Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):SetInt(2)
local_player = EntityList_GetLocalPlayer()

if not local_player or not local_player:IsAlive() or not local_player:GetProp('m_bIsScoped') then
    anim_num = lerp(anim_num, 0, 23 * GlobalVars.frametime)
else
    anim_num = lerp(anim_num, 1, 23 * GlobalVars.frametime)
end

scope_gap1 = scope_gap:GetInt() * anim_num
scope_size1 = scope_size:GetInt() * anim_num
scope_color_1 = scope_color:Get()
scope_color_2 = scope_color1:Get()
width = 1

scope_color_1.a = scope_color_1.a * anim_num
scope_color_2.a = scope_color_2.a * anim_num


start_x = screen_size.x / 2
start_y = screen_size.y / 2

--Left
Render_GradientBoxFilled(Vector2_new(start_x - scope_gap1, start_y), Vector2_new(start_x - scope_size1, start_y + width), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Right
Render_GradientBoxFilled(Vector2_new(start_x + scope_gap1, start_y), Vector2_new(start_x + scope_size1, start_y + width), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Up
Render_GradientBoxFilled(Vector2_new(start_x, start_y + scope_gap1), Vector2_new(start_x + width, start_y + scope_size1), scope_color_1, scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Down
Render_GradientBoxFilled(Vector2_new(start_x, start_y - scope_gap1), Vector2_new(start_x + width, start_y - scope_size1), scope_color_1, scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))
end

function get_time()
local systym_time = ffi.new('SYSTEMTIME')
ffi.C.GetLocalTime(systym_time)

return {
    hour = systym_time.wHour,
    minute = systym_time.wMinute,
    second = systym_time.wSecond,
    milliseconds = systym_time.wMilliseconds,
}
end

local function get_latency()
local netchann_info = EngineClient:GetNetChannelInfo()
if netchann_info == nil then return '0' end
local latency = netchann_info:GetLatency(0)
return string_format('%1.f', math_max(0.0, latency) * 1000.0)
end

local textSize = 0

local function watermark()
local time = get_time()
if time.minute < 10 then time.minute = '0' .. time.minute end
local screen = EngineClient:GetScreenSize()
local ping = get_latency()
local ticks = math_floor(1.0 / GlobalVars.interval_per_tick)

local rightPadding = 12
local var = screen.x - textSize - rightPadding

local x = var - 15
local y = 8
local w = textSize + 20
local h = 17

local nexttext = 'alien.lua | '..Cheat_GetCheatUserName()..' | delay: '.. ping ..'ms | ' .. tostring(time.hour)..':'..tostring(time.minute)

if blur_back:GetBool() then
    Render_Blur(Vector2_new(x+10,y+2+1),Vector2_new(x+textSize+20,h * 1.5 + 4), Color.RGBA(255, 255, 255, 255))
end
Render_BoxFilled(Vector2_new(x+10,y+3),Vector2_new(x+textSize+20,h * 1.5 + 4), Color_new(.1, .1, .1, alpha_slider:Get()/255))
Render_BoxFilled(Vector2_new(x+10,y+3), Vector2_new(x+textSize+20,y+1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))

Render_Text(nexttext, Vector2_new(var+1,15),Color_RGBA(0, 0, 0, 180), 11, verdana11_r)
Render_Text(nexttext, Vector2_new(var,14), Color_RGBA(255, 255, 255, 255), 11, verdana11_r)
local wide = Render_CalcTextSize(nexttext, 11, verdana11_r)
var = var + wide.x

textSize = var - (screen.x - textSize - rightPadding)
end
local function getbinds()
local binds = {}
local cheat_binds = Cheat_GetBinds()

for i = 1, #cheat_binds do
    table_insert(binds, 1, cheat_binds[i])
end
return binds
end
local keybind_names = {
['Double Tap'] = 'Double tap',
['Hide Shots'] = 'On shot anti-aim',
['Slow Walk'] = 'Slow motion',
['Edge Jump'] = 'Jump at edge',
['Fake Ping'] = 'Ping spike',
['Override Resolver'] = 'Resolver override',
['Fake Duck'] = 'Duck peek assist',
['Minimum Damage'] = 'Damage override',
['Auto Peek'] = 'Quick peek assist',
['Body Aim'] = 'Force body aim',
['Safe Points'] = 'Safe points',
['Yaw Base'] = 'Yaw base',
['Enable Thirdperson'] = 'Thirdperson',
['Manual Yaw Base'] = 'Yaw base',
}

local alpha_k = 1
local data_k = {
[''] = {alpha_k = 0}
}

local drag = false
local width_k = 0
local width_ka = 0

function upper_to_lower(str)
str1 = string_sub(str, 2, #str)
str2 = string_sub(str, 1, 1)
return str2:upper()..str1:lower()
end


local function render_conteiner(x, y, w, h, name, font_size, font)
local name_size = Render.CalcTextSize(name, font_size, font)
if teamskeet_kb:Get() == 0 then
    if gradient:GetBool() then
        Render.GradientBoxFilled(Vector2.new(x, y+2), Vector2.new(x + w/2, y+2 - 1), Color.new(0, 0.7843137254901961, 1, 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(0, 0.7843137254901961, 1, 1), Color.new(1, 0, 0.9333333333333333, 1))
        Render.GradientBoxFilled(Vector2.new(x + w/2, y+2), Vector2.new(x + w, y+2 - 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(1, 0.9176470588235294, 0, 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(1, 0.9176470588235294, 0, 1))
    else
        Render.BoxFilled(Vector2.new(x, y+2), Vector2.new(x + w, y+2 - 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
    end
    Render.BoxFilled(Vector2.new(x, y+2), Vector2.new(x + w, y+2 + h - 1), Color.RGBA(20, 20, 20, 255))
    local frametime = GlobalVars.frametime * 16
    local binds = getbinds()
    local add_y = 0
    for i = 1, #binds do

        local bind_name = keybind_names[binds[i]:GetName()] == nil and upper_to_lower(binds[i]:GetName()) or keybind_names[binds[i]:GetName()]
        if data_k[bind_name] == nil then
            data_k[bind_name] = {alpha_k = 0}
        end

        data_k[bind_name].alpha_k = math_lerp(frametime, data_k[bind_name].alpha_k,binds[i]:IsActive() and 1 or 0)
        add_y = add_y + 16 * data_k[bind_name].alpha_k
    end


    Render.BoxFilled(Vector2.new(x, y + h + add_y + 5), Vector2.new(x + w, y + h + 1), Color.RGBA(25, 25, 25, 255))

    Render.Text(name, Vector2.new(x + w / 2 - name_size.x / 2, y + 2+2), Color.new(280, 280, 280), font_size, font, true)
else
    if blur_back:GetBool() then
        Render_Blur(Vector2_new(x-1, y-1), Vector2_new(x + w + 4, y + h + 3), Color.RGBA(255, 255, 255, 255))
    end
    Render_BoxFilled(Vector2_new(x, y), Vector2_new(x + w + 3, y + h + 2), Color_new(.1, .1, .1, alpha_slider:Get()/255))
    Render_BoxFilled(Vector2_new(x, y), Vector2_new(x + w + 3, y - 2), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
    --Render_BoxFilled(Vector2_new(x-1, y), Vector2_new(x+1 + w, y), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 6)
    Render_Text(name, Vector2_new(x+2 + w / 2 + 1 - name_size.x / 2, y + 3), Color_RGBA(0, 0, 0, 180), font_size, font)
    Render_Text(name, Vector2_new(x+1 + w / 2 + 1 - name_size.x / 2, y + 2), Color_RGBA(255, 255, 255, 255), font_size, font)
end
end

keybinds_x:SetVisible(false)
keybinds_y:SetVisible(false)

keybinds_v = 0
widthh = 0
function keybinds()
local x_k, y_k = keybinds_x:GetInt(), keybinds_y:GetInt()
local max_width = 0
local frametime = GlobalVars.frametime * 16
local add_y = 0
local total_width = 66
local active_binds = {}
if teamskeet_kb:Get() == 0 then
    widthh = 200
else
    widthh = 135
end
local bind = getbinds()
if Cheat_IsMenuVisible() or keybinds_v then
    if teamskeet_kb:Get() == 0 then
        render_conteiner(x_k, y_k, width_ka, 16, 'keybinds', 10, pixel7)
    else
        render_conteiner(x_k, y_k, width_ka, 16, 'keybinds', 11, verdana11_r)
    end
    local mouse = Cheat_GetMousePos()
    if Cheat_IsKeyDown(1) and Cheat_IsMenuVisible() then
        if mouse.x >= x_k and mouse.y >= y_k and mouse.x <= x_k + width_ka and mouse.y <= y_k + 18 or drag then
            if not drag then
                drag = true
            else
                keybinds_x:SetInt(mouse.x - math_floor(width_ka / 2))
                keybinds_y:SetInt(mouse.y - 8)
            end
        end
    else
        drag = false
    end
end
for i = 1, #bind do
    local binds = bind[i]
    if teamskeet_kb:Get() == 1 then
        bind_name = keybind_names[binds:GetName()] == nil and upper_to_lower(binds:GetName()) or keybind_names[binds:GetName()]
    else
        if binds:GetValue() == 'on' then
            bndnm = ''
        else
            bndnm = " [" .. binds:GetValue() .. "]"
        end

        bind_name = keybind_names[binds:GetName()] == nil and (upper_to_lower((binds:GetName())) .. bndnm) or (keybind_names[binds:GetName()] ..bndnm)
    end

    --local bind_state = binds:GetValue():lower()
    --if bind_state == 'on' then
    --if binds:GetValue() == "on" then namess = binds:GetName() else namess = binds:GetName() .. " [" .. binds:GetValue() .. "]" end
    bind_state = binds:GetMode()
    if bind_state == 0 then
        bind_state = 'toggled'
    elseif bind_state == 1 then
        if teamskeet_kb:Get() == 1 then
            bind_state = 'holding'
        else
            bind_state = 'HELD'
        end
    end
    --end

    if data_k[bind_name] == nil then
        data_k[bind_name] = {alpha_k = 0}
    end

    data_k[bind_name].alpha_k = math_lerp(frametime, data_k[bind_name].alpha_k,binds:IsActive() and 1 or 0)

    if teamskeet_kb:Get() == 0 then
        bind_state_size = Render_CalcTextSize(bind_state, 10, pixel7)
        bind_name_size = Render_CalcTextSize(bind_name, 10, pixel7)
    else
        bind_state_size = Render_CalcTextSize(bind_state, 11, verdana11_r)
        bind_name_size = Render_CalcTextSize(bind_name, 11, verdana11_r)
    end
    if teamskeet_kb:Get() == 1 then
        Render_Text(bind_name, Vector2_new(x_k+4, y_k + 21 + add_y), Color_new(0, 0, 0, data_k[bind_name].alpha_k), 11, verdana11_r)
        Render_Text('['..bind_state..']', Vector2_new(x_k+1 + (width_ka - bind_state_size.x - 8), y_k + 21 + add_y), Color_new(0, 0, 0, data_k[bind_name].alpha_k), 11, verdana11_r)

        Render_Text(bind_name, Vector2_new(x_k+3, y_k + 20 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 11, verdana11_r)
        Render_Text('['..bind_state..']', Vector2_new(x_k + (width_ka - bind_state_size.x- 8), y_k + 20 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 11, verdana11_r)
    else
        if gradient:GetBool() then
            Render_Text(bind_name, Vector2_new(x_k+5, y_k + 21 + add_y), Color_new(0, 0.7843137254901961, 1, data_k[bind_name].alpha_k), 10, pixel7, true)
            Render_Text(bind_state, Vector2_new(x_k + (width_ka - bind_state_size.x- 8)+4, y_k + 21 + add_y), Color_new(1, 0.9176470588235294, 0, data_k[bind_name].alpha_k), 10, pixel7, true)
        else
            Render_Text(bind_name, Vector2_new(x_k+5, y_k + 21 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 10, pixel7)
            Render_Text(bind_state, Vector2_new(x_k + (width_ka - bind_state_size.x- 8)+4, y_k + 21 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 10, pixel7, true)
        end
    end
    add_y = add_y + 16 * data_k[bind_name].alpha_k


    local width_k = bind_state_size.x + bind_name_size.x + 18

    if width_k > widthh then
        if width_k > max_width then
            max_width = width_k
        end
    end
    if binds:IsActive() then
        table_insert(active_binds, binds)
    end
end
alpha_k = math_lerp(frametime,alpha_k, (Cheat_IsMenuVisible() or #active_binds > 0) and 1 or 0)
width_ka = math_lerp(frametime,width_ka,math_max(max_width, widthh))
keybinds_v = #active_binds > 0


end

local hit_id = 0
local miss_id = 0
local shot_id = 0
local choke = 0
local missgroup_names = { 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local hitgroup_names = { 'generic', 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local miss_reason = { 'resolver', 'spread', 'occlusion', 'prediction error' }
Cheat_RegisterCallback('ragebot_shot', function(shot)
if advanced_shot_logger:GetBool() then
if EntityList_GetLocalPlayer() == nil then return end
total_hits = EntityList_GetLocalPlayer():GetProp('m_totalHitsOnServer')
if total_hits == nil then return end
miss_hitbox = missgroup_names[shot.hitgroup] or '?'
self_choke = ClientState.m_choked_commands
choke = time_to_ticks1(GlobalVars.curtime - EntityList_GetClientEntity(shot.index):GetPlayer():GetProp("m_flSimulationTime")) + 1;
if choke < 0 then
choke = 0
elseif choke > 14 then
choke = 14
end
end
end)
function num_format(b) local c=b%10;if c==1 and b~=11 then return b..'st'elseif c==2 and b~=12 then return b..'nd'elseif c==3 and b~=13 then return b..'rd'else return b..'th'end end
shot_id = 0
hit_ids = 0
total_hits = 0
local missgroup_names = { 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local miss_reason = { '?', 'spread', 'occlusion', 'prediction error' }
function time_to_ticks1(a)
return math_floor(0.5 + a / GlobalVars.interval_per_tick)
end

stuff = {}

function round(x)
return x >= 0 and math_floor(x+0.5) or math_ceil(x-0.5)
end

function yaw_normalize(yaw)
if yaw > 180 or yaw < -180 then
local revolutions = round(math_abs(yaw / 360))
if yaw < 0 then yaw = yaw + 360*revolutions else yaw = yaw - 360*revolutions end
end
return yaw
end

function _verification(shot)
local text = ''

local hg_diff = hgroup ~= aimed_hgroup
local dmg_diff = shot.damage ~= shot.wanted_damage

if hg_diff or dmg_diff then
text = string_format(
' | mismatch: [ %s ]', (function()
local addr = ''

if dmg_diff then addr = 'dmg: ' .. shot.wanted_damage .. (hg_diff and ' | ' or '') end
if hg_diff then addr = addr .. (hg_diff and 'hitgroup: ' .. aimed_hgroup or '') end

return addr
end)()
)
end

return text
end
choke = 0
local engine_client = Utils_CreateInterface('engine.dll', 'VEngineClient014')
local interfacePointer = ffi_typeof('void***')
local I_EngineClientPtr = ffi_cast(interfacePointer, engine_client) or error('engine_client is nil', 2)
local getNetChannelInfo = ffi_cast('void*(__thiscall*)(void*)', I_EngineClientPtr[0][78]) or error('I_EngineClientPtr is nil')
function registered_shot(shot)
hit_id = hit_id + 1

shot_id = num_format((hit_id % 15) + 1)
local safety = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Safe Points'):Get()
local name = string_lower(EntityList_GetClientEntity(shot.target_index):GetPlayer():GetName())
if name == nil then return end
local hgroup = hitgroup_names[shot.hitgroup + 1] or '?'
local hit_chance = tostring(math_floor(shot.hitchance + 0.5))
local backtrack = shot.backtrack
local m_iHealth = EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_iHealth')
if m_iHealth == nil then return end
local health = m_iHealth - shot.damage
if health < 0 then health = 0 end
local aimed_hgroup = hitgroup_names[shot.wanted_hitgroup + 1] or '?'

local feet_yaw = math_min(58, math_max(yaw_normalize(EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_flPoseParameter')[12] * 120 - 60), -58))
if EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_flPoseParameter') == nil then return end
if feet_yaw == nil then return end
local ping = EngineClient_GetNetChannelInfo():GetLatency(0)*1000
local avg_ping = EngineClient_GetNetChannelInfo():GetAvgLatency(0)*1000
--if shot.reason == nil or hit_id == nil or aimed_hgroup == nil or shot_id == nil or feet_yaw == nil or safety == nil or name == nil or hit_chance == nil or ping == nil or avg_ping == nil then return end
local netChannelInfo = ffi_cast('void***', getNetChannelInfo(I_EngineClientPtr)) or error('netchaninfo is nil')
local netChannel = GetNetChannel(netChannelInfo)
local net_state = string_format(
'delay: %d:%.2f | dropped: %.0f',
avg_ping, math_abs(avg_ping-ping), (netChannel.AvgLoss*100)
)

local uflags = {
math_abs(avg_ping-ping) < 1 and 0 or 1,
CVar_FindVar('cl_clock_correction'):GetInt() == 1 and 0 or 1,
CVar_FindVar('cl_clock_correction_force_server_tick') == 999 and 0 or 1
}

local pflags = {
ClientState.m_choked_commands > 1 and 1 or 0,
EntityList_GetLocalPlayer():GetProp('m_flVelocityModifier') < 1.00 and 1 or 0,
(EntityList_GetLocalPlayer():GetRenderOrigin().z <= EntityList_GetClientEntity(shot.target_index):GetPlayer():GetRenderOrigin().z) and 1 or 0
}

local correction = Menu_FindVar('Aimbot', 'Ragebot', 'Main', 'Override Resolver'):GetBool()
if shot.reason == 0 then
text = string_format('Registered %s shot in %s's %s for %d damage [angle: %.2f° | %d:%d°] ( hitchance: %s%% | safety: %s | history(Δ): %d | flags: %s%s )',
shot_id, name, hgroup, shot.damage, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, hit_chance, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags), _verification(shot))
textc = string_format('Registered %s shot in %s's %s for %d damage [angle: %.2f° | %d:%d°] ( hitchance: %s | safety: %s | history(Δ): %d | flags: %s%s )',
shot_id, name, hgroup, shot.damage, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, hit_chance .. "%%", safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags), _verification(shot))
elseif shot.reason == 1 then
shot_reason = (shot.reason == 1 and total_hits ~= EntityList_GetLocalPlayer():GetProp('m_totalHitsOnServer')) and 'damage rejection' or string_format('unknown [angle: %.2f° | %d:%d°]', shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw)
text = string_format('Missed %s shot at %s's %s(%s%%) due to %s ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot_reason, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 2 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to spread [angle: %.2f° | %d:%d°] ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 3 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to occlusion [angle: %.2f° | %d:%d°] ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 4 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to prediction error [%s] [vel_modifier: %.1f | history(Δ): %d | error: %s]',
shot_id, name, miss_hitbox, hit_chance, net_state, EntityList_GetLocalPlayer():GetProp('m_flVelocityModifier'), backtrack, table_concat(uflags))
else
text = string_format('Missed %s shot at %s's %s(%s%%) due to death [dropped: %d | flags: %s | error: %s]',
shot_id, name, miss_hitbox, hit_chance, EngineClient_GetNetChannelInfo():GetAvgLoss(0), table_concat(pflags), table_concat(uflags))
end

if shot.reason == 0 then
colored_print(Color.RGBA(23, 250, 29, 255), "[alien.lua] " .. textc .. '
')

else
colored_print(Color.RGBA(255, 23, 23, 255), "[alien.lua] " .. text .. '
')

end

table_insert(hitlogs, {text = text, time = GlobalVars.realtime})
end

function log_draw()
local x, y = 5, 5
for i, hitlog in ipairs(hitlogs) do
--if draw_type:Get(2) then
Render_Text(hitlog.text, Vector2_new(x+1, y+1), Color_RGBA(0, 0, 0, math_floor((hitlog.time + 10 - GlobalVars.realtime)*500)-105), 10, lucida_console)
Render_Text(hitlog.text, Vector2_new(x, y), Color_RGBA(255, 255, 255, math_floor((hitlog.time + 10 - GlobalVars.realtime)*500)), 10, lucida_console)
--end
y = y + 15
if #hitlogs > 15 then table_remove(hitlogs,1) end
if hitlog.time + 10 < GlobalVars.realtime then table_remove(hitlogs, i) end
end
end
--anti_bruteforce_work.phases:SetVisible(false)


wall_dmg = 0
ent_exists = false
data = {
    xPos = 1,
    yPos = 1,
}
function round_p(a, prec)
    return math_floor(a + 0.5*prec)
end

function prenetration_prediction()
    local me = EntityList_GetLocalPlayer()
    if me == false then return end
    local weap = me:GetActiveWeapon()
    if weap == nil then return end
    local weapon_id = weap:GetWeaponID()
    if weapon_id == nil then return end

    if weap:IsKnife() or weap:IsGrenade() or weapon_id == 31 then
        wall_dmg = 0
        return
    end

    local eye_pos = me:GetEyePosition()
    local eyeX = eye_pos.x
    local eyeY = eye_pos.y
    local eyeZ = eye_pos.z
    local pitch = me:GetRenderAngles().pitch
    local yaw = me:GetRenderAngles().yaw

    local sin_pitch = math_sin(math_rad(pitch))
    local cos_pitch = math_cos(math_rad(pitch))
    local sin_yaw = math_sin(math_rad(yaw))
    local cos_yaw = math_cos(math_rad(yaw))

    local dirVector = { cos_pitch * cos_yaw, cos_pitch * sin_yaw, -sin_pitch }

    local fraction = EngineTrace.TraceRay(Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * 8192), eyeY + (dirVector[2] * 8192), eyeZ + (dirVector[3] * 8192)), me, 0xFFFFFFFF)
    wall_dmg = 0
    ent_exists = false

    if fraction.fraction < 1 then
        local ent, dmg = Cheat_FireBullet(me:GetPlayer(), Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * (8192 * fraction.fraction + 128)), eyeY + (dirVector[2] * (8192 * fraction.fraction + 128)), eyeZ + (dirVector[3] * (8192 * fraction.fraction + 128)))).trace.hit_entity, Cheat_FireBullet(me:GetPlayer(), Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * (8192 * fraction.fraction + 128)), eyeY + (dirVector[2] * (8192 * fraction.fraction + 128)), eyeZ + (dirVector[3] * (8192 * fraction.fraction + 128)))).damage

        if dmg ~= nil then
            ent_exists = true
        end
        if ent == nil then
            ent = -1
        end
        if wall_dmg < dmg then
            wall_dmg = dmg
        end
    end
    
end

function penetration_ind()
    if EngineClient_GetLocalPlayer() == nil or EntityList_GetLocalPlayer() == nil or wall_dmg == nil or not EntityList_GetLocalPlayer():IsAlive() or not penetration:GetBool() then return end

    if wall_dmg > 0 and not penetration_rainbow:GetBool() then
        Render_Text(tostring(round_p(wall_dmg, 1)), Vector2_new((screen_size.x / 2), (screen_size.y / 2 + penetration_position:GetInt())), penetration:GetColor(), 12, verdana12)
    elseif wall_dmg > 0 and penetration_rainbow:GetBool() then
        r, g, b = math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100)) * 127 + 128), math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100) + 2) * 127 + 128), math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100) + 4) * 127 + 128)
        Render_Text(tostring(round_p(wall_dmg, 1)), Vector2_new((screen_size.x / 2), (screen_size.y / 2 + penetration_position:GetInt())), Color_RGBA(r, g, b, 255), 12, verdana12)
    end
end

local phrases = {
'сын инвалида мб Alien.lua прикупишь?',
'не блюй в мой чат ',
'умер , посиди подумай в спектах',
'Алеу какая там ситуацыя с юидом ',
'але 13146 вещает ',
'ХУЙЛАН Я ТВОЮ МАТЬ ЕБАЛ',
'Alien.lua забустила ',
'он еще даже телку не трахал но человека убил ',
'нормально ты так споткнулся',
'ты слишком хуев для этой карты , выйди не позорься',
'ты че пидорас в светлое будущие попрыгал ',
'1.',
'есть всего 3 расы : белые , желтые  и негры . Ты относишься к 4 расе , имбицылов',
'вчера пил пиво , а теперь ебу твою сестру',
'вроде не срал , но уже воняет',
'ты любишь когда тебя хсают nn?',
'хочешь узнать ,  как выглядит твой батя ? а хуй знает',
'в один момент понимаешь , что ебешь не телку , а барана',
'когда открываю гачи мучи вспоминаю твоего отца',
'в кусте ебали твою мать , а ты не знаешь его ИМЕНИ задумайся об этом ....',
'что chimera lua не забустила ',
'а это правда что твоя семья малоимущие и твоему отцу пришлось отсосать хуй у администратора пятерочки за пакетик эклеров??',
'',
'▼- стрелочка вниз - ДАДАДА ИМЕННО В ТОМ МЕСТЕ ТВОЯ МАТЬ У МЕНЯ ОТРАБАТЫВАЕТ',
'ммовский хуесос ты для чего на паблик зашел, заблудился или что?',
'хахах просто легкий пидорас',
'"спи нахуй пидораска',
'ХАХАХА ЧЕ ТЫ ТАМ ВРЕДИТЕЛЬ АХАХАХ СПОТИФАЙ ХАХА Х',
'"СПОТЛАЙТ СПОТЛАЙТ АХАХА СПИНОЙ ПИДОРАСА УБИВАЮ ХАХА',
'ало пидорас ебаный молчишь потому что ебу твой рот',
'Почему улетаешь прикупи  Alien.lua',
'ez '
}

local function get_phrase()
return phrases[Utils.RandomInt(1, #phrases)]:gsub('"', '')
end

function trashtalk(e)
if e:GetName() ~= "player_death" then return end

local me = EntityList.GetLocalPlayer()
local victim = EntityList.GetPlayerForUserID(e:GetInt("userid"))
local attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"))

if victim == attacker or attacker ~= me then return end


EngineClient.ExecuteClientCmd('say "' .. get_phrase() .. '"')
end

current_choke = 0
ind_phase, ind_num, ind_time = 0, 0, 0
last_sent, current_choke = 0, 0
teleport = 0
last_origin = 0
breaking_lc = 0
function gram_create(value, count) local gram = { }; for i=1, count do gram[i] = value; end return gram; end
function gram_update(tab, value, forced) local new_tab = tab; if forced or new_tab[#new_tab] ~= value then table_insert(new_tab, value); table_remove(new_tab, 1); end; tab = new_tab; end
function get_average(tab) local elements, sum = 0, 0; for k, v in pairs(tab) do sum = sum + v; elements = elements + 1; end return sum / elements; end
gram_fyaw = gram_create(0, 2)
teleport_data = gram_create(0, 3)
gram_update(gram_fyaw, math_min(math_abs(AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation()), 58), true)

local frequency = 144

function get_color(number, max, i)
local Colors = {
    { 255, 0, 0 },
    { 237, 27, 3 },
    { 235, 63, 6 },
    { 229, 104, 8 },
    { 228, 126, 10 },
    { 220, 169, 16 },
    { 213, 201, 19 },
    { 176, 205, 10 },
    { 124, 195, 13 }
}

function math_num(int, max, declspec)
    local int = (int > max and max or int)
    local tmp = max / int;

    if not declspec then declspec = max end

    local i = (declspec / tmp)
    i = (i >= 0 and math_floor(i + 0.5) or math_ceil(i - 0.5))

    return i
end

i = math_num(number, max, #Colors)

return
Colors[i <= 1 and 1 or i][1],
Colors[i <= 1 and 1 or i][2],
Colors[i <= 1 and 1 or i][3],
i
end
function update_choked()
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
if ClientState.m_choked_commands == 0 then
    local m_origin = EntityList_GetLocalPlayer():GetProp('m_vecOrigin')

    if last_origin ~= nil then
        teleport = (m_origin-last_origin):Length2D()

        gram_update(teleport_data, teleport, true)
    end

    gram_update(gram_fyaw, math_min(math_abs(breaking_lc == 2 and (AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation())/2 or (AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation())), 58), true)

    last_sent = current_choke
    last_origin = m_origin
end

current_choke = ClientState.m_choked_commands
breaking_lc =
get_average(teleport_data) > 65 and 1 or
(Exploits_GetCharge() > 0.7 and 2 or 0)
end

lag_data = gram_create(0, 90)

request_time, frametime = 0, 0
frametimes = {}

function renderer_gradient(x,y,w,h,c1,c2,ishorizon)
if ishorizon == true then
    Render_GradientBoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1,c2,c1,c2)
else
    Render_GradientBoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1,c1,c2,c2)
end
end

function renderer_rectangle(x,y,w,h,c1)
if blur_back:GetBool() then
    Render_Blur(Vector2_new(x,y),Vector2_new(x+w,y+h), Color.RGBA(255, 255, 255, 255))
end
Render_BoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1)

end

function renderer_text(x,y,cent,string,c1,font,size,alpha)
Render_Text(string,Vector2_new(x+1,y+1), Color_RGBA(0, 0, 0, alpha),size,font,false,cent)
Render_Text(string,Vector2_new(x,y),c1,size,font,false,cent)
end

function renderer_line(x,y,w,h,c1)
Render_Line(Vector2_new(x, y), Vector2_new(w,h), c1)
end

formatting = (function(avg)
if avg < 1 then return ('%.2f'):format(avg) end
if avg < 10 then return ('%.1f'):format(avg) end
return ('%d'):format(avg)
end)
fps_data = gram_create(0, 30)
g_frameRate, g_prev_frameRate = 0, 0
function solus_ui()
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
avg = math_abs(frametime*600)
local addr, nval = '', false
local r, g, b = 150, 150, 150

local fr = GlobalVars.frametime * 3.75
local min_offset = 1200+math_max(0, get_average(teleport_data)-3800)
local teleport_mt = math_abs(math_min(teleport-3800, min_offset) / min_offset * 100)

if ind_num ~= teleport_mt and ind_time < GlobalVars.realtime then
    ind_time = GlobalVars.realtime + 0.005
    ind_num = ind_num + (ind_num > teleport_mt and -1 or 1)
end
ind_phase = ind_phase + (breaking_lc == 1 and fr or -fr)
ind_phase = ind_phase > 1 and 1 or ind_phase
ind_phase = ind_phase < 0 and 0 or ind_phase
if breaking_lc == 2 then
    addr, ind_phase, ind_num = ' | SHIFTING', 0, 0
    r, g, b = 228, 126, 10
elseif ind_phase > 0.1 then
    addr = ' | dst:          '
end
local text_FL = ('FL: %s%s'):format(
(function()
if tonumber(last_sent) < 10 then
    return '  ' .. last_sent
end
return last_sent
end)(),
addr)
local h_FL, w_FL = 17, (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and Render_CalcTextSize(text_FL,11,verdana11_r).x + 8 or -4
local x_FL, y_FL = screen_size.x, (windows_value:Get(1) and 35 or 10) + (25*0)

x_FL = x_FL - w_FL - 10
if windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive() then
    renderer_rectangle(x_FL, y_FL, w_FL, h_FL, Color_new(.1, .1, .1, alpha_slider:Get()/255))

    renderer_gradient(x_FL, y_FL+h_FL, w_FL-w_FL/2, 1, Color_new(.1, .1, .1, alpha_slider:Get()/255), Color_RGBA(r, g, b,255),true)
    renderer_gradient(x_FL + w_FL/2, y_FL + h_FL, w_FL - w_FL/2, 1, Color_RGBA(r, g, b,255), Color_new(.1, .1, .1, alpha_slider:Get()/255),true)

    if ind_phase > 0 then
        renderer_gradient(
        x_FL + w_FL - Render_CalcTextSize(' | dst: ',11,verdana11_r).x + 2,
        y_FL + 6, math_min(100, ind_num) / 100 * 24, 5,

        Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, ind_phase*220/255),
        Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, ind_phase * 25/255),

        true
        )
    end
    renderer_text(x_FL+4, y_FL + 2,false,text_FL,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end

local add_text = (get_average(gram_fyaw) > 0) and '     ' or ''
text_FI = ('%sFAKE (%.1f°)'):format(add_text, get_average(gram_fyaw))
local h_FI, w_FI = 18, (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and Render_CalcTextSize(text_FI,11,verdana11_r).x + 8 or 0

local r,g,b = get_color(get_average(gram_fyaw),30)
local dec = { math_ceil(r - (r/100 * 50)), math_ceil(g - (g/100 * 50)), math_ceil(b - (b/100 * 50)) }
if (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) then
    renderer_gradient(x_FL - w_FI - 6, y_FL, 2, h_FI / 2,Color_RGBA(dec[1], dec[2], dec[3],0),Color_RGBA(r,g,b,255),false)
    renderer_gradient(x_FL - w_FI - 6, y_FL + h_FI / 2, 2, h_FI / 2,Color_RGBA(r,g,b,255),Color_RGBA(dec[1], dec[2], dec[3],0),false)
    renderer_gradient(x_FL - w_FI - 4, y_FL, w_FI / 2, h_FI,Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/20)),Color_new(.1, .1, .1, alpha_slider:Get()/255) ,true)
    renderer_gradient(x_FL - w_FI - 4 + w_FI / 2, y_FL, w_FI / 2, h_FI, Color_new(.1, .1, .1, alpha_slider:Get()/255),Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/20)),true)
    renderer_text(x_FL - w_FI, y_FL + 2,false,text_FI,Color_RGBA(255,255,255,255),verdana11_r,11,120)
    if get_average(gram_fyaw) > 0 then
        Render_Circle(Vector2_new(x_FL - w_FI + 6, y_FL + 8.5), 5, 32, Color_RGBA(89, 119, 239, 255), 2, 0, math.min(360, get_average(gram_fyaw)*6.21))
    end
end

local text_HZ = ('%sms / %dhz'):format(formatting(avg), frequency)

local h_HZ, w_HZ = 17, windows_value:Get(4) and Render_CalcTextSize(text_HZ,11,verdana11_r).x+8 or -4
local x_HZ, y_HZ = screen_size.x, (windows_value:Get(1) and 35 or 10) + (25*((windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and 1 or 0))

local x_HZ = x_HZ - w_HZ - 10
if windows_value:Get(4) then
    local interp = { get_color(15-avg, 15) }
    renderer_gradient(x_HZ,y_HZ+h_HZ,w_HZ/2,1, Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/3)),Color_RGBA(interp[1], interp[2], interp[3], 255),true  )
    renderer_gradient(x_HZ + w_HZ/2, y_HZ+h_HZ, w_HZ-w_HZ/2, 1,Color_RGBA(interp[1], interp[2], interp[3], 255), Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/3)), true)
    renderer_rectangle(x_HZ, y_HZ, w_HZ, h_HZ, Color_new(.1, .1, .1, alpha_slider:Get()/255) or Color_RGBA(237,237,237,alpha_slider:Get()/255))
    renderer_text(x_HZ+4, y_HZ + 2,false,text_HZ,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end
g_frameRate = 0.9 * g_frameRate + (1.0 - 0.9) * GlobalVars.absoluteframetime
gram_update(fps_data, math_abs(g_prev_frameRate-(1/g_frameRate)), true)
g_prev_frameRate = 1/g_frameRate
local g_nValues_t = {
    avg, 1, 3,
    get_average(fps_data)/4, 0
}

local min_value, max_value = math_min(unpack(g_nValues_t)), math_max(unpack(g_nValues_t))

local text_IO_sub = '       '
local text_IO = 'IO | ' ..  text_IO_sub
local w_IE = Render_CalcTextSize(text_IO_sub,11,verdana11_r).x+3
local h_IO, w_IO = 18, Render_CalcTextSize(text_IO,11,verdana11_r).x+8
local graphics = graphs()
if windows_value:Get(4) then
    renderer_rectangle(x_HZ - w_IO - 4, y_HZ, w_IO, h_IO, Color_new(.1, .1, .1, alpha_slider:Get()/255))
    renderer_text(x_HZ - w_IO, y_HZ + 2,false,text_IO,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end
end

function custom_hitsound(e)
if e:GetName() ~= 'player_hurt' then return end
me = EntityList_GetLocalPlayer()
if me == nil then return end
attacker = EntityList_GetPlayerForUserID(e:GetInt('attacker'))
if attacker == nil then return end
if attacker ~= me then return end
--if hitsound_custom:Get() == 1 then sound = 'arena_switch_press_02.wav' else sound = hitsound_name:Get() end
EngineClient_ExecuteClientCmd('playvol buttons/arena_switch_press_02.wav 1')
end

_set_clantag = ffi.cast('int(__fastcall*)(const char*, const char*)', Utils_PatternScan('engine.dll', '53 56 57 8B DA 8B F9 FF 15'))
_last_clantag = nil
function set_clantag(v)
if v == _last_clantag then return end
_set_clantag(v, v)
_last_clantag = v
end

function time_to_ticks(time)
return math_floor(time / GlobalVars.interval_per_tick + 0.5)
end

function gamesense_anim(text, indices)
if not EngineClient_IsConnected() then return end
local text_anim = '              ' .. text .. '                      '
local tickinterval = GlobalVars.interval_per_tick
local tickcount = GlobalVars.tickcount + time_to_ticks(EngineClient_GetNetChannelInfo():GetLatency(0))
local i = tickcount / time_to_ticks(0.3)
i = math_floor(i % #indices)
i = indices[i+1]+1

return string_sub(text_anim, i, i+15)
end
enabled_prev = true

function run_tag_animation()
if clan_tag:GetBool() and EngineClient_IsConnected() then
    --don't advertise other cheats using this or drone strike
    local clan_tag = gamesense_anim('alien.lua', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25})
    if clan_tag ~= clan_tag_prev then
        set_clantag(clan_tag)
    end
    clan_tag_prev = clan_tag
end
end

function clantag(ctx)
if clan_tag:GetBool() then
    local local_player = EntityList_GetLocalPlayer()
    if local_player ~= nil and (not local_player:IsAlive()) and GlobalVars.tickcount % 2 == 0 then --missing noclip check
        run_tag_animation()
    end
end
end

function on_run_command(s)
if clan_tag:GetBool() then
    if ClientState.m_choked_commands == 0 then
        run_tag_animation()
    end
    enabled_prev = false
elseif not clan_tag:GetBool() and enabled_prev == false then
    set_clantag('')
    enabled_prev = true
end
end

ffi_handler = {}
ffi_handler.VGUI_System = ffi_cast(ffi_typeof('void***'), Utils_CreateInterface('vgui2.dll', 'VGUI_System010'))
ffi_handler.get_clipboard_text_length = ffi_cast('get_clipboard_text_length', ffi_handler.VGUI_System[0][7])
ffi_handler.get_clipboard_text = ffi_cast('get_clipboard_text', ffi_handler.VGUI_System[0][11])
ffi_handler.set_clipboard_text = ffi_cast('set_clipboard_text', ffi_handler.VGUI_System[0][9])
function Clipboard.Get()
local clipboard_text_length = ffi_handler.get_clipboard_text_length(ffi_handler.VGUI_System)

if (clipboard_text_length > 0) then
    local buffer = ffi_new('char[?]', clipboard_text_length)

    ffi_handler.get_clipboard_text(ffi_handler.VGUI_System, 0, buffer, clipboard_text_length * ffi_sizeof('char[?]', clipboard_text_length))
    return ffi_string(buffer, clipboard_text_length - 1)
end

return ''
end

function Clipboard.Set(text)
ffi_handler.set_clipboard_text(ffi_handler.VGUI_System, text, #text)
end


local JSON = Panorama_LoadString([[
return {
stringify: JSON.stringify,
parse: JSON.parse
};
]])()

cfg_data = {
bools = {
    dormant_aim,
    enable__aa,
    Hitmarker,
    auto_peek,
    vel_mod_ind,
    screen_dmg,
    avoid_backstab,
    conditions,
    override_on_use,
    override_stand,
    air_hitchance,
    noscope_hitchance,
    proper_baim,
    auto_teleport_in_air,
    override_crouch,
    override_slowwalk,
    override_move,
    override_air,
    enabled_antibrute,
    types[On_Use].mega_shit,
    types[Air].mega_shit,
    types[Crouch].mega_shit,
    types[SlowWalk].mega_shit,
    penetration_rainbow,
    types[Move].mega_shit,
    types[Stay].mega_shit,
    types[Shared].mega_shit,
    types[anti_aim_preset].mega_shit,
    types[Manual].mega_shit,
    types[On_Use].fakelag,
    types[Air].fakelag,
    types[Crouch].fakelag,
    types[SlowWalk].fakelag,
    types[Move].fakelag,
    types[Stay].fakelag,
    penetration,
    types[Shared].fakelag,
    types[anti_aim_preset].fakelag,
    types[Manual].fakelag,
    enable_b2,
    enable_b3,
    enable_b4,
    blur_back,
    custom_scope_switch,
    screen_dmg,
    clan_tag,
    hitsound_custom,
    shit_talk,
    idealpeek,
    advanced_shot_logger
},

ints = {
    air_hitchance_value,
    noscope_hitchance_value,
    dormant_mindmg,
    type,
    manual_yaw_base,
    yaw_on_use,
    scope_size,
    scope_gap,
    arrows_ind,
    teamskeet_kb,
    windows_value,
    types[On_Use].yaw_add_r,
    types[On_Use].yaw_add_l,
    types[On_Use].jitter_mode,
    types[On_Use].jitter,
    types[On_Use].jitter_value_min,
    types[On_Use].jitter_value_max,
    types[On_Use].fake_limit_type,
    types[On_Use].left_desync_value,
    types[On_Use].right_desync_value,
    types[On_Use].fake_option,
    types[On_Use].lby_mode,
    types[On_Use].freestand_desync,
    types[On_Use].desync_on_shot,
    types[On_Use].fakelag_value,
    types[On_Use].random_value,

    --types[Air].yaw,
    types[Air].yaw_add_r,
    types[Air].yaw_add_l,
    types[Air].jitter_mode,
    types[Air].jitter,
    types[Air].jitter_value_min,
    types[Air].jitter_value_max,
    types[Air].fake_limit_type,
    types[Air].left_desync_value,
    types[Air].right_desync_value,
    types[Air].fake_option,
    types[Air].lby_mode,
    types[Air].freestand_desync,
    types[Air].desync_on_shot,
    types[Air].fakelag_value,
    types[Air].random_value,
    penetration_position,
    penetration_speed,
    --types[Crouching].yaw,
    types[Crouch].yaw_add_r,
    types[Crouch].yaw_add_l,
    types[Crouch].jitter_mode,
    types[Crouch].jitter,
    types[Crouch].jitter_value_min,
    types[Crouch].jitter_value_max,
    types[Crouch].fake_limit_type,
    types[Crouch].left_desync_value,
    types[Crouch].right_desync_value,
    types[Crouch].fake_option,
    types[Crouch].lby_mode,
    types[Crouch].freestand_desync,
    types[Crouch].desync_on_shot,
    types[Crouch].fakelag_value,
    types[Crouch].random_value,

    --types[Slowwalk].yaw,
    types[SlowWalk].yaw_add_r,
    types[SlowWalk].yaw_add_l,
    types[SlowWalk].jitter_mode,
    types[SlowWalk].jitter,
    types[SlowWalk].jitter_value_min,
    types[SlowWalk].jitter_value_max,
    types[SlowWalk].fake_limit_type,
    types[SlowWalk].left_desync_value,
    types[SlowWalk].right_desync_value,
    types[SlowWalk].fake_option,
    types[SlowWalk].lby_mode,
    types[SlowWalk].freestand_desync,
    types[SlowWalk].desync_on_shot,
    types[SlowWalk].fakelag_value,
    types[SlowWalk].random_value,

    --types[Moving].yaw,
    types[Move].yaw_add_r,
    types[Move].yaw_add_l,
    types[Move].jitter_mode,
    types[Move].jitter,
    types[Move].jitter_value_min,
    types[Move].jitter_value_max,
    types[Move].fake_limit_type,
    types[Move].left_desync_value,
    types[Move].right_desync_value,
    types[Move].fake_option,
    types[Move].lby_mode,
    types[Move].freestand_desync,
    types[Move].desync_on_shot,
    types[Move].fakelag_value,
    types[Move].random_value,

    --types[Standing].yaw,
    types[Stay].yaw_add_r,
    types[Stay].yaw_add_l,
    types[Stay].jitter_mode,
    types[Stay].jitter,
    types[Stay].jitter_value_min,
    types[Stay].jitter_value_max,
    types[Stay].fake_limit_type,
    types[Stay].left_desync_value,
    types[Stay].right_desync_value,
    types[Stay].fake_option,
    types[Stay].lby_mode,
    types[Stay].freestand_desync,
    types[Stay].desync_on_shot,
    types[Stay].fakelag_value,
    types[Stay].random_value,

    --types[Shared].yaw,
    types[Shared].yaw_add_r,
    types[Shared].yaw_add_l,
    types[Shared].jitter_mode,
    types[Shared].jitter,
    types[Shared].jitter_value_min,
    types[Shared].jitter_value_max,
    types[Shared].fake_limit_type,
    types[Shared].left_desync_value,
    types[Shared].right_desync_value,
    types[Shared].fake_option,
    types[Shared].lby_mode,
    types[Shared].freestand_desync,
    types[Shared].desync_on_shot,
    types[Shared].fakelag_value,
    types[Shared].random_value,

    types[anti_aim_preset].yaw_add_r,
    types[anti_aim_preset].yaw_add_l,
    types[anti_aim_preset].jitter_mode,
    types[anti_aim_preset].jitter,
    types[anti_aim_preset].jitter_value_min,
    types[anti_aim_preset].jitter_value_max,
    types[anti_aim_preset].fake_limit_type,
    types[anti_aim_preset].left_desync_value,
    types[anti_aim_preset].right_desync_value,
    types[anti_aim_preset].fake_option,
    types[anti_aim_preset].lby_mode,
    types[anti_aim_preset].freestand_desync,
    types[anti_aim_preset].desync_on_shot,
    types[anti_aim_preset].fakelag_value,
    types[anti_aim_preset].random_value,

    types[Manual].yaw_add_r,
    types[Manual].yaw_add_l,
    types[Manual].jitter_mode,
    types[Manual].jitter,
    types[Manual].jitter_value_min,
    types[Manual].jitter_value_max,
    types[Manual].fake_limit_type,
    types[Manual].left_desync_value,
    types[Manual].right_desync_value,
    types[Manual].fake_option,
    types[Manual].lby_mode,
    types[Manual].freestand_desync,
    types[Manual].desync_on_shot,
    types[Manual].fakelag_value,
    types[Manual].random_value,

    jitter_b1,
    lby_mode_b1,
    jitter_b2,
    lby_mode_b2,
    jitter_b3,
    lby_mode_b3,
    jitter_b4,
    lby_mode_b4,
    yaw_add_l_b1,
    yaw_add_r_b1,
    jitter_value_b1,
    phase1,
    yaw_add_l_b2,
    yaw_add_r_b2,
    jitter_value_b2,
    phase2,
    yaw_add_l_b3,
    yaw_add_r_b3,
    jitter_value_b3,
    phase3,
    yaw_add_l_b4,
    yaw_add_r_b4,
    jitter_value_b4,
    phase4,
    indicators_style,
    indicators_add,
    teleport_weapons,
    screen_dmg_x,
    screen_dmg_y,
    vel_mod_add_x,
    vel_mod_add_y,
    alpha_slider,
    keybinds_x,
    keybinds_y
},

floats = {

},

strings = {

},

colors = {
    Hitmarker,
    auto_peek,
    penetration,
    accent_color
}
}

de_en_coding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='

function encode(data)
return ((data:gsub('.', function(x)
local r,de_en_coding='',x:byte()
for i=8,1,-1 do r=r..(de_en_coding%2^i-de_en_coding%2^(i-1)>0 and '1' or '0') end
return r;
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c=0
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
return de_en_coding:sub(c+1,c+1)
end)..({ '', '==', '=' })[#data%3+1])
end

function decode(data)
data = string_gsub(data, '[^'..de_en_coding..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(de_en_coding:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string_char(c)
end))
end

export_cfg:RegisterCallback(function()
local Code = {{}, {}, {}, {}, {}}

for _, bools in pairs(cfg_data.bools) do
table_insert(Code[1], bools:GetBool())
end

for _, ints in pairs(cfg_data.ints) do
table_insert(Code[2], ints:GetInt())
end

for _, floats in pairs(cfg_data.floats) do
table_insert(Code[3], floats:GetFloat())
end

for _, strings in pairs(cfg_data.strings) do
table_insert(Code[4], strings:GetString())
end

for _, colors in pairs(cfg_data.colors) do
local clr = colors:GetColor()
table_insert(Code[5], string_format('%02X%02X%02X%02X', math_floor(clr.r * 255), math_floor(clr.g * 255), math_floor(clr.b * 255), math_floor(clr.a * 255)))
end

Clipboard.Set(encode(JSON.stringify(Code)))
end)

function loadcfg(text)
decode_cfg = JSON.parse(decode(text))
if decode_cfg == nil then
print('Error!')
else
for k, v in pairs(decode_cfg) do
    k = ({[1] = 'bools', [2] = 'ints', [3] = 'floats', [4] = 'strings', [5] = 'colors'})[k]

    for k2, v2 in pairs(v) do
        if (k == 'bools') then
            cfg_data[k][k2]:SetBool(v2)
        end

        if (k == 'ints') then
            cfg_data[k][k2]:SetInt(v2)
        end

        if (k == 'floats') then
            cfg_data[k][k2]:SetFloat(v2)
        end

        if (k == 'strings') then
            cfg_data[k][k2]:SetString(v2)
        end

        if (k == 'colors') then
            cfg_data[k][k2]:SetColor(Color_new(tonumber('0x'..v2:sub(1, 2))/255, tonumber('0x'..v2:sub(3, 4))/255, tonumber('0x'..v2:sub(5, 6))/255, tonumber('0x'..v2:sub(7, 8))/255))
        end
    end
end
end
end
import_cfg:RegisterCallback(function()
    loadcfg(Clipboard.Get())
end)
default_cfg:RegisterCallback(function()
    Http.GetAsync('https://www.toptal.com/developers/hastebin/raw/ovosovobuh', function(url_content)
        loadcfg(url_content)
    end)
end)

Cheat_RegisterCallback("frame_stage", function(s)
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
if s == 5 then
on_run_command()
if request_time + 1 < GlobalVars.curtime then
    frametime = GlobalVars.frametime
    request_time = GlobalVars.curtime
    table_insert(frametimes, 1, frametime)

    if #frametimes > 4 then
        table_remove(frametimes, i)
    end
end
end
end)

Cheat_RegisterCallback('registered_shot', function(shot)
reg_shot(shot)


if advanced_shot_logger:GetBool() then
registered_shot(shot)
end
end)

Cheat_RegisterCallback('destroy', function()
Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):SetInt(ref_remove_scope)
CVar_FindVar('sv_disable_radar'):SetInt(0);

end)

Cheat_RegisterCallback('createmove', function(cmd)
if roll_aa_active == true then
actual_move = Vector2_new(cmd.forwardmove, cmd.sidemove) / 2
else
actual_move = Vector2_new(cmd.forwardmove, cmd.sidemove)
end
roll_move_fix(cmd)
update_choked()

end)

Cheat_RegisterCallback('prediction', function(cmd)
    if proper_baim:GetBool() then
        proper_baim_lethal()
    end
teleport_in_air()
dormant_aimbot(cmd)
anti_aims(cmd)
if idealpeek:GetBool() then
ideal_peek()
end
end)

Cheat_RegisterCallback('pre_prediction', function(cmd)
    if penetration:GetBool() then
        prenetration_prediction()
    end
end)

Cheat_RegisterCallback('events', function(e)
load_markers_modules(e)
resetter(e)
anti_bruteforcee(e)
if hitsound_custom:GetBool() then
custom_hitsound(e)
end
if shit_talk:GetBool() then
trashtalk(e)
end
end)

--anti_bruteforce_work.phases:SetVisible(false)

Cheat_RegisterCallback('draw', function()
    if penetration:GetBool() then
        penetration_ind()
    end
if Hitmarker:GetBool() then
damage_markerd()

move_position()
end

if auto_peek:GetBool() then
autopeek()
end
if custom_scope_switch:GetBool() then
custom_scope()
end
if clan_tag:GetBool() then
clantag()
end
handle_brutforcetime()
indicators()
log_draw()
if windows_value:Get(2) then
keybinds()
end
if windows_value:Get(1) then
watermark()
end
if windows_value:Get(3) or windows_value:Get(4) then
solus_ui()
end

if Cheat_IsMenuVisible() then
dormant_mindmg:SetVisible(dormant_aim:GetBool())
air_hitchance_value:SetVisible(air_hitchance:GetBool())
noscope_hitchance_value:SetVisible(noscope_hitchance:GetBool())
teleport_weapons:SetVisible(auto_teleport_in_air:GetBool())
for k,v in pairs(types) do
    for i,data in pairs(v) do
        if conditions:GetBool() and enable__aa:GetBool() then data:SetVisible(type:Get()+1 == k and enable__aa:GetBool()) else data:SetVisible(9 == k and enable__aa:GetBool()) end
        if conditions:GetBool() and enable__aa:GetBool() and type:Get() == 8 then
            data:SetVisible(false)
        end
    end
end
avoid_backstab:SetVisible(enable__aa:GetBool())
conditions:SetVisible(enable__aa:GetBool())
type:SetVisible(conditions:GetBool() and enable__aa:GetBool())
yaw_on_use:SetVisible(override_on_use:GetBool() and conditions:GetBool() and enable__aa:GetBool() and type:Get() == 1)
override_on_use:SetVisible(type:Get() == 1 and conditions:GetBool() and enable__aa:GetBool() )
override_stand:SetVisible(type:Get() == 2 and conditions:GetBool() and enable__aa:GetBool() )
override_crouch:SetVisible(type:Get() == 3 and conditions:GetBool() and enable__aa:GetBool() )
override_slowwalk:SetVisible(type:Get() == 4 and conditions:GetBool() and enable__aa:GetBool() )
override_move:SetVisible(type:Get() == 5 and conditions:GetBool() and enable__aa:GetBool() )
override_air:SetVisible(type:Get() == 6 and conditions:GetBool() and enable__aa:GetBool())
override_manual:SetVisible(type:Get() == 7 and conditions:GetBool() and enable__aa:GetBool())
enabled_antibrute:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool())
enable_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
yaw_add_l_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
yaw_add_r_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
jitter_b1:SetVisible(type:Get() == 8 and enable__aa:GetBool() )
jitter_value_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
lby_mode_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
phase1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
teamskeet_kb:SetVisible(windows_value:Get(2))
gradient:SetVisible(windows_value:Get(2) and teamskeet_kb:Get() == 0)
yaw_add_l_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
yaw_add_r_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
jitter_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
jitter_value_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
lby_mode_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
phase2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )

enable_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
yaw_add_l_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_r_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_value_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
lby_mode_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
phase3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
penetration_position:SetVisible(penetration:GetBool())
    penetration_rainbow:SetVisible(penetration:GetBool())
    penetration_speed:SetVisible(penetration:GetBool())
enable_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_l_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_r_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_value_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
lby_mode_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
phase4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )


indicators_add:SetVisible(indicators_style:GetBool(1))
alpha_slider:SetVisible(windows_value:Get(2) or windows_value:Get(3) or windows_value:Get(4) or windows_value:Get(1))
blur_back:SetVisible(windows_value:Get(2) or windows_value:Get(3) or windows_value:Get(4) or windows_value:Get(1))
scope_size:SetVisible(custom_scope_switch:GetBool())
scope_gap:SetVisible(custom_scope_switch:GetBool())
scope_color:SetVisible(custom_scope_switch:GetBool())
screen_dmg_x:SetVisible(screen_dmg:GetBool())
vel_mod_add_x:SetVisible(vel_mod_ind:GetBool())
vel_mod_add_y:SetVisible(vel_mod_ind:GetBool())
screen_dmg_y:SetVisible(screen_dmg:GetBool())
end

end)

Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Эксперт
Статус
Оффлайн
Регистрация
19 Дек 2018
Сообщения
2,955
Реакции[?]
491
Поинты[?]
1K
code_language.asm6502:
local ffi = require 'ffi'
-- local variables for API functions. any changes to the line below will be lost on re-generation
AntiAim_GetCurrentRealRotation, AntiAim_GetInverterState, AntiAim_OverrideInverter, AntiAim_OverrideLimit, bit_band, bit_lshift, Cheat_AddNotify, Cheat_GetBinds, Cheat_GetCheatUserName, Cheat_GetMousePos, Cheat_IsKeyDown, Cheat_IsMenuVisible, Cheat_RegisterCallback, Color_new, Color_RGBA, EngineClient_ExecuteClientCmd, EngineClient_GetNetChannelInfo, EngineClient_GetScreenSize, EngineClient_GetViewAngles, EngineClient_IsConnected, EngineClient_IsInGame, EntityList_GetClientEntity, EntityList_GetEntitiesByClassID, EntityList_GetLocalPlayer, EntityList_GetPlayerForUserID, EntityList_GetPlayerFromHandle, EntityList_GetPlayers, Exploits_GetCharge, Exploits_OverrideDoubleTapSpeed, math_abs, math_atan2, math_cos, math_deg, math_floor, math_max, math_min, math_sin, Menu_Button, Menu_ColorEdit, Menu_Combo, Menu_FindVar, Menu_MultiCombo, Menu_SliderInt, Menu_Switch, Menu_Text, Utils_PatternScan, Utils_RandomInt, pairs, Panorama_Open, Render_Box, Render_BoxFilled, Render_CalcTextSize, Render_Circle, Render_GradientBoxFilled, Render_InitFont, Render_PolyFilled, Render_Text, string_sub, tostring, Vector2_new, print, string_format, table_insert, table_remove, ipairs, Vector_new, EngineClient_GetLocalPlayer, EntityList_GetEntitiesByName, math_pi, QAngle_new, Cheat_FireBullet, math_sqrt, bit_bor, ffi_cdef, ffi_typeof, ffi_cast, EngineClient_GetGameDirectory, string_gsub, ffi_C, ffi_string, RageBot_OverrideMinDamage, math_ceil, Menu_SwitchColor, string_lower, Utils_CreateInterface, CVar_FindVar, table_concat, AntiAim_GetFakeRotation, ffi_new, EntityList_GetClientEntityFromHandle, string_find, Render_LoadImage, ffi_copy, AntiAim_OverrideYawOffset, Render_WorldToScreen, Render_Blur, Panorama_LoadString, ffi_sizeof, string_char, Render_Circle3DFilled, RageBot_OverrideHitchance, Exploits_ForceTeleport, math_rad = AntiAim.GetCurrentRealRotation, AntiAim.GetInverterState, AntiAim.OverrideInverter, AntiAim.OverrideLimit, bit.band, bit.lshift, Cheat.AddNotify, Cheat.GetBinds, Cheat.GetCheatUserName, Cheat.GetMousePos, Cheat.IsKeyDown, Cheat.IsMenuVisible, Cheat.RegisterCallback, Color.new, Color.RGBA, EngineClient.ExecuteClientCmd, EngineClient.GetNetChannelInfo, EngineClient.GetScreenSize, EngineClient.GetViewAngles, EngineClient.IsConnected, EngineClient.IsInGame, EntityList.GetClientEntity, EntityList.GetEntitiesByClassID, EntityList.GetLocalPlayer, EntityList.GetPlayerForUserID, EntityList.GetPlayerFromHandle, EntityList.GetPlayers, Exploits.GetCharge, Exploits.OverrideDoubleTapSpeed, math.abs, math.atan2, math.cos, math.deg, math.floor, math.max, math.min, math.sin, Menu.Button, Menu.ColorEdit, Menu.Combo, Menu.FindVar, Menu.MultiCombo, Menu.SliderInt, Menu.Switch, Menu.Text, Utils.PatternScan, Utils.RandomInt, pairs, Panorama.Open, Render.Box, Render.BoxFilled, Render.CalcTextSize, Render.Circle, Render.GradientBoxFilled, Render.InitFont, Render.PolyFilled, Render.Text, string.sub, tostring, Vector2.new, print, string.format, table.insert, table.remove, ipairs, Vector.new, EngineClient.GetLocalPlayer, EntityList.GetEntitiesByName, math.pi, QAngle.new, Cheat.FireBullet, math.sqrt, bit.bor, ffi.cdef, ffi.typeof, ffi.cast, EngineClient.GetGameDirectory, string.gsub, ffi.C, ffi.string, RageBot.OverrideMinDamage, math.ceil, Menu.SwitchColor, string.lower, Utils.CreateInterface, CVar.FindVar, table.concat, AntiAim.GetFakeRotation, ffi.new, EntityList.GetClientEntityFromHandle, string.find, Render.LoadImage, ffi.copy, AntiAim.OverrideYawOffset, Render.WorldToScreen, Render.Blur, Panorama.LoadString, ffi.sizeof, string.char, Render.Circle3DFilled, RageBot.OverrideHitchance, Exploits.ForceTeleport, math.rad
Cheat_AddNotify('Alien.lua', 'Welcome to alien.lua, '..Cheat_GetCheatUserName()..'!')
Clipboard = {}
ffi.cdef[[
typedef void*(__thiscall* getnetchannel_t)(void*); // engineclient 78
typedef unsigned short WORD;
typedef struct _SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
}
SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

typedef int(__thiscall* get_clipboard_text_length)(void*);
typedef void(__thiscall* set_clipboard_text)(void*, const char*, int);
typedef void(__thiscall* get_clipboard_text)(void*, int, const char*, int);

void GetLocalTime(
LPSYSTEMTIME lpSystemTime
);
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);
typedef struct {
    uint8_t r; uint8_t g; uint8_t b; uint8_t a;
} color_struct_t;

typedef void (*console_color_print)(const color_struct_t&, const char*, ...);
void* GetProcAddress(void* hModule, const char* lpProcName);
void* GetModuleHandleA(const char* lpModuleName);

int       CreateDirectoryA(const char*, void*);
void*     CreateFileA(const char*, uintptr_t, uintptr_t, void*, uintptr_t, uintptr_t, void*);
uintptr_t GetFileSize(void*, uintptr_t*);
int       ReadFile(void*, void*, uintptr_t, uintptr_t*, void*);
int       WriteFile(void*, const void*, uintptr_t, uintptr_t*, void*);
int       CloseHandle(void*);
typedef float*(__thiscall* bound)(void*);

]]

color_print_fn = ffi.cast("console_color_print", ffi.C.GetProcAddress(ffi.C.GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXABVColor@@PBDZZ"))

function colored_print(color, text)
    local col = ffi.new("color_struct_t")
    for i, v in pairs({"r", "g", "b", "a"}) do
        col[v] = color[v] * 255
    end
    color_print_fn(col, text)
end

local urlmon = ffi.load 'UrlMon'
local wininet = ffi.load 'WinInet'
local screen_size = EngineClient_GetScreenSize()

local default_cfg = Menu_Button('Global', 'Configs', 'Load Default Config', '')
local export_cfg = Menu_Button('Global', 'Configs', 'Export Config', '')
local import_cfg = Menu_Button('Global', 'Configs', 'Import Config', '')
Menu_Text('Global', 'Information', 'Welcome '..Cheat_GetCheatUserName()..'!

Version: Live 0.1!')

local dormant_aim = Menu_Switch('Rage', 'Ragebot', 'Dormant Aimbot', false)
local dormant_mindmg = Menu_SliderInt('Rage', 'Ragebot', 'Dormant MinDmg', 10, 1, 100)
local air_hitchance = Menu_Switch('Rage', 'Ragebot', 'Custom Air Hitchance', false)
local air_hitchance_value = Menu_SliderInt('Rage', 'Ragebot', 'Air Hitchance', 1, 1, 100)
local noscope_hitchance = Menu_Switch('Rage', 'Ragebot', 'Custom Noscope Hitchance', false)
local noscope_hitchance_value = Menu_SliderInt('Rage', 'Ragebot', 'Noscope Hitchance', 1, 1, 100)
local auto_teleport_in_air = Menu_Switch('Rage', 'Ragebot', 'Automatic Cross Teleport in Air', false)
local teleport_weapons = Menu_MultiCombo('Rage', 'Ragebot', 'Teleport weapons', {'AWP', 'AutoSnipers', 'Scout', 'Deagle', 'Revolver', 'Nades', 'Other', 'Pistols', 'Rifle/LMG', 'SMG', 'Shotgun', 'Taser'}, 0)
local proper_baim = Menu_Switch('Rage', 'Ragebot', 'Force Baim if Lethal', false)

local enable__aa = Menu_Switch('Anti Aim', 'Anti Aim', 'Enable', false)
local avoid_backstab = Menu_Switch('Anti Aim', 'Anti Aim', 'Avoid Backstab', false)
local conditions = Menu_Switch('Anti Aim', 'Anti Aim', 'Conditions', false)
local type = Menu_Combo('Anti Aim', 'Anti Aim', 'Currect Condition', {'Shared', 'On Use', 'Stay', 'Crouch', 'Slow Walk', 'Move', 'Air', 'Manual', 'Anti-Bruteforce'}, 0)
local manual_yaw_base = Menu_Combo('Anti Aim', 'Anti Aim', 'Manual Yaw Base', {'Disabled', 'Forward', 'Backward', 'Right', 'Left', 'At Target', 'Freestanding'}, 0)
local override_on_use = Menu_Switch('Anti Aim', 'Anti Aim', 'Override On Use', false)
local override_stand = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Stay', false)
local override_crouch = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Crouch', false)
local override_slowwalk = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Slow Walk', false)
local override_move = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Move', false)
local override_air = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Air', false)
local enabled_antibrute = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Anti Bruteforce', false)
local override_manual = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Manual', false)

local types = {}
local numtotext = {
    [0] = 'Shared',
    [1] = 'On Use',
    [2] = 'Stay',
    [3] = 'Crouch',
    [4] = 'Slow Walk',
    [5] = 'Move',
    [6] = 'Air',
    [7] = 'Manual',
    [8] = 'Anti Aim Preset',
}
local i = 0
local yaw_on_use = Menu_Combo('Anti Aim', 'On Use', 'Yaw Base', {'Forward', 'Backward', 'Right', 'Left', 'At Target', 'Freestanding'}, 0)
while #types ~= 9 do
    table_insert(types, {
        yaw_add_l = Menu_SliderInt('Anti Aim', numtotext[i], 'Yaw Add Left', 0, -180, 180),
        yaw_add_r = Menu_SliderInt('Anti Aim', numtotext[i], 'Yaw Add Right', 0, -180, 180),
        jitter_mode = Menu_Combo('Anti Aim', numtotext[i], 'Yaw Modifier Mode', {'Disabled', 'Random'}, 0),
        jitter = Menu_Combo('Anti Aim', numtotext[i], 'Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0),
        --jitter_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree',0, -180, 180),
        jitter_value_min = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree Min',0, -180, 180),
        jitter_value_max = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree Max',0, -180, 180),
        fake_limit_type = Menu_Combo('Anti Aim', numtotext[i], 'Fake Limit Type', {'Static', 'Jitter'}, 0),
        left_desync_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Left Limit', 0, 0, 60),
        right_desync_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Right Limit', 0, 0, 60),
        fake_option = Menu_MultiCombo('Anti Aim', numtotext[i], 'Fake Options', {'Avoid Overlap', 'Jitter', 'Randomize Jitter', 'Anti Bruteforce'}, 0),
        lby_mode = Menu_Combo('Anti Aim', numtotext[i], 'LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0),
        freestand_desync = Menu_Combo('Anti Aim', numtotext[i], 'Freestanding Desync', {'Off', 'Peek Fake', 'Peek Real'}, 0),
        desync_on_shot = Menu_Combo('Anti Aim', numtotext[i], 'Desync On Shot', {'Disabled', 'Opposite', 'Freestanding', 'Switch'}, 0),
        fakelag = Menu_Switch('Anti Aim', numtotext[i], 'Enable Fake Lag', false),
        fakelag_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Limit', 0, 0, 14),
        random_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Randomization', 0, 0, 14),
        mega_shit = Menu_Switch('Anti Aim', numtotext[i], 'Roll AA', false),
    })
    i = i + 1
end

yaw_add_l_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Yaw Add Left', 0, -180, 180)
yaw_add_r_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Yaw Add Right', 0, -180, 180)
jitter_b1 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[1] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Modifier Degree',0,-180,180)
lby_mode_b1 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[1] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Fake Limit', 0, -60, 60)

enable_b2 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 2', false)
yaw_add_l_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Yaw Add Left', 0, -180, 180)
yaw_add_r_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Yaw Add Right', 0, -180, 180)
jitter_b2 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[2] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Modifier Degree',0,-180,180)
lby_mode_b2 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[2] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Fake Limit', 0, -60, 60)

enable_b3 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 3', false)
yaw_add_l_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Yaw Add Left', 0, -180, 180)
yaw_add_r_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Yaw Add Right', 0, -180, 180)
jitter_b3 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[3] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Modifier Degree',0,-180,180)
lby_mode_b3 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[3] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Fake Limit', 0, -60, 60)

enable_b4 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 4', false)
yaw_add_l_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Yaw Add Left', 0, -180, 180)
yaw_add_r_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Yaw Add Right', 0, -180, 180)
jitter_b4 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[4] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Modifier Degree',0,-180,180)
lby_mode_b4 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[4] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Fake Limit', 0, -60, 60)

local indicators_style = Menu_MultiCombo('Visuals', 'Visuals', 'Crosshair Indicators', {'Drain yaw', 'Acatel', 'Medusa', 'Arctic', 'Half-Life'}, 0)
local indicators_add = Menu_MultiCombo('Visuals', 'Visuals', 'Indicators Add', {'Script Name', 'Inverter', 'Anti-Aim Arrow',  'Anti-Aim State', 'Double-Tap', 'Hide Shots', 'Minimum Damage', 'Force Body Aim', 'Force Safe Points', 'Freestanding', 'Ideal tick'}, 0)
local windows_value = Menu_MultiCombo('Visuals', 'Visuals', 'Windows', {'Watermark', 'Hotkey list', 'Anti-aimbot indication', 'Frequency update information'}, 0)
local teamskeet_kb = Menu_Combo('Visuals', 'Visuals', 'Hotkey list theme', {'Teamskeet', "Default"}, 0)
local gradient = Menu_Switch('Visuals', 'Visuals', 'Hotkey list Gradient', false)
local custom_scope_switch = Menu_Switch('Visuals', 'Visuals', 'Custom Scope', false)
local auto_peek = Menu_SwitchColor('Visuals', 'Visuals', 'Glow AutoPeek', false, Color_RGBA(255, 0, 0, 255))
local arrows_ind = Menu_Combo('Visuals', 'Visuals', 'Arrows', {'Disable', 'Teamskeet', 'Modern', "Default", 'Drain yaw'}, 0)
local vel_mod_ind = Menu_Switch('Visuals', 'Visuals', 'Velocity Modifier Indicator', false)
local screen_dmg = Menu_Switch('Visuals', 'Visuals', 'Min damage Indicator', false)
local Hitmarker = Menu_SwitchColor('Visuals', 'Visuals', 'Hitmarker', false, Color_RGBA(255, 255, 255, 255))
local penetration = Menu_SwitchColor('Visuals', 'Visuals', 'Penetration indicator', false, Color_RGBA(255, 195, 13, 255))

local accent_color = Menu_ColorEdit('Visuals', 'Settings', 'Accent Color', Color_RGBA(177, 171, 255, 255))
local alpha_slider = Menu_SliderInt('Visuals', 'Settings', 'Background Alpha', 222, 0, 255)
local blur_back = Menu_Switch('Visuals', 'Settings', 'Background Blur', false)
local keybinds_x = Menu_SliderInt('Visuals', 'Settings', 'x_pos', screen_size.x/2-250, 1, screen_size.x)
local keybinds_y = Menu_SliderInt('Visuals', 'Settings', 'y_pos', screen_size.y/2-50, 1, screen_size.y)
local ind_clr = Menu_ColorEdit('Visuals', 'Settings', 'Arrow Color', Color_RGBA(175, 255, 0, 255))
local ind_clr2 = Menu_ColorEdit('Visuals', 'Settings', 'Arrow Desync Color', Color_RGBA(0, 200, 255, 255))
local vel_mod_add_x = Menu_SliderInt('Visuals', 'Settings', 'Velocity Modifier X', 22, -screen_size.x, screen_size.x)
local vel_mod_add_y = Menu_SliderInt('Visuals', 'Settings', 'Velocity Modifier Y', 200, -screen_size.y, screen_size.y)
local screen_dmg_x = Menu_SliderInt('Visuals', 'Settings', 'Mindamage Add X', 0, -100, 100)
local screen_dmg_y = Menu_SliderInt('Visuals', 'Settings', 'Mindamage Add Y', 0, -100, 100)
local scope_size = Menu_SliderInt('Visuals', 'Settings', 'Custom Scope Size', 50, 50, screen_size.y/2)
local scope_gap = Menu_SliderInt('Visuals', 'Settings', 'Custom Scope Gap', 10, 0, screen_size.y/2)

local scope_color = Menu_ColorEdit('Visuals', 'Settings', 'Scope Color', Color_RGBA(255, 255, 255, 255))
local scope_color1 = Menu_ColorEdit('Visuals', 'Settings', 'Scope Color 1', Color_RGBA(255, 255, 255, 0))
local penetration_position = Menu_SliderInt('Visuals', 'Settings', 'Position indicator', -25, -50, 50)
local penetration_rainbow = Menu_Switch('Visuals', 'Settings', 'Rainbow mode', false)
local penetration_speed = Menu_SliderInt('Visuals', 'Settings', 'Speed rainbow', 50, 1, 100)
scope_color1:SetVisible(false)
download_file_from_url = function(from, to)
wininet.DeleteUrlCacheEntryA(from)
urlmon.URLDownloadToFileA(nil, from, to, 0,0)
end

ct = ffi_typeof('char[?]')
c_invalid_handle_value = ffi_cast('void*', -1)
local netChannelInt = ffi_typeof('int(__thiscall*)(void*, int)')
local netChannelBool = ffi_typeof('bool(__thiscall*)(void*)')
local netChannelBoolWithArgs = ffi_typeof('bool(__thiscall*)(void*, int, int)')
local netChannelFloat = ffi_typeof('float(__thiscall*)(void*, int)')
function GetNetChannel(netChannelInfo)
if netChannelInfo == nil then
    return
end

local SequenceNr = ffi_cast(netChannelInt, netChannelInfo[0][17])(netChannelInfo, 1)

return {
    SequenceNr = SequenceNr,

    IsLoopback = ffi_cast(netChannelBool, netChannelInfo[0][6])(netChannelInfo),
    IsTimingOut = ffi_cast(netChannelBool, netChannelInfo[0][7])(netChannelInfo),

    Latency = {
        RTT = function(flow) return ffi_cast(netChannelFloat, netChannelInfo[0][9])(netChannelInfo, flow) end,
        AvgLatency = function(flow) return ffi_cast(netChannelFloat, netChannelInfo[0][10])(netChannelInfo, flow) end,
    },

    AvgLoss = ffi_cast(netChannelFloat, netChannelInfo[0][11])(netChannelInfo, 1),
    AvgChoke = ffi_cast(netChannelFloat, netChannelInfo[0][12])(netChannelInfo, 1),
    InputBytes = ffi_cast(netChannelFloat, netChannelInfo[0][13])(netChannelInfo, 1),
    SendBytes = ffi_cast(netChannelFloat, netChannelInfo[0][13])(netChannelInfo, 0),

    IsValidPacket = ffi_cast(netChannelBoolWithArgs, netChannelInfo[0][18])(netChannelInfo, 1, SequenceNr-1),
}
end

function package.loaded.readfile(filename)
local fp = ffi_C.CreateFileA(filename, 0x80000000, 3, nil, 3, 128, nil)
if c_invalid_handle_value ~= fp then
    local size = ffi_C.GetFileSize(fp, nil)
    local buf = ct(size + 1)
    ffi_C.ReadFile(fp, buf, size, nil, nil)
    ffi_C.CloseHandle(fp)
    return ffi_string(buf, size)
end
end

game_path_str = EngineClient_GetGameDirectory()
game_path = string_gsub(game_path_str, '\csgo', '\')

if (package.loaded.readfile('nl\alien\fonts\small_pixel.ttf') and package.loaded.readfile('nl\alien\fonts\arrows.ttf')) then

else
ffi.C.CreateDirectoryA('nl\alien\', NULL)
ffi.C.CreateDirectoryA('nl\alien\fonts\', NULL)

download_file_from_url('https://fontsforyou.com/downloads/99851-smallestpixel97', 'nl\alien\fonts\small_pixel.ttf')
download_file_from_url('https://cdn.discordapp.com/attachments/947429839101624320/952177029867003924/arrows.ttf', 'nl\alien\fonts\arrows.ttf')
Menu_Text('Global', 'Information', 'Dear User, Restart script!')
Cheat_AddNotify('alien', 'Files downloaded, restart script!')
end

local anti_bruteforce_work = {
phases = stagesb,
work = false,
work_value = 0.0,
work_memory = {

},
memory = {

}
}

for i = 0, 64 do
table_insert(anti_bruteforce_work.memory,i,{count = 0})
end


local advanced_shot_logger = Menu_Switch('Misc', 'Misc', 'Advanced Shot Logger', false)
local hitsound_custom = Menu_Switch('Misc', 'Misc', 'Skeet Hitsound', false)
local clan_tag = Menu_Switch('Misc', 'Misc', 'Clan-Tag Changer', false)
local shit_talk = Menu_Switch('Misc', 'Misc', 'TrashTalk', false)
local idealpeek = Menu_Switch('Misc', 'Misc', 'Ideal Peek', false)

local Shared = 1
local On_Use = 2
local Stay = 3
local Crouch = 4
local SlowWalk = 5
local Move = 6
local Air = 7
local Manual = 8
local legitaa_time = GlobalVars.realtime
local anti_aim_preset = 9
local ConVar = {
yaw = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'),
yaw_add = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Add'),
jitter = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Modifier'),
jitter_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Modifier Degree'),
left_desync_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Left Limit'),
right_desync_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Right Limit'),
fake_option = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Fake Options'),
lby_mode = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'LBY Mode'),
freestand_desync = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Freestanding Desync'),
desync_on_shot = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Desync On Shot'),
fakelag = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Enable Fake Lag'),
fakelag_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Limit'),
random_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Randomization'),

slowwalk = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Slow Walk'),
fakeduck = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Fake Duck'),
}
local original_aa = true

function modify_velocity(cmd, goalspeed)
local minspeed = math_sqrt((cmd.forwardmove * cmd.forwardmove) + (cmd.sidemove * cmd.sidemove))
if goalspeed <= 0 or minspeed <= 0 then
    return
end

if EntityList_GetLocalPlayer():GetProp('m_flDuckAmount') >= 1 then
    goalspeed = goalspeed * 2.94117647
end

if minspeed <= goalspeed then
    return
end

local speedfactor = goalspeed / minspeed
cmd.forwardmove = cmd.forwardmove * speedfactor
cmd.sidemove = cmd.sidemove * speedfactor
end

roundStarted = 0
player_info_prev = {}
dormant_flag = false

for i = 1, 64 do
player_info_prev[i] = {
    origin = Vector_new(0, 0, 0),
}
end

function calc_angle(src, dst)
local vecdelta = Vector_new(dst.x - src.x, dst.y - src.y, dst.z - src.z)
local angles = QAngle_new(math_atan2(-vecdelta.z, vecdelta:Length2D()) * 180.0 / math_pi, (math_atan2(vecdelta.y, vecdelta.x) * 180.0 / math_pi), 0.0)
return angles
end

min = Vector_new()
max = Vector_new()
target_correct = true
last_value = 0
should = false
dmg_type = 0
once = false
prsd_damage = 0


function dormant_aimbot(cmd)

local players = EntityList_GetPlayers()
local m_bIsScoped = EntityList_GetLocalPlayer():GetProp('m_bIsScoped')
local is_in_air = bit_band(EntityList_GetLocalPlayer():GetProp('m_fFlags'), bit_lshift(1,0)) ~= 0
local weapon = EntityList_GetLocalPlayer():GetActiveWeapon()
if weapon == nil then return end
for _, enemy in ipairs(players) do
    if not enemy:IsTeamMate() and enemy ~= EntityList_GetLocalPlayer() then
        local enemy_index = enemy:EntIndex()
        if air_hitchance:GetBool() and not is_in_air then
            RageBot_OverrideHitchance(enemy_index, air_hitchance_value:GetInt())
        elseif noscope_hitchance:GetBool() and not m_bIsScoped and weapon:IsSniper() then
            RageBot_OverrideHitchance(enemy_index, noscope_hitchance_value:GetInt())
        end
    end
end
if dormant_aim:GetBool() then
    local lp = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if lp == nil then return end

    local ent = lp:GetActiveWeapon()
    if not ent then
        return
    end

    --local ent = native_GetClientEntity(my_weapon)
    --if ent == nil or not native_IsWeapon(ent) then
    --    return
    --end

    local inaccuracy = ent:GetInaccuracy(ent)
    if inaccuracy == nil then
        return
    end

    local tickcount = GlobalVars.tickcount
    local eyepos = lp:GetEyePosition()
    local simtime = lp:GetProp('m_flSimulationTime')
    local weapon = ent:GetWeaponID()
    local scoped = lp:GetProp('m_bIsScoped')

    local onground = bit_band(lp:GetProp('m_fFlags'), bit_lshift(1, 0))
    if tickcount < roundStarted then return end -- to prevent shooting at ghost dormant esp @ the beginning of round
    local is_AWP = weapon == 9
    local is_auto = (weapon == 38 or weapon == 11)
    local is_scout = weapon == 40
    if ent:IsKnife() or ent:IsGrenade() or weapon == 31 then return end
    local can_shoot
    local hs_fix = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Hide Shots'):GetBool() and 0.3 or 0
    if weapon == 64 then -- for some reason can_shoot returns always false with r8 despite all 3 props being true, no idea why
        can_shoot = simtime > ent:GetProp('m_flNextPrimaryAttack') + hs_fix -- doing this fixes it ><
    elseif ent:IsPistol() and not weapon == 64 and not weapon == 1 then
        can_shoot = false
    else
        can_shoot = simtime > math_max(lp:GetProp('m_flNextAttack') + hs_fix, ent:GetProp('m_flNextPrimaryAttack') + hs_fix, ent:GetProp('m_flNextSecondaryAttack'))
    end

    -- new player info
    local players = EntityList_GetEntitiesByName('CCSPlayer')
    local player_info = {}
    for i = 1, #players do
        local player = players[i]:GetPlayer()
        if EngineClient_IsConnected() and lp:IsAlive() then
            --if plist_get(player, 'Add to whitelist') then goto skip end
            if player:IsDormant() and not player:IsTeamMate() and player:GetProp('m_iHealth') > 0 and player ~= lp then
                local can_hit

                local origin = player:GetProp('m_vecOrigin')
                local min = Vector_new()
                local max = Vector_new()
                local bounds = player:GetRenderBounds(min, max)
                local alpha_multiplier = player:GetESPAlpha() -- grab alpha of the dormant esp

                if player_info_prev[i] ~= nil and origin.x ~= 0 and alpha_multiplier > 0 then -- if origin / dormant esp is valid
                    -- update check
                    local dormant_accurate = alpha_multiplier > 0.1 -- for debug purposes lower this to 0.1

                    if dormant_accurate then
                        local target_points = {
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 28) or Vector_new(0, 0, 38)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 30) or Vector_new(0, 0, 40)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 32) or Vector_new(0, 0, 42)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 40) or Vector_new(0, 0, 50))
                        }

                        for i = 1, #target_points do
                            local target = target_points[i]
                            --local target = origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 30) or Vector_new(0, 0, 40))
                            local target_pos = calc_angle(eyepos, target)
                            local dmg = Cheat_FireBullet(lp, eyepos, target)

                            if is_AWP then
                                max_player_speed_alt = 100
                            elseif is_auto then
                                max_player_speed_alt = 120
                            else
                                max_player_speed_alt = is_scout and ent:GetMaxSpeed() * 0.8 or ent:GetMaxSpeed()
                            end
                            can_hit = (dmg.trace.hit_entity == nil or dmg.trace.hit_entity:EntIndex() == player:EntIndex()) and (dmg.damage > dormant_mindmg:GetInt()) and (not player:IsVisible(target)) -- added visibility check to mitigate shooting at anomalies?
                            if can_shoot and can_hit then
                                modify_velocity(cmd, (scoped and max_player_speed_alt or ent:GetMaxSpeed())*0.33)
                                dormant_flag = true
                                -- autoscope
                                if not scoped and ent:IsSniper() and onground == 1 then
                                    cmd.buttons = bit_bor(cmd.buttons, 2048)
                                end

                                if inaccuracy < 0.009 and ClientState.m_choked_commands == 0 then
                                    cmd.viewangles.pitch = target_pos.pitch
                                    cmd.viewangles.yaw = target_pos.yaw
                                    cmd.viewangles.roll = 0
                                    cmd.buttons = bit_bor(cmd.buttons, 1)
                                    dormant_flag = true
                                    -- dont shoot again
                                    can_shoot = false
                                end
                            elseif can_hit == false then
                                dormant_flag = false
                            end
                        end
                    end
                end
                player_info[i] = {origin, alpha_multiplier, can_hit}
            end
        end
        --::skip::
    end
    player_info_prev = player_info
end

end

function resetter(e)
if e:GetName() ~= 'round_prestart' then return end
local lp = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
if lp == nil then return end
local freezetime = (CVar_FindVar('mp_freezetime'):GetFloat()+1) / GlobalVars.interval_per_tick -- get freezetime plus 1 second and disable dormantbob for that amount of ticks
roundStarted = GlobalVars.tickcount + freezetime
origin = nil
for i = 1, 64 do
    player_info_prev[i] = {
        origin = Vector_new(0, 0, 0),
    }
end
frametimes = {}
player_info_prev = {}
player_info = {}
end

function normalize_yaw(yaww) while yaww > 180 do yaww = yaww - 360 end while yaww < -180 do yaww = yaww + 360 end return yaww end
function math_deg_atan(xdelta, ydelta)
    if xdelta == 0 and ydelta == 0 then
        return 0
    end
    return math_deg(math_atan2(ydelta, xdelta))
end
function nearest()
    function IsValid(ent)
        if ent == nil then
            return false
        else
            if ent:IsAlive() then
                return true
            else
                return false
            end
        end
    end
    if EngineClient_IsConnected() == nil or EngineClient_GetNetChannelInfo() == nil then return end
    local eyepos = EntityList_GetLocalPlayer():GetEyePosition()
    local viewangles = EngineClient_GetViewAngles()
    local bestenemy = nil
    local fov = 180
    for i=1, #EntityList_GetPlayers() do
        if(EntityList_GetPlayers()[i] ~= EntityList_GetLocalPlayer() and EntityList_GetPlayers()[i]:IsTeamMate() ~= true and IsValid(EntityList_GetPlayers()[i]) == true) then
            local cur = EntityList_GetPlayers()[i]:GetProp('m_vecOrigin')
            local cur_fov = math_abs(normalize_yaw(math_deg_atan(eyepos.x - cur.x, eyepos.y - cur.y) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = EntityList_GetPlayers()[i]
            end
        end
    end
    return bestenemy == nil and EntityList_GetLocalPlayer() or bestenemy
end

function override_limit(angle, isoverride)
    if roll_aa_active == true then return end
    if angle < 0 then
        if isoverride == true then AntiAim_OverrideInverter(true) end
        AntiAim_OverrideLimit(math_abs(angle))
        if anti_bruteforce_work_count+1 == 1 then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b1:Get() or yaw_add_l_b1:Get())
            ConVar.jitter:Set(jitter_b1:Get())
            ConVar.jitter_value:Set(jitter_value_b1:Get())
            ConVar.lby_mode:Set(lby_mode_b1:Get())
        elseif anti_bruteforce_work_count+1 == 2 and enable_b2:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b2:Get() or yaw_add_l_b2:Get())
            ConVar.jitter:Set(jitter_b2:Get())
            ConVar.jitter_value:Set(jitter_value_b2:Get())
            ConVar.lby_mode:Set(lby_mode_b2:Get())
        elseif anti_bruteforce_work_count+1 == 3 and enable_b3:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b3:Get() or yaw_add_l_b3:Get())
            ConVar.jitter:Set(jitter_b3:Get())
            ConVar.jitter_value:Set(jitter_value_b3:Get())
            ConVar.lby_mode:Set(lby_mode_b3:Get())
        elseif anti_bruteforce_work_count+1 == 4 and enable_b4:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b4:Get() or yaw_add_l_b4:Get())
            ConVar.jitter:Set(jitter_b4:Get())
            ConVar.jitter_value:Set(jitter_value_b4:Get())
            ConVar.lby_mode:Set(lby_mode_b4:Get())
        end
    elseif angle == 0 or angle > 0  then
        if isoverride == true then AntiAim_OverrideInverter(false) end
        AntiAim_OverrideLimit(angle)
        if anti_bruteforce_work_count+1 == 1 then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b1:Get() or yaw_add_l_b1:Get())
            ConVar.jitter:Set(jitter_b1:Get())
            ConVar.jitter_value:Set(jitter_value_b1:Get())
            ConVar.lby_mode:Set(lby_mode_b1:Get())
        elseif anti_bruteforce_work_count+1 == 2 and enable_b2:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b2:Get() or yaw_add_l_b2:Get())
            ConVar.jitter:Set(jitter_b2:Get())
            ConVar.jitter_value:Set(jitter_value_b2:Get())
            ConVar.lby_mode:Set(lby_mode_b2:Get())
        elseif anti_bruteforce_work_count+1 == 3 and enable_b3:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b3:Get() or yaw_add_l_b3:Get())
            ConVar.jitter:Set(jitter_b3:Get())
            ConVar.jitter_value:Set(jitter_value_b3:Get())
            ConVar.lby_mode:Set(lby_mode_b3:Get())
        elseif anti_bruteforce_work_count+1 == 4 and enable_b4:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b4:Get() or yaw_add_l_b4:Get())
            ConVar.jitter:Set(jitter_b4:Get())
            ConVar.jitter_value:Set(jitter_value_b4:Get())
            ConVar.lby_mode:Set(lby_mode_b4:Get())
        end
    end
end

function vec_closest_point_on_ray(target, ray_start, ray_end)
    local to = target - ray_start
    local direction = ray_end - ray_start
    local ray_length = #direction

    direction.x = direction.x / ray_length
    direction.y = direction.y / ray_length
    direction.z = direction.z / ray_length

    local direction_along = direction.x * to.x + direction.y * to.y + direction.z * to.z
    if direction_along < 0 then return ray_start end
    if direction_along > ray_length then return ray_end end

    return Vector_new(ray_start.x + direction.x * direction_along, ray_start.y + direction.y * direction_along, ray_start.z + direction.z * direction_along)
end

anti_bruteforce_work.tick_work = 0
anti_bruteforce_work.distance = 0
function bullet_impact(eye_pos, eyepos, impact)
    if not enabled_antibrute:GetBool() and roll_aa_active == true then return end
    anti_bruteforce_work.distance = vec_closest_point_on_ray(eye_pos, eyepos, impact):DistTo(eye_pos)
    if anti_bruteforce_work.distance > 65 then return end
    anti_bruteforce_work.tick_work = GlobalVars.tickcount
end

function handle_brutforcetime()
    if not enabled_antibrute:GetBool() and roll_aa_active == true then return end

    for i, var in ipairs(anti_bruteforce_work.work_memory) do
        if i > 1 then
            table_remove(anti_bruteforce_work.work_memory,i)
        end
        anti_bruteforce_work.work = true
        anti_bruteforce_work.work_value = GlobalVars.realtime - var.time
        if anti_bruteforce_work.work_value > 4 then
            anti_bruteforce_work.work_value = 0
            anti_bruteforce_work.work = false
            table_remove(anti_bruteforce_work.work_memory, i)
        end
    end
end
anti_bruteforce_work_count = 0

local hitlogs = {}
function anti_bruteforcee(e)
    if e:GetName() ~= 'bullet_impact' then return end
    if anti_bruteforce_work.tick_work == GlobalVars.tickcount then return end
    if EngineClient_GetNetChannelInfo() == nil then return end
    if not EngineClient_IsConnected() then return end
    if not EntityList_GetLocalPlayer():IsAlive() then return end
    if not EntityList_GetPlayerForUserID(e:GetInt('userid')) then return end
    if not e:GetInt('userid') then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsAlive() == false then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsDormant() == true then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsTeamMate() == true then return end
    if roll_aa_active == true then return end
    if not enabled_antibrute:GetBool() then return end
    if enable_b2:GetBool() and not enable_b3:GetBool() and not enable_b4:GetBool() then
        stagesb = 1
    elseif enable_b3:GetBool() and enable_b2:GetBool() and not enable_b4:GetBool() then
        stagesb = 2
    elseif enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() then
        stagesb = 3
    else
        stagesb = 0
    end
    local impact = Vector_new(e:GetInt('x'), e:GetInt('y'), e:GetInt('z'))
    local eyepos = EntityList_GetPlayerForUserID(e:GetInt('userid')):GetEyePosition()
    local eye_pos = EntityList_GetLocalPlayer():GetEyePosition()

    local head_vec = bullet_impact(eye_pos, eyepos, impact)

    if anti_bruteforce_work.distance < 65 then
        anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count + 1
        --print(stagesb)
        if stagesb < anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count then
            anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = 0
        end
        anti_bruteforce_work_count = anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count
        text = string_format('Switch due to shot [dst: %.0f]', anti_bruteforce_work.distance)

        print(text)
        table_insert(hitlogs, {text = text, time = GlobalVars.realtime})
        table_insert(anti_bruteforce_work.work_memory, 1, {time = GlobalVars.realtime})
    end
end

function C_BasePlayer:GetFlag(shift)
    return bit_band(self:GetProp('m_fFlags'), bit_lshift(1, shift)) ~= 0
end

function get_enemies()
    local enemies = {}

    for _, player in pairs(EntityList_GetPlayers()) do
        if (not player:IsTeamMate() and player:IsAlive()) then
            table_insert(enemies, player:GetPlayer())
        end
    end

    return enemies
end

function C_BasePlayer:CanHit()
    local trace_info = Cheat_FireBullet(self, self:GetEyePosition(), EntityList_GetLocalPlayer():GetEyePosition())

    if (trace_info.damage > 0 and ((trace_info.trace.hit_entity and trace_info.trace.hit_entity:GetPlayer() == EntityList_GetLocalPlayer()) or false)) then
        return true
    end

    return false
end

function teleport_in_air()
    if (auto_teleport_in_air:GetBool() and teleport_weapons:Get() ~= 0 and Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):Get()) then
        local allow_teleport = false
        local enable_teleport = false

        local active_weapon = EntityList_GetLocalPlayer():GetActiveWeapon()
        if active_weapon == nil then return end
        local weapon_id = active_weapon:GetWeaponID()

        local is_AWP = weapon_id == 9
        local is_auto = (weapon_id == 38 or weapon_id == 11)
        local is_scout = weapon_id == 40
        local is_deagle = weapon_id == 1
        local is_r8 = weapon_id == 64
        local is_nades = active_weapon:IsGrenade()
        local is_pistols = active_weapon:IsPistol() and not is_deagle and not is_r8
        local is_smg = (weapon_id == 34 or weapon_id == 23 or weapon_id == 24 or weapon_id == 19 or weapon_id == 26 or weapon_id == 33 or weapon_id == 17)
        local is_shotguns = (weapon_id == 35 or weapon_id == 25 or weapon_id == 27 or weapon_id == 29)
        local is_rifle = active_weapon:IsRifle() and not is_smg and not is_shotguns
        local is_taser = weapon_id == 31

        for _, weapons in pairs({
            {Value = 1, active_weapon = is_AWP},
            {Value = 2, active_weapon = is_auto},
            {Value = 3, active_weapon = is_scout},
            {Value = 4, active_weapon = is_deagle},
            {Value = 5, active_weapon = is_r8},
            {Value = 6, active_weapon = is_nades},
            {Value = 7, active_weapon = not (is_AWP or is_auto or is_scout or is_deagle or is_r8 or is_nades or is_pistols or is_rifle or is_smg or is_shotguns or is_taser)},
            {Value = 8, active_weapon = is_pistols},
            {Value = 9, active_weapon = is_rifle},
            {Value = 10, active_weapon = is_smg},
            {Value = 11, active_weapon = is_shotguns},
            {Value = 12, active_weapon = is_taser}
        }) do
        if (teleport_weapons:Get(weapons.Value) and weapons.active_weapon) then
            allow_teleport = true
        end
    end

    if (allow_teleport) then
        for _, enemy in pairs(get_enemies()) do
            if (not enemy:IsDormant() and enemy:CanHit()) then
                enable_teleport = true
            end
        end
    end

    if (enable_teleport and not EntityList_GetLocalPlayer():GetFlag(0) and EntityList_GetLocalPlayer():GetProp('m_vecVelocity'):Length2D() > 25) then
        Exploits_ForceTeleport()
    end
end
end


function ang_vector(ang)
local forward, right = Vector_new(), Vector_new()

local pitch, yaw, roll = ang.pitch * math_pi / 180, ang.yaw * math_pi / 180, ang.roll * math_pi / 180
local cp = math_cos(pitch)
local sp = math_sin(pitch)

local cy = math_cos(yaw)
local sy = math_sin(yaw)

local cr = math_cos(roll)
local sr = math_sin(roll)

forward.x = cp * cy
forward.y = cp * sy
forward.z = -sp

right.x = -1 * sr * sp * cy + -1 * cr * -sy
right.y = -1 * sr * sp * sy + -1 * cr * cy
right.z = -1 * sr * cp

return forward, right
end

actual_move = Vector2_new(0, 0)

function roll_move_fix(cmd)
local frL, riL = ang_vector(QAngle_new(0, cmd.viewangles.yaw, 0))
local frC, riC = ang_vector(cmd.viewangles)

frL.z = 0
riL.z = 0
frC.z = 0
riC.z = 0

frL = frL / Vector_new(0, 0, 0).Length(frL)
riL = riL / Vector_new(0, 0, 0).Length(riL)
frC = frC / Vector_new(0, 0, 0).Length(frC)
riC = riC / Vector_new(0, 0, 0).Length(riC)

local world_coord = frL * actual_move.x + riL * actual_move.y;

cmd.sidemove = (frC.x * world_coord.y - frC.y * world_coord.x) / (riC.y * frC.x - riC.x * frC.y)
cmd.forwardmove = (riC.y * world_coord.x - riC.x * world_coord.y) / (riC.y * frC.x - riC.x * frC.y)
end
stagesb = 0
function anti_aims(cmd)
local entity_get_local_player = EntityList_GetLocalPlayer()
if entity_get_local_player == nil then return end
local velocity = entity_get_local_player:GetProp('m_vecVelocity'):Length2D()
if velocity == nil then return end
local ground = bit_band(entity_get_local_player:GetProp('m_hGroundEntity'), 1)
if ground == nil then return end
local crouch = entity_get_local_player:GetProp('m_flDuckAmount')
if crouch == nil then return end
local weapon = entity_get_local_player:GetActiveWeapon()
if weapon == nil then return end
local tickcount = GlobalVars.tickcount % 4 > 1
if anti_bruteforce_work.work == false then
    if conditions:GetBool() and enable__aa:GetBool() then
        if Cheat_IsKeyDown(0x45) and override_on_use:GetBool() then
            local C4 = EntityList_GetEntitiesByClassID(129);
            for C4i = 1, #C4 do
                defuse = entity_get_local_player:GetRenderOrigin():DistTo(C4[C4i]:GetRenderOrigin()) < 100
            end
            local plant = entity_get_local_player:GetProp('m_bInBombZone')
            local host = entity_get_local_player:GetProp('m_bIsGrabbingHostage')


            local weapon_id = weapon:GetWeaponID()
            if weapon_id == nil then return end
            if defuse then
                check = true
            elseif weapon_id == 49 and plant == true then
                check = true
            elseif host == true then
                check = true
            else
                check = false
            end
            if check == false then
                if original_aa then pitch_cache = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Get() original_aa = false end
                state_aa = 'legit'
                Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Set(0)
                ConVar.yaw:Set(yaw_on_use:Get())
                ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[On_Use].yaw_add_r:Get() or types[On_Use].yaw_add_l:Get())
                if types[On_Use].jitter_mode:Get() == 1 then
                    ConVar.jitter:Set(math.random(1, 4))
                else
                    ConVar.jitter:Set(types[On_Use].jitter:Get())
                end

                ConVar.jitter_value:Set(math.random(types[On_Use].jitter_value_min:Get(), types[On_Use].jitter_value_max:Get()))
                ConVar.left_desync_value:Set((types[On_Use].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[On_Use].left_desync_value:Get()) or types[On_Use].left_desync_value:Get()))
                ConVar.right_desync_value:Set((types[On_Use].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[On_Use].right_desync_value:Get()) or types[On_Use].right_desync_value:Get()))
                ConVar.fake_option:Set(types[On_Use].fake_option:Get())
                ConVar.lby_mode:Set(types[On_Use].lby_mode:Get())
                ConVar.freestand_desync:Set(types[On_Use].freestand_desync:Get())
                ConVar.desync_on_shot:Set(types[On_Use].desync_on_shot:Get())
                ConVar.fakelag:Set(types[On_Use].fakelag:Get())
                ConVar.fakelag_value:Set(types[On_Use].fakelag_value:Get())
                ConVar.random_value:Set(types[On_Use].random_value:Get())
                if types[On_Use].mega_shit:Get() and not weapon:IsGrenade() then
                    cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                    roll_aa_active = true
                    if ConVar.yaw:Get() == 2 then
                        ConVar.yaw_add:Set(-15)
                        AntiAim_OverrideInverter(false)
                    elseif ConVar.yaw:Get() == 3 then
                        ConVar.yaw_add:Set(15)
                        AntiAim_OverrideInverter(true)
                    else
                        ConVar.yaw_add:Set(5)
                        AntiAim_OverrideInverter(false)
                    end
                    AntiAim_OverrideLimit(60)

                else
                    roll_aa_active = false
                end
                if Cheat_IsKeyDown(0x45) then E = false if GlobalVars.realtime > legitaa_time + 0.2 then if E == false then EngineClient_ExecuteClientCmd('+use') E = true end if E == true then EngineClient_ExecuteClientCmd('-use') end end else  if E == true then EngineClient_ExecuteClientCmd('-use') E = false end end
            end
        elseif (ConVar.yaw:Get() == 3 or ConVar.yaw:Get() == 2) and override_manual:GetBool() then
            state_aa = 'manual'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Manual].yaw_add_r:Get() or types[Manual].yaw_add_l:Get())
            if types[Manual].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Manual].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Manual].jitter_value_min:Get(), types[Manual].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Manual].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Manual].left_desync_value:Get()) or types[Manual].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Manual].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Manual].right_desync_value:Get()) or types[Manual].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Manual].fake_option:Get())
            ConVar.lby_mode:Set(types[Manual].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Manual].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Manual].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Manual].fakelag:Get())
            ConVar.fakelag_value:Set(types[Manual].fakelag_value:Get())
            ConVar.random_value:Set(types[Manual].random_value:Get())
            if types[Manual].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif ground == 1 and override_air:GetBool() then
            state_aa = 'air'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Air].yaw_add_r:Get() or types[Air].yaw_add_l:Get())
            if types[Air].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Air].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Air].jitter_value_min:Get(), types[Air].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Air].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Air].left_desync_value:Get()) or types[Air].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Air].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Air].right_desync_value:Get()) or types[Air].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Air].fake_option:Get())
            ConVar.lby_mode:Set(types[Air].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Air].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Air].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Air].fakelag:Get())
            ConVar.fakelag_value:Set(types[Air].fakelag_value:Get())
            ConVar.random_value:Set(types[Air].random_value:Get())
            if types[Air].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif (crouch >= 0.7) and override_crouch:GetBool() then
            state_aa = 'crouching'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Crouch].yaw_add_r:Get() or types[Crouch].yaw_add_l:Get())
            if types[Crouch].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Crouch].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Crouch].jitter_value_min:Get(), types[Crouch].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Crouch].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Crouch].left_desync_value:Get()) or types[Crouch].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Crouch].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Crouch].right_desync_value:Get()) or types[Crouch].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Crouch].fake_option:Get())
            ConVar.lby_mode:Set(types[Crouch].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Crouch].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Crouch].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Crouch].fakelag:Get())
            ConVar.fakelag_value:Set(types[Crouch].fakelag_value:Get())
            ConVar.random_value:Set(types[Crouch].random_value:Get())
        elseif ConVar.slowwalk:Get() and override_slowwalk:GetBool() then
            state_aa = 'slowwalking'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[SlowWalk].yaw_add_r:Get() or types[SlowWalk].yaw_add_l:Get())
            if types[SlowWalk].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[SlowWalk].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[SlowWalk].jitter_value_min:Get(), types[SlowWalk].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[SlowWalk].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[SlowWalk].left_desync_value:Get()) or types[SlowWalk].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[SlowWalk].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[SlowWalk].right_desync_value:Get()) or types[SlowWalk].right_desync_value:Get()))
            ConVar.fake_option:Set(types[SlowWalk].fake_option:Get())
            ConVar.lby_mode:Set(types[SlowWalk].lby_mode:Get())
            ConVar.freestand_desync:Set(types[SlowWalk].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[SlowWalk].desync_on_shot:Get())
            ConVar.fakelag:Set(types[SlowWalk].fakelag:Get())
            ConVar.fakelag_value:Set(types[SlowWalk].fakelag_value:Get())
            ConVar.random_value:Set(types[SlowWalk].random_value:Get())
            if types[SlowWalk].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif velocity > 5 and override_move:GetBool() then
            state_aa = 'moving'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Move].yaw_add_r:Get() or types[Move].yaw_add_l:Get())
            if types[Move].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Move].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Move].jitter_value_min:Get(), types[Move].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Move].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Move].left_desync_value:Get()) or types[Move].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Move].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Move].right_desync_value:Get()) or types[Move].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Move].fake_option:Get())
            ConVar.lby_mode:Set(types[Move].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Move].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Move].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Move].fakelag:Get())
            ConVar.fakelag_value:Set(types[Move].fakelag_value:Get())
            ConVar.random_value:Set(types[Move].random_value:Get())
            if types[Move].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif (velocity <= 2 and crouch < 0.7) and override_stand:GetBool() then
            state_aa = 'standing'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Stay].yaw_add_r:Get() or types[Stay].yaw_add_l:Get())
            if types[Stay].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Stay].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Stay].jitter_value_min:Get(), types[Stay].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Stay].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Stay].left_desync_value:Get()) or types[Stay].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Stay].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Stay].right_desync_value:Get()) or types[Stay].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Stay].fake_option:Get())
            ConVar.lby_mode:Set(types[Stay].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Stay].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Stay].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Stay].fakelag:Get())
            ConVar.fakelag_value:Set(types[Stay].fakelag_value:Get())
            ConVar.random_value:Set(types[Stay].random_value:Get())
            if types[Stay].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        else
            state_aa = 'shared'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Shared].yaw_add_r:Get() or types[Shared].yaw_add_l:Get())
            if types[Shared].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Shared].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Shared].jitter_value_min:Get(), types[Shared].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Shared].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Shared].left_desync_value:Get()) or types[Shared].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Shared].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Shared].right_desync_value:Get()) or types[Shared].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Shared].fake_option:Get())
            ConVar.lby_mode:Set(types[Shared].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Shared].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Shared].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Shared].fakelag:Get())
            ConVar.fakelag_value:Set(types[Shared].fakelag_value:Get())
            ConVar.random_value:Set(types[Shared].random_value:Get())
            if types[Shared].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        end
    elseif not conditions:GetBool() and anti_bruteforce_work.work == false and enable__aa:GetBool() then
        state_aa = 'off'
        ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[anti_aim_preset].yaw_add_r:Get() or types[anti_aim_preset].yaw_add_l:Get())
        if types[anti_aim_preset].jitter_mode:Get() == 1 then
            ConVar.jitter:Set(math.random(1, 4))
        else
            ConVar.jitter:Set(types[anti_aim_preset].jitter:Get())
        end
        ConVar.jitter_value:Set(math.random(types[anti_aim_preset].jitter_value_min:Get(), types[anti_aim_preset].jitter_value_max:Get()))
        ConVar.left_desync_value:Set((types[anti_aim_preset].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[anti_aim_preset].left_desync_value:Get()) or types[anti_aim_preset].left_desync_value:Get()))
        ConVar.right_desync_value:Set((types[anti_aim_preset].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[anti_aim_preset].right_desync_value:Get()) or types[anti_aim_preset].right_desync_value:Get()))
        ConVar.fake_option:Set(types[anti_aim_preset].fake_option:Get())
        ConVar.lby_mode:Set(types[anti_aim_preset].lby_mode:Get())
        ConVar.freestand_desync:Set(types[anti_aim_preset].freestand_desync:Get())
        ConVar.desync_on_shot:Set(types[anti_aim_preset].desync_on_shot:Get())
        ConVar.fakelag:Set(types[anti_aim_preset].fakelag:Get())
        ConVar.fakelag_value:Set(types[anti_aim_preset].fakelag_value:Get())
        ConVar.random_value:Set(types[anti_aim_preset].random_value:Get())
        if types[anti_aim_preset].mega_shit:Get() and not weapon:IsGrenade() then
            cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
            roll_aa_active = true
            if ConVar.yaw:Get() == 2 then
                ConVar.yaw_add:Set(-15)
                AntiAim_OverrideInverter(false)
            elseif ConVar.yaw:Get() == 3 then
                ConVar.yaw_add:Set(15)
                AntiAim_OverrideInverter(true)
            else
                ConVar.yaw_add:Set(5)
                AntiAim_OverrideInverter(false)
            end
            AntiAim_OverrideLimit(60)
        else
            roll_aa_active = false
        end
    end
elseif anti_bruteforce_work.work == true and  enabled_antibrute:GetBool() then

    local phase = {
        [0] = phase1,
        [1] = phase2,
        [2] = phase3,
        [3] = phase4
    }
    override_limit(phase[anti_bruteforce_work.memory[nearest():EntIndex()].count]:Get(),true)

    --ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b:Get() or yaw_add_l_b:Get())
    --ConVar.jitter:Set(jitter_b:Get())
    --ConVar.jitter_value:Set(jitter_value_b:Get())
    --ConVar.lby_mode:Set(lby_mode_b:Get())
    --yaw_add_l_b
    --yaw_add_r_b
    --jitter_b
    --jitter_value_b
    --lby_mode_b

end
if manual_yaw_base:Get() ~= 0 and not (Cheat_IsKeyDown(0x45) and override_on_use:GetBool()) then ConVar.yaw:Set(manual_yaw_base:Get() - 1) end
if not Cheat_IsKeyDown(0x45) then legitaa_time = GlobalVars.realtime if not original_aa then Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Set(pitch_cache) original_aa = true end end
if avoid_backstab:GetBool() then
    all_players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #all_players do
        enemy = all_players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and not enemy:IsDormant() and enemy:IsAlive() and enemy:GetActiveWeapon() ~= nil and enemy:GetActiveWeapon():IsKnife() then
            enemy_origin = enemy:GetProp('m_vecOrigin')
            if 300 >= EntityList_GetLocalPlayer():GetRenderOrigin():DistTo(enemy:GetProp('m_vecOrigin')) then
                AntiAim_OverrideYawOffset(180)
            end
        end
    end
end

end


baim_hitboxes = {2,3,4}

function extrapolate_position(xpos,ypos,zpos,ticks,player)
    local x,y,z = player:GetProp('m_vecVelocity').x, player:GetProp('m_vecVelocity').y, player:GetProp('m_vecVelocity').z
    for i = 0, ticks do
        xpos =  xpos + (x * GlobalVars.interval_per_tick)
        ypos =  ypos + (y * GlobalVars.interval_per_tick)
        zpos =  zpos + (z * GlobalVars.interval_per_tick)
    end
    return xpos,ypos,zpos
end

lethalplayer = false

function is_baimable(ent, localplayer)  
    local final_damage = 0

    local eyepos = EntityList_GetLocalPlayer():GetEyePosition()
    local fs_stored_eyepos

    eyepos_x = extrapolate_position(eyepos.x, eyepos.y, eyepos.z, 20, localplayer)

    fs_stored_eyepos = eyepos

    for k,v in pairs(baim_hitboxes) do
        local hitbox = ent:GetHitboxCenter(v)

        local dmg = Cheat_FireBullet(localplayer, fs_stored_eyepos, Vector_new(hitbox.x, hitbox.y, hitbox.z)).damage
       
        if ( dmg > final_damage) then
            final_damage = dmg
        end
    end
   
    return final_damage
end

function proper_baim_lethal()
    local me = EntityList_GetLocalPlayer()
    local weapon = me:GetActiveWeapon()
    if weapon == nil or weapon:IsKnife() or weapon:IsGrenade() then
        lethalplayer = false
        return
    end
   
    all_players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #all_players do
        enemy = all_players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and enemy:IsAlive() and not enemy:IsDormant() then
            local enemy_index = enemy:EntIndex()
            if enemy_index == nil then return end
            local target_health = enemy:GetProp('m_iHealth')
            local is_lethal = is_baimable(enemy, me) >= target_health
            if target_health <= 0 then return end

            if is_lethal then
                lethalplayer = true
               
                RageBot.EnableHitbox(enemy_index, 0, false)
                RageBot.EnableHitbox(enemy_index, 1, false)
                for i=5, 18 do
                    RageBot.ForceHitboxSafety(enemy_index, 2)
                    RageBot.ForceHitboxSafety(enemy_index, 4)
                    RageBot.SetHitboxPriority(enemy_index, 3, 100)
                    RageBot.EnableHitbox(enemy_index, 2, true)
                    RageBot.EnableHitbox(enemy_index, 3, true)
                    RageBot.EnableHitbox(enemy_index, 4, true)
                    RageBot.EnableHitbox(enemy_index, i, false)
                   
                end
            else
                lethalplayer = false
            end
        else
            lethalplayer = false
        end
    end
end
ESP.CustomText('Proper Body Aim if Lethal', 'enemies', 'BAIM', function(ent)
    if not EntityList_GetLocalPlayer() or ent == nil then return end
    local target_health = ent:GetProp('m_iHealth')
    if target_health == nil or EntityList_GetLocalPlayer():GetActiveWeapon() == nil or EntityList_GetLocalPlayer():GetActiveWeapon():GetWeaponDamage() == nil then return end
    is_lethal = EntityList_GetLocalPlayer():GetActiveWeapon():GetWeaponDamage() >= target_health
    if lethalplayer and is_lethal then
        return 'BAIM'
    else
        return false
    end
end)
local original_aaa = true
local legitaa_timea = GlobalVars.realtime
function ideal_peek()
if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() then
    if original_aaa then
        yaw_base_cache = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Get()
        original_aaa = false
    end
    Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Set(5)
elseif Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() and (manual_yaw_base:Get() == 4 or manual_yaw_base:Get() == 5) then
    if not original_aaa then
        Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Set(yaw_base_cache)
        original_aaa = true
    end
    legitaa_timea = GlobalVars.realtime
end
end
local pixel9 = Render_InitFont('nl\alien\fonts\small_pixel.ttf', 9)
local verdanabd11 = Render_InitFont('Verdana', 11, {'b'})
local verdana11_r = Render_InitFont('verdana', 11, {'r'})
local verdana12 = Render_InitFont('verdana', 12)
local verdana23 = Render_InitFont('verdana', 20, {'b'})
local lucida_console = Render_InitFont('lucida console', 10, {'r'})
local arrows = Render_InitFont('nl\alien\fonts\arrows.ttf', 14)
local arrows18 = Render_InitFont('nl\alien\fonts\arrows.ttf', 20)
local dt_circle = 0

function update_enemies()
    local localplayer = EntityList_GetClientEntity(EngineClient_GetLocalPlayer())
    if not localplayer then return end

    local my_index = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not my_index then return end

    if EngineClient_IsConnected() and my_index:IsAlive() then
        local players = EntityList_GetEntitiesByName('CCSPlayer')
        local fov_enemy, maximum_fov = nil, 180
     
        for i = 1, #players do
            local enemy = players[i]:GetPlayer()
            if enemy ~= my_index and not enemy:IsTeamMate() and enemy:IsAlive() then
                local my_origin = my_index:GetRenderOrigin()
                local enemy_origin = enemy:GetRenderOrigin()

                local world_to_screen = (my_origin.x - enemy_origin.x == 0 and my_origin.y - enemy_origin.z == 0) and 0 or math_deg(math_atan2( my_origin.y - enemy_origin.y, my_origin.x - enemy_origin.x)) - EngineClient_GetViewAngles().yaw + 180

                local calculated_fov = math_abs(normalize_yaw(world_to_screen))
                if not fov_enemy or calculated_fov <= maximum_fov then
                    fov_enemy = enemy
                    maximum_fov = calculated_fov
                end
            end
        end

        return ({enemy = fov_enemy, fov = maximum_fov})
    end
end
function deg2rad(x)
return x * (math.pi / 180.0)
end

function Render_pd_Indicator(text, y2, y1, color, size, font, outline)
local textsize = Render_CalcTextSize(text, size, font)
Render_Text(text, Vector2_new(screen_size.x/2-textsize.x/2-y1, screen_size.y/2+y2), color, size, font, outline)
end
cock1 = false
cock = false
local function render_text(text, pos, color, size, text_font, outline, align)
local text_size = Render.CalcTextSize(text, size, text_font)
if outline == 1 then
    cock = true
    cock1 = false
elseif outline == 2 then
    cock1 = true
    cock = false
else
    cock1 = false
    cock = false
end
if align == 0 then -- To the left
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x+1 - text_size.x, pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, Vector2.new(pos.x - text_size.x, pos.y), color, size, text_font, cock)
elseif align == 1 then -- To the center
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x + 1 - (text_size.x / 2), pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, Vector2.new(pos.x - (text_size.x / 2), pos.y), color, size, text_font, cock)
elseif align == 2 then -- To the right
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x + 1, pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, pos, color, size, text_font, cock)
end
end

function lerp(a, b, t)
return a + (b - a) * t
end

function angle_to_vec(pitch, yaw)
    local p = pitch / 180 * math_pi
    local y = yaw / 180 * math_pi

    local sin_p = math_sin(p)
    local cos_p = math_cos(p)
    local sin_y = math_sin(y)
    local cos_y = math_cos(y)

    return {cos_p * cos_y, cos_p * sin_y, -sin_p}
end

function calculate_angles(local_x, local_y, enemy_x, enemy_y)
    local delta_y = local_y - enemy_y
    local delta_x = local_x - enemy_x

    local relative_yaw = math.atan(delta_y / delta_x)
    relative_yaw = normalize_yaw(relative_yaw * 180 / math_pi)

    if delta_x >= 0 then
        relative_yaw = normalize_yaw(relative_yaw + 180)
    end

    return relative_yaw
end

function deg2rad(x)
    return x * (math_pi / 180.0)
end

function get_hit_side()
    local local_player = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not local_player then return end

    if EngineClient_IsConnected() and local_player:IsAlive() then
        local data, current_enemy = update_enemies(), nil
        if data ~= nil then
            current_enemy = data.enemy
        end
     
        if current_enemy ~= nil and current_enemy:IsAlive() then
            local predict_damage = function(x, y, z)
                local a, b, c = {}, {}, {}
                local enemy_head_position = current_enemy:GetHitboxCenter(1)
                local ticks = 40

                a[1], b[1], c[1] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z
                a[2], b[2], c[2] = enemy_head_position.x + ticks, enemy_head_position.y, enemy_head_position.z
                a[3], b[3], c[3] = enemy_head_position.x - ticks, enemy_head_position.y, enemy_head_position.z
             
                a[4], b[4], c[4] = enemy_head_position.x, enemy_head_position.y + ticks, enemy_head_position.z
                a[5], b[5], c[5] = enemy_head_position.x, enemy_head_position.y - ticks, enemy_head_position.z

                a[6], b[6], c[6] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z + ticks
                a[7], b[7], c[7] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z - ticks

                for i = 1, 7, 1 do
                    local damage = 0
                    local trace_damage = Cheat_FireBullet(current_enemy, Vector_new(a[i], b[i], c[i]), Vector_new(x, y, z)).damage
         
                    if trace_damage > damage then
                        damage = trace_damage
                    end
         
                    return damage
                end
            end

            local my_eye_position = local_player:GetEyePosition()
            local enemy_head_position = current_enemy:GetHitboxCenter(0)
            local calculated_yaw = calculate_angles(my_eye_position.x, my_eye_position.y, enemy_head_position.x, enemy_head_position.y)

            local left_direction_x, left_direction_y = angle_to_vec(0, (calculated_yaw + 90)), angle_to_vec(0, (calculated_yaw + 90))

            local right_direction_x, right_direction_y = angle_to_vec(0, (calculated_yaw - 90)), angle_to_vec(0, (calculated_yaw - 90))
         
            local rend_x = my_eye_position.x + right_direction_x[1] * 10
            local rend_y = my_eye_position.y + right_direction_y[1] * 10

            local lend_x = my_eye_position.x + left_direction_x[1] * 10
            local lend_y = my_eye_position.y + left_direction_y[1] * 10

            local rend_x_2 = my_eye_position.x + right_direction_x[1] * 100
            local rend_y_2 = my_eye_position.y + left_direction_y[1] * 100

            local lend_x_2 = my_eye_position.x + left_direction_x[1] * 100
            local lend_y_2 = my_eye_position.y + left_direction_y[1] * 100
         
            local left_trace = predict_damage(rend_x, rend_y, my_eye_position.z)
            local right_trace = predict_damage(lend_x, lend_y, my_eye_position.z)
            local left_trace_2 = predict_damage(rend_x_2, rend_y_2, my_eye_position.z)
            local right_trace_2 = predict_damage(lend_x_2, lend_y_2, my_eye_position.z)

            local hit_side = ((left_trace > 0 or right_trace > 0 or left_trace_2 > 0 or right_trace_2 > 0) and (left_trace > right_trace and 0.5 or right_trace > left_trace and -0.5 or left_trace_2 > right_trace_2 and 1 or right_trace_2 > left_trace_2 -1) or 0.0)

            return hit_side
        end
    end
end
function is_defensive()
    local state, shifting = false, 0
    local local_player = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not local_player then return end
    if Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):GetBool() then
        local hit_side = get_hit_side()
        if hit_side == true or hit_side == false then
            hit_side = 0
            state = false
            shifting = nil
        end

        if hit_side ~= nil then
            if hit_side > 0 then
                state = true

                local tickbase = local_player:GetProp('m_nTickBase')
                local next_attack = local_player:GetProp('m_flNextAttack')
                local next_primary_attack = local_player:GetActiveWeapon():GetProp('m_flNextPrimaryAttack')

                local ticks = GlobalVars.interval_per_tick * (tickbase - 16)
                local shifting_tickbase = (ticks - next_primary_attack) * 2

                if shifting_tickbase <= 3 then shifting_tickbase = shifting_tickbase + (next_attack * 0.001) * 2 end

                if shifting_tickbase >= 17 then shifting_tickbase = 17 end
                shifting_tickbase = math_floor(shifting_tickbase)

                shifting = shifting_tickbase
            else
                state = false
                shifting = nil
            end
        else
            state = false
            shifting = nil
        end
    else
        state = false
        shifting = nil
    end

    return ({
        state = state,
        value = shifting
    })
end
function math_lerp(time,a,b)
return a * (1-time) + b * time
end
local pixel7 = Render.InitFont('Smallest Pixel-7', 10)
bar_antibrute = 0
prediction_anim = 0
cur_dmg = 0
verdana25 = Render_InitFont('verdana', 25)
tahoma_bold13 = Render_InitFont('tahoma', 13, {'b'})
a_width = 0
function get_dormant_enemy()
    local ret = {}

    local players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #players do
        local enemy = players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and enemy:IsAlive() then
            if enemy:IsDormant() then
                table_insert(ret, enemy)
            end
        end
    end
                         
    return #ret
end
function indicators()
if not EngineClient_IsConnected() or not EntityList_GetLocalPlayer():IsAlive() then return end
local velocity = Vector_new(EntityList_GetLocalPlayer():GetProp('m_vecVelocity[0]'), EntityList_GetLocalPlayer():GetProp('m_vecVelocity[1]'), EntityList_GetLocalPlayer():GetProp('m_vecVelocity[2]'))
if velocity == nil then return end
local isDoubletap = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):GetBool()
local isPeek = Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool()
local isHideshots = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Hide Shots'):GetBool()
local isSafe = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Safe Points'):Get() == 2
local isBody = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Body Aim'):Get() == 2
local yaw_base = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Get()
local isDuck = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Fake Duck'):GetBool()
local crouch = EntityList_GetLocalPlayer():GetProp('m_flDuckAmount')
if crouch == nil then return end
local ground = bit_band(EntityList_GetLocalPlayer():GetProp('m_fFlags'), bit_lshift(1,0)) == 0
if ground == nil then return end
if dmg_type == 1 or dmg_type == 2 then
    cur_dmg = prsd_damage
else
    cur_dmg = Menu_FindVar('Aimbot', 'Ragebot', 'Accuracy', 'Minimum Damage'):GetInt()
    if cur_dmg == 0 then cur_dmg = 'auto' elseif cur_dmg > 100 then cur_dmg = '+'..cur_dmg-100 end
end
if cur_dmg == nil then return end
local isDmg = false
local isPing = false
local binds = Cheat_GetBinds()
for i = 1, #binds do
    local bind = binds[i]

    if bind:GetName() == 'Minimum Damage' and bind:IsActive() then
        isDmg = true
    end
    if bind:GetName() == 'Fake Ping' and bind:IsActive() then
        isPing = true
    end
end
local frames = GlobalVars.frametime*20
bar_antibrute = math_lerp(GlobalVars.frametime*20,bar_antibrute, (anti_bruteforce_work.work == true) and 1 or 0)
if indicators_style:GetBool(1) then
    add_y = 20

    add_y = add_y + 4
    if indicators_add:GetBool(3) then
        Render_PolyFilled(AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), Vector2_new(screen_size.x/2 + 30 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)), screen_size.y/2 + (30 * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)))), Vector2_new(screen_size.x/2 + 40 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)), screen_size.y/2 + (40) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1))), Vector2_new(screen_size.x/2 + 26 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1) - math_rad(20)), screen_size.y/2 + (26) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1) - math_rad(20))));
        Render_PolyFilled(AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Vector2_new(screen_size.x/2 + (30 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1))), screen_size.y/2 + (30 * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1)))), Vector2_new(screen_size.x/2 + (40) * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1)), screen_size.y/2 + (40) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1))), Vector2_new(screen_size.x/2 + (26) * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1) + math_rad(20)), screen_size.y/2 + (26) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1) + math_rad(20))));
        add_y = add_y + 25
    end
    if indicators_add:GetBool(1) then
        add_y = add_y + 9
        local alpha = math_sin(math_abs(-math_pi + GlobalVars.realtime * 1 % (math_pi * 2.0)))


        --Render_pd_Indicator('beta', add_y-17, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, alpha), 9, pixel9, true)

        Render_pd_Indicator('alien.lua°', add_y-11, -1, Color_new(0, 0, 0, 0.5), 11, verdanabd11, false)
        Render_pd_Indicator('alien', add_y-11, 13, AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 11, verdanabd11, false)
        Render_pd_Indicator('.lua°', add_y-11, -13, AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 11, verdanabd11, false)

    end

    --bar_antibrute*8
    if roll_aa_active == true then
        state = '/roll/'
    elseif ground then
        state = '/aerobic/'
    elseif crouch >= 1 then
        state = '/crouch/'
    elseif isSlow then
        state = '/slowwalk/'
    elseif velocity:Length2D() > 5 then
        state = '/running/'
    else
        state = '/standing/'
    end

    if indicators_add:GetBool(2) then
        if anti_bruteforce_work.work then
            Render_BoxFilled(Vector2_new(screen_size.x/2-26, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+3+add_y+3), Color_new(0, 0, 0, bar_antibrute/1.2))
            Render_BoxFilled(Vector2_new(screen_size.x/2-26 + 1, screen_size.y/2+2+add_y+2), Vector2_new(screen_size.x/2 + math_min((3.5 - anti_bruteforce_work.work_value / 0.569) * 7.2, 26), screen_size.y/2+3+add_y+2), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, bar_antibrute))
        else
            Render_GradientBoxFilled(Vector2_new(screen_size.x/2+25, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+6+add_y+1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0))
            Render_GradientBoxFilled(Vector2_new(screen_size.x/2-25, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2-26, screen_size.y/2+6+add_y+1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0))
            Render_BoxFilled(Vector2_new(screen_size.x/2, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+3+add_y+1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1))
            Render_BoxFilled(Vector2_new(screen_size.x/2, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2-26, screen_size.y/2+3+add_y+1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
        end
        add_y = add_y + 6
    end

    if indicators_add:GetBool(4) then
        Render_pd_Indicator(state, bar_antibrute*1 + add_y, 0, Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(5) and isDoubletap then
        dt_circle = math_lerp(frames/2, dt_circle, Exploits_GetCharge())
        Render_pd_Indicator('dt', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, math_max(0.2, dt_circle)), 9, pixel9, true)
        Render_Circle(Vector2_new(screen_size.x / 2 + 10, screen_size.y / 2 + 5 + bar_antibrute*1 + add_y), 3.6, 32, Color_new(0, 0, 0, math_max(0.2, dt_circle)), 3)
        Render_Circle(Vector2_new(screen_size.x / 2 + 10, screen_size.y / 2 + 5 + bar_antibrute*1 + add_y), 3.6, 32, Color_new(1, 1, 1, math_max(0.2, dt_circle)), 2, -180, -180 + 360 *dt_circle)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(6) and isHideshots then
        Render_pd_Indicator('os', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(7) and isDmg then
        Render_pd_Indicator('dmg', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(8) and isBody then
        Render_pd_Indicator('body', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(9) and isSafe then
        Render_pd_Indicator('safe', bar_antibrute*1 + add_y, 0, isSafe and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(10) and yaw_base == 5 then
        Render_pd_Indicator('fs', bar_antibrute*1 + add_y, 0, yaw_base == 5 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(11) and isPeek and isDoubletap and Exploits_GetCharge() ~= 1.0 then
        Render_pd_Indicator('+CHARGED IDEAL TICK+', -26, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end

end
if indicators_style:GetBool(2) then
    local acatel_style_2 = "-"
    if AntiAim_GetInverterState() then
        acatel_style_2 = "LEFT"
    else
        acatel_style_2 = "RIGHT"
    end
    local ind_dst = 0
    render_text('ALIEN', Vector2.new(screen_size.x/2, screen_size.y/2 + 30), Color.new(1, 1, 1, 1), 10, pixel7, 1, 2)
    render_text('BETA', Vector2.new(screen_size.x/2 + Render.CalcTextSize("ALIEN", 10, pixel7).x, screen_size.y/2 + 30), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, (math.floor(math.sin(GlobalVars.curtime * 2) * 220 + 221)) / 1000 * 6.92), 10, pixel7, 1, 2)
    --

    render_text("SMART:", Vector2.new(screen_size.x/2, screen_size.y/2 + 38.5), Color.RGBA(220, 91, 97, 255), 10, pixel7, 1, 2)
    render_text(acatel_style_2, Vector2.new(screen_size.x/2 + 29, screen_size.y/2 + 38.5), Color.RGBA(138, 137, 204, 255), 10, pixel7, 1, 2)
    --
    if isDoubletap then
        if Exploits_GetCharge() <= 0 then dt_color = Color.RGBA(255, 0, 0, 255) else dt_color = Color.RGBA(0, 255, 0, 255) end
    else
        dt_color = Color.new(0.3, 0.3, 0.3, 1)
    end
    --
    render_text("DT", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + ind_dst), dt_color, 10, pixel7, 1, 2)
    render_text("HS", Vector2.new(screen_size.x/2 + 11, screen_size.y/2 + 46 + ind_dst), isHideshots and Color_new(1, 1, 1, 1) or Color_new(0.3, 0.3, 0.3, 1), 10, pixel7, 1, 2)
    render_text("FS", Vector2.new(screen_size.x/2 + 23, screen_size.y/2 + 46 + ind_dst), yaw_base == 5 and Color.new(1, 1, 1, 1) or Color.new(0.3, 0.3, 0.3, 1), 10, pixel7, 1, 2)
    render_text("M:B", Vector2.new(screen_size.x/2 + 35, screen_size.y/2 + 46 + ind_dst), Color.new(1,1,1,1), 10, pixel7, 1, 2)
end
if indicators_style:GetBool(3) then
    add_y = 0

    if isPing then
        render_text("ping-spike", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 12, verdana12, 2, 1)
        textb = "ping-spike"
        add_y = add_y + 9
    end

    if isDuck then
        render_text("fake-duck", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, crouch), 12, verdana12, 2, 1)
        textb = "fake-duck"
        add_y = add_y + 9
    end

    if isHideshots then
        render_text("on-shot aa", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 12, verdana12, 2, 1)
        textb = "on-shot aa"
        add_y = add_y + 9
    end

    if isDoubletap then
        render_text("double-tap", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Exploits_GetCharge() == 1 and Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(0.4, 0.4, 0.4, 1), 12, verdana12, 2, 1)
        textb = "double-tap"
        add_y = add_y + 9
    end

    if isDmg then
        render_text("damage: "..cur_dmg, Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        textb = "damage: "..cur_dmg
        add_y = add_y + 9
    end

    if yaw_base == 5 then
        render_text("freestanding", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        textb = "freestanding"
        add_y = add_y + 9
    end

    if isDoubletap or isHideshots or yaw_base == 5 or isDmg or isPing or isDuck then
        text_sizeb = Render.CalcTextSize(textb, 12, verdana12)
        render_text("alien.lua", Vector2.new(screen_size.x/2, screen_size.y/2 + 28), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(0, 0, 0, 0.3), Color.new(0, 0, 0, 0.3), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
        Render.BoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+43), Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+44), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 - 4 - text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 + 4 + text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
    end
end
if indicators_style:GetBool(4) then
    render_text('alien.lua', Vector2.new(screen_size.x/2, screen_size.y/2 + 32 ), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 10, pixel7, 1, 1)
    ind_dst = 0
    local aa_status = "STANDING"
    if ground then
        aa_status = "AIR"
    elseif crouch > 0.8 then
        aa_status = "CROUCHING"
    elseif isSlow then
        aa_status = "SLOWWALK"
    else
        aa_status = "STANDING"
    end
    render_text(aa_status, Vector2.new(screen_size.x/2, screen_size.y/2 + 40), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 10, pixel7, 1, 1)

    if isDoubletap then
        if Exploits_GetCharge() <= 0 then dt_color = Color.new(0.5, 0.5, 0.5, 1) else dt_color = Color.RGBA(0, 255, 0, 255) end
    else
        dt_color = Color.new(0.5, 0.5, 0.5, 1)
    end
    render_text("DT", Vector2.new(screen_size.x/2 - 8, screen_size.y/2 + 48), dt_color, 10, pixel7, 1, 0)

    if yaw_base == 5 then arctic_fs =  Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) else arctic_fs = Color.new(0.5, 0.5, 0.5, 1) end
    render_text("FS", Vector2.new(screen_size.x/2, screen_size.y/2 + 48 + ind_dst), arctic_fs, 10, pixel7, 1, 1)

    if isHideshots then arctic_hs =  Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) else arctic_hs = Color.new(0.5, 0.5, 0.5, 1) end
    render_text("HS", Vector2.new(screen_size.x/2 + 8, screen_size.y/2 + 48), arctic_hs, 10, pixel7, 1, 2)
end
if indicators_style:GetBool(5) then
    add_y = 30
    local alpha = math_floor(math_sin(math_abs(-math_pi + (GlobalVars.curtime * (1.25 / .75)) % (math_pi * 2))) * 200)
    Render_Text('alien', Vector2_new(screen_size.x/2, screen_size.y/2+add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    Render_Text('lua', Vector2_new(screen_size.x / 2 + 27, screen_size.y / 2 + add_y), Color_RGBA(200, 200, 200, alpha), 9, pixel9, true)
    add_y = add_y + 9
    --get_dormant_enemy
    local data, current_enemy = update_enemies(), nil
    if data ~= nil then
        current_enemy = data.enemy
    end
    if roll_aa_active then
        Render_Text('EXPLOITING:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

        Render_Text('z°', Vector2_new(screen_size.x / 2 + 50, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    elseif anti_bruteforce_work.work then
        Render_Text('ANTI ', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

        local counter = anti_bruteforce_work_count
        local side = AntiAim_GetInverterState() and 1 or -1
        local timer = math_floor(anti_bruteforce_work.work_value * 25.1)

        Render_Text(('BRUTEFORCE[%s][%s][%s%%]'):format(counter, side, timer), Vector2_new(screen_size.x / 2 + 21, screen_size.y / 2 + add_y),Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    else
        if is_defensive().state then
            if is_defensive().value ~= nil then
                Render_Text('DEFENSIVE:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

                Render_Text(('%s'):format(is_defensive().value), Vector2_new(screen_size.x / 2 + 47, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
            end
        else
            Render_Text('BODY', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(197, 122, 108, 255), 9, pixel9, true)

            Render_Text(' YAW: ', Vector2_new(screen_size.x / 2 + 16, screen_size.y / 2 + add_y), Color_RGBA(197, 122, 108, 255), 9, pixel9, true)

            Render_Text(AntiAim_GetInverterState() and 'R' or 'L', Vector2_new(screen_size.x / 2 + 40, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
        end
    end
    add_y = add_y + 9
    Render_Text('DORMANCY:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 201, 132, 255), 9, pixel9, true)
    Render_Text(('%s'):format(get_dormant_enemy()), Vector2_new(screen_size.x / 2 + 45, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    if isDoubletap then
        add_y = add_y + 9
        Render_Text('DT', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Exploits_GetCharge() == 1 and Color_RGBA(133, 235, 89, 255) or Color_RGBA(244, 11, 12, 255), 9, pixel9, true)
    end
    if isHideshots then
        add_y = add_y + 9
        Render_Text('HS', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 211, 168, 255), 9, pixel9, true)
    end
    if isDmg then
        add_y = add_y + 9
        Render_Text('DMG', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    end
end
if screen_dmg:GetBool() then
    Render_Text(isDmg and '1' or '0', Vector2_new(screen_size.x / 2-25+screen_dmg_x:GetInt(), (screen_size.y - 200) / 2.5+45+screen_dmg_y:GetInt()), Color_RGBA(255, 255, 255, 255), 12, verdana12)
    Render_Text(tostring(cur_dmg), Vector2_new(screen_size.x / 2+screen_dmg_x:GetInt(), (screen_size.y - 200) / 2.5+45 +screen_dmg_y:GetInt()), Color_RGBA(255, 255, 255, 255), 12, verdana12)
end
if arrows_ind:Get() == 1 then
    Render_PolyFilled(yaw_base == 2 and ind_clr:GetColor() or Color_RGBA(35, 35, 35, 150), Vector2_new(screen_size.x / 2 + 55, screen_size.y / 2 - 2 + 2), Vector2_new(screen_size.x / 2 + 42, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 + 42, screen_size.y / 2 - 2 + 11))
    Render_PolyFilled(yaw_base == 3 and ind_clr:GetColor() or Color_RGBA(35, 35, 35, 150), Vector2_new(screen_size.x / 2 - 55, screen_size.y / 2 - 2 + 2), Vector2_new(screen_size.x / 2 - 42, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 - 42, screen_size.y / 2 - 2 + 11))

    Render_BoxFilled(Vector2_new(screen_size.x / 2 + 38, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 + 38 + 2, screen_size.y / 2 - 2 - 7 + 18), AntiAim_GetInverterState() == false and ind_clr2:GetColor() or Color_RGBA(35, 35, 35, 150))
    Render_BoxFilled(Vector2_new(screen_size.x / 2 - 40, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 - 38, screen_size.y / 2 - 2 - 7 + 18), AntiAim_GetInverterState() == true and ind_clr2:GetColor() or Color_RGBA(35, 35, 35, 150))
elseif arrows_ind:Get() == 2 then
    textsize = Render_CalcTextSize('g', 20, arrows18)
    Render_Text('g', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)


    Render_Text('h', Vector2_new(screen_size.x/2+50, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)
    Render_Text('h', Vector2_new(screen_size.x/2+51, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)
elseif arrows_ind:Get() == 3 then
    textsize = Render_CalcTextSize('<', 12, verdana12)
    Render_Text('<', Vector2_new(screen_size.x/2-52-textsize.x, screen_size.y/2-12), Color_RGBA(0, 0, 0, 100), 20, verdana23)
    Render_Text('<', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-13), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, verdana23)


    Render_Text('>', Vector2_new(screen_size.x/2+52, screen_size.y/2-12), Color_RGBA(0, 0, 0, 100), 20, verdana23)
    Render_Text('>', Vector2_new(screen_size.x/2+51, screen_size.y/2-13), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, verdana23)
elseif arrows_ind:Get() == 4 then
    textsize = Render_CalcTextSize('w', 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-50-textsize.x, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-50-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+50, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+51, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+50, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+51, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
end
if vel_mod_ind:GetBool() then
    local me = EntityList_GetLocalPlayer()
    if not me then return end
    if not me:IsAlive() then return end
    local modifier_vel = me:GetProp('m_flVelocityModifier') + 0.01
    if Cheat_IsMenuVisible() then
        modifier_vel = me:GetProp('m_flVelocityModifier')
    end
    if modifier_vel == 1.01 then return end

    local alpha_vel = math_abs(GlobalVars.curtime*4 % 2 - 1)*255

    local text_vel = string_format('Slowed down %.0f%%', math_floor(modifier_vel*100))
    local text_width_vel = 95

    a_width = lerp(a_width, math_floor((text_width_vel - 2) * modifier_vel), GlobalVars.frametime * 8)

    local x_vel = screen_size.x/2 - text_width_vel
    local y_vel = screen_size.y/2 - 350

    Render_PolyFilled(Color_RGBA(16, 16, 16, 255), Vector2_new(x_vel - 14 + vel_mod_add_x:Get(), y_vel - 16 + vel_mod_add_y:Get()), Vector2_new(x_vel + 6 + vel_mod_add_x:Get(), y_vel + 14+ vel_mod_add_y:Get()), Vector2_new(x_vel - 34 + vel_mod_add_x:Get(), y_vel + 14 + vel_mod_add_y:Get()))
    Render_PolyFilled(Color_new((124*2 - 124 * modifier_vel)/255, (195 * modifier_vel)/255, 13/255, alpha_vel/255), Vector2_new(x_vel - 14 + vel_mod_add_x:Get(), y_vel - 14 + vel_mod_add_y:Get()), Vector2_new(x_vel + 4 + vel_mod_add_x:Get(), y_vel + 13+ vel_mod_add_y:Get()), Vector2_new(x_vel - 32 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()))

    Render_Text('!', Vector2_new(x_vel - 18 + vel_mod_add_x:Get(), y_vel - 12+ vel_mod_add_y:Get()), Color_RGBA(16, 16, 16, 255), 25, verdana25)
    Render_Text(text_vel, Vector2_new(x_vel + 22 + vel_mod_add_x:Get(), y_vel - 15 + vel_mod_add_y:Get()), Color_RGBA(0, 0, 0, 255), 13, tahoma_bold13)
    Render_Text(text_vel, Vector2_new(x_vel + 21 + vel_mod_add_x:Get(), y_vel - 16 + vel_mod_add_y:Get()), Color_RGBA(255, 255, 255, 255), 13, tahoma_bold13)

    Render_BoxFilled(Vector2_new(x_vel + 22 + vel_mod_add_x:Get(), y_vel + 2 + vel_mod_add_y:Get()), Vector2_new(text_width_vel + screen_size.x/2-60 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()), Color_RGBA(25, 25, 25, 200))
    Render_BoxFilled(Vector2_new(x_vel + a_width + 37 + vel_mod_add_x:Get(), y_vel + 2 + vel_mod_add_y:Get()), Vector2_new(screen_size.x/2-73 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()), Color_new((124*2 - 124 * modifier_vel)/255, (195 * modifier_vel)/255, 13/255, 1))
    Render_Box(Vector2_new(x_vel + 21 + vel_mod_add_x:Get(), y_vel + 1 + vel_mod_add_y:Get()), Vector2_new(text_width_vel + screen_size.x/2-59 + vel_mod_add_x:Get(), y_vel + 14 + vel_mod_add_y:Get()), Color_RGBA(55, 55, 55, 200))
end
end

particles = {}
hitmarkers = {}
damage_marker_log = {
log = {}
}


function autopeek()
if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() and auto_peek:GetBool() then
    if autopeek_pos == nil then
        autopeek_pos = EntityList_GetLocalPlayer():GetProp('m_vecOrigin')
    end

    if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() then
        for i = 0, 49 do
            Render_Circle3DFilled(autopeek_pos, 16, i / -2.5, Color_new(auto_peek:GetColor().r, auto_peek:GetColor().g, auto_peek:GetColor().b, (i / 10 * auto_peek:GetColor().a) / 255), false)
            Render_Circle3DFilled(autopeek_pos, 8, i / -2.6, Color_new(auto_peek:GetColor().r, auto_peek:GetColor().g, auto_peek:GetColor().b, (i / 20 * auto_peek:GetColor().a) / 255), false)
        end
    end

else
    autopeek_pos = nil
end
end

function damage_markere(e)
if e:GetName() ~= 'player_hurt' then return end
if e:GetInt('attacker') == nil then return end
if e:GetInt('userid') == nil then return end
if EntityList_GetPlayerForUserID(e:GetInt('attacker')) == EntityList_GetLocalPlayer() then
    table_insert(damage_marker_log.log,{size = 120,pos = EntityList_GetPlayerForUserID(e:GetInt('userid')):GetHitboxCenter(e:GetInt('hitgroup')),damage = e:GetInt('dmg_health'),is_lethal = (e:GetInt('health') < 1),time = GlobalVars.realtime})
end
end
local verdana12b = Render_InitFont('verdana', 11, {'b'})
function damage_markerd()
if EntityList_GetLocalPlayer() == nil then return end
for i, mark in ipairs(damage_marker_log.log) do
    mark.pos.z = mark.pos.z + 50*GlobalVars.frametime
    local pos = Render_WorldToScreen(mark.pos)
    mark.size = mark.size - GlobalVars.frametime*55
    Render_Text(tostring(mark.damage), Vector2_new(pos.x+1,pos.y+1), Color_new(0.1,0.1,0.1,1), math_floor(math_min(mark.size,11)),verdana12b,false,true)
    Render_Text(tostring(mark.damage), Vector2_new(pos.x,pos.y), mark.is_lethal and Color_RGBA(155,200,20,255) or Color_RGBA(255,255,255,255), math_floor(math_min(mark.size,11)),verdana12b,false,true)

    if mark.time + 3 < GlobalVars.realtime or mark.size < 0 then table_remove(damage_marker_log.log,i) end
end
end

function reg_shot(shot)
local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
if not localplayer then return end

local my_index = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
if not my_index then return end
if EngineClient.IsConnected() and my_index:IsAlive() then
    local index = EntityList.GetClientEntity(shot.target_index)
    if not index then return end
    local get_player = index:GetPlayer()
    if not get_player then return end
    if shot.reason == 0 then
        local damage = shot.damage
        if damage < 1 then return end
        local bullet_position = get_player:GetHitboxCenter(shot.hitgroup)
        if not bullet_position then
            bullet_position = get_player:GetRenderOrigin()
            bullet_position.y = bullet_position.y + 30
        end

        bullet_position.x = (bullet_position.x - 10) + (math.random() * 20)
        bullet_position.y = (bullet_position.y - 10) + (math.random() * 20)
        bullet_position.z = (bullet_position.z - 15) + (math.random() * 30)
        table.insert(particles, {
            position = bullet_position,
            timer = GlobalVars.tickcount + 80,
            damage = damage,
            is_killed = get_player:GetProp("m_iHealth") - damage <= 0 and true or false
        })
        table.insert(hitmarkers, {
            position = get_player:GetHitboxCenter(shot.hitgroup),
            timer = GlobalVars.realtime,
            alpha = 0,
        })
    end
end
end

function move_position()
if #particles > 0 then
    for k, information in pairs(particles) do
        local delta = information.timer - GlobalVars.tickcount
        if delta > 0 then
            information.position.z = information.position.z + 0.3
        end
    end
end
end

function on_round_prestart(e)
if e:GetName() ~= "round_prestart" then return end
particles = {}
hitmarkers = {}
end

function on_self_connected(e)
if e:GetName() ~= "player_connect_full" then return end
particles = {}
hitmarkers = {}
end

function load_markers_modules(e)
damage_markere(e)
on_round_prestart(e)
on_self_connected(e)
end


ref_remove_scope = Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):GetInt()

anim_num = 0

function custom_scope()
Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):SetInt(2)
local_player = EntityList_GetLocalPlayer()

if not local_player or not local_player:IsAlive() or not local_player:GetProp('m_bIsScoped') then
    anim_num = lerp(anim_num, 0, 23 * GlobalVars.frametime)
else
    anim_num = lerp(anim_num, 1, 23 * GlobalVars.frametime)
end

scope_gap1 = scope_gap:GetInt() * anim_num
scope_size1 = scope_size:GetInt() * anim_num
scope_color_1 = scope_color:Get()
scope_color_2 = scope_color1:Get()
width = 1

scope_color_1.a = scope_color_1.a * anim_num
scope_color_2.a = scope_color_2.a * anim_num


start_x = screen_size.x / 2
start_y = screen_size.y / 2

--Left
Render_GradientBoxFilled(Vector2_new(start_x - scope_gap1, start_y), Vector2_new(start_x - scope_size1, start_y + width), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Right
Render_GradientBoxFilled(Vector2_new(start_x + scope_gap1, start_y), Vector2_new(start_x + scope_size1, start_y + width), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Up
Render_GradientBoxFilled(Vector2_new(start_x, start_y + scope_gap1), Vector2_new(start_x + width, start_y + scope_size1), scope_color_1, scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Down
Render_GradientBoxFilled(Vector2_new(start_x, start_y - scope_gap1), Vector2_new(start_x + width, start_y - scope_size1), scope_color_1, scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))
end

function get_time()
local systym_time = ffi.new('SYSTEMTIME')
ffi.C.GetLocalTime(systym_time)

return {
    hour = systym_time.wHour,
    minute = systym_time.wMinute,
    second = systym_time.wSecond,
    milliseconds = systym_time.wMilliseconds,
}
end

local function get_latency()
local netchann_info = EngineClient:GetNetChannelInfo()
if netchann_info == nil then return '0' end
local latency = netchann_info:GetLatency(0)
return string_format('%1.f', math_max(0.0, latency) * 1000.0)
end

local textSize = 0

local function watermark()
local time = get_time()
if time.minute < 10 then time.minute = '0' .. time.minute end
local screen = EngineClient:GetScreenSize()
local ping = get_latency()
local ticks = math_floor(1.0 / GlobalVars.interval_per_tick)

local rightPadding = 12
local var = screen.x - textSize - rightPadding

local x = var - 15
local y = 8
local w = textSize + 20
local h = 17

local nexttext = 'alien.lua | '..Cheat_GetCheatUserName()..' | delay: '.. ping ..'ms | ' .. tostring(time.hour)..':'..tostring(time.minute)

if blur_back:GetBool() then
    Render_Blur(Vector2_new(x+10,y+2+1),Vector2_new(x+textSize+20,h * 1.5 + 4), Color.RGBA(255, 255, 255, 255))
end
Render_BoxFilled(Vector2_new(x+10,y+3),Vector2_new(x+textSize+20,h * 1.5 + 4), Color_new(.1, .1, .1, alpha_slider:Get()/255))
Render_BoxFilled(Vector2_new(x+10,y+3), Vector2_new(x+textSize+20,y+1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))

Render_Text(nexttext, Vector2_new(var+1,15),Color_RGBA(0, 0, 0, 180), 11, verdana11_r)
Render_Text(nexttext, Vector2_new(var,14), Color_RGBA(255, 255, 255, 255), 11, verdana11_r)
local wide = Render_CalcTextSize(nexttext, 11, verdana11_r)
var = var + wide.x

textSize = var - (screen.x - textSize - rightPadding)
end
local function getbinds()
local binds = {}
local cheat_binds = Cheat_GetBinds()

for i = 1, #cheat_binds do
    table_insert(binds, 1, cheat_binds[i])
end
return binds
end
local keybind_names = {
['Double Tap'] = 'Double tap',
['Hide Shots'] = 'On shot anti-aim',
['Slow Walk'] = 'Slow motion',
['Edge Jump'] = 'Jump at edge',
['Fake Ping'] = 'Ping spike',
['Override Resolver'] = 'Resolver override',
['Fake Duck'] = 'Duck peek assist',
['Minimum Damage'] = 'Damage override',
['Auto Peek'] = 'Quick peek assist',
['Body Aim'] = 'Force body aim',
['Safe Points'] = 'Safe points',
['Yaw Base'] = 'Yaw base',
['Enable Thirdperson'] = 'Thirdperson',
['Manual Yaw Base'] = 'Yaw base',
}

local alpha_k = 1
local data_k = {
[''] = {alpha_k = 0}
}

local drag = false
local width_k = 0
local width_ka = 0

function upper_to_lower(str)
str1 = string_sub(str, 2, #str)
str2 = string_sub(str, 1, 1)
return str2:upper()..str1:lower()
end


local function render_conteiner(x, y, w, h, name, font_size, font)
local name_size = Render.CalcTextSize(name, font_size, font)
if teamskeet_kb:Get() == 0 then
    if gradient:GetBool() then
        Render.GradientBoxFilled(Vector2.new(x, y+2), Vector2.new(x + w/2, y+2 - 1), Color.new(0, 0.7843137254901961, 1, 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(0, 0.7843137254901961, 1, 1), Color.new(1, 0, 0.9333333333333333, 1))
        Render.GradientBoxFilled(Vector2.new(x + w/2, y+2), Vector2.new(x + w, y+2 - 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(1, 0.9176470588235294, 0, 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(1, 0.9176470588235294, 0, 1))
    else
        Render.BoxFilled(Vector2.new(x, y+2), Vector2.new(x + w, y+2 - 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
    end
    Render.BoxFilled(Vector2.new(x, y+2), Vector2.new(x + w, y+2 + h - 1), Color.RGBA(20, 20, 20, 255))
    local frametime = GlobalVars.frametime * 16
    local binds = getbinds()
    local add_y = 0
    for i = 1, #binds do

        local bind_name = keybind_names[binds[i]:GetName()] == nil and upper_to_lower(binds[i]:GetName()) or keybind_names[binds[i]:GetName()]
        if data_k[bind_name] == nil then
            data_k[bind_name] = {alpha_k = 0}
        end

        data_k[bind_name].alpha_k = math_lerp(frametime, data_k[bind_name].alpha_k,binds[i]:IsActive() and 1 or 0)
        add_y = add_y + 16 * data_k[bind_name].alpha_k
    end


    Render.BoxFilled(Vector2.new(x, y + h + add_y + 5), Vector2.new(x + w, y + h + 1), Color.RGBA(25, 25, 25, 255))

    Render.Text(name, Vector2.new(x + w / 2 - name_size.x / 2, y + 2+2), Color.new(280, 280, 280), font_size, font, true)
else
    if blur_back:GetBool() then
        Render_Blur(Vector2_new(x-1, y-1), Vector2_new(x + w + 4, y + h + 3), Color.RGBA(255, 255, 255, 255))
    end
    Render_BoxFilled(Vector2_new(x, y), Vector2_new(x + w + 3, y + h + 2), Color_new(.1, .1, .1, alpha_slider:Get()/255))
    Render_BoxFilled(Vector2_new(x, y), Vector2_new(x + w + 3, y - 2), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
    --Render_BoxFilled(Vector2_new(x-1, y), Vector2_new(x+1 + w, y), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 6)
    Render_Text(name, Vector2_new(x+2 + w / 2 + 1 - name_size.x / 2, y + 3), Color_RGBA(0, 0, 0, 180), font_size, font)
    Render_Text(name, Vector2_new(x+1 + w / 2 + 1 - name_size.x / 2, y + 2), Color_RGBA(255, 255, 255, 255), font_size, font)
end
end

keybinds_x:SetVisible(false)
keybinds_y:SetVisible(false)

keybinds_v = 0
widthh = 0
function keybinds()
local x_k, y_k = keybinds_x:GetInt(), keybinds_y:GetInt()
local max_width = 0
local frametime = GlobalVars.frametime * 16
local add_y = 0
local total_width = 66
local active_binds = {}
if teamskeet_kb:Get() == 0 then
    widthh = 200
else
    widthh = 135
end
local bind = getbinds()
if Cheat_IsMenuVisible() or keybinds_v then
    if teamskeet_kb:Get() == 0 then
        render_conteiner(x_k, y_k, width_ka, 16, 'keybinds', 10, pixel7)
    else
        render_conteiner(x_k, y_k, width_ka, 16, 'keybinds', 11, verdana11_r)
    end
    local mouse = Cheat_GetMousePos()
    if Cheat_IsKeyDown(1) and Cheat_IsMenuVisible() then
        if mouse.x >= x_k and mouse.y >= y_k and mouse.x <= x_k + width_ka and mouse.y <= y_k + 18 or drag then
            if not drag then
                drag = true
            else
                keybinds_x:SetInt(mouse.x - math_floor(width_ka / 2))
                keybinds_y:SetInt(mouse.y - 8)
            end
        end
    else
        drag = false
    end
end
for i = 1, #bind do
    local binds = bind[i]
    if teamskeet_kb:Get() == 1 then
        bind_name = keybind_names[binds:GetName()] == nil and upper_to_lower(binds:GetName()) or keybind_names[binds:GetName()]
    else
        if binds:GetValue() == 'on' then
            bndnm = ''
        else
            bndnm = " [" .. binds:GetValue() .. "]"
        end

        bind_name = keybind_names[binds:GetName()] == nil and (upper_to_lower((binds:GetName())) .. bndnm) or (keybind_names[binds:GetName()] ..bndnm)
    end

    --local bind_state = binds:GetValue():lower()
    --if bind_state == 'on' then
    --if binds:GetValue() == "on" then namess = binds:GetName() else namess = binds:GetName() .. " [" .. binds:GetValue() .. "]" end
    bind_state = binds:GetMode()
    if bind_state == 0 then
        bind_state = 'toggled'
    elseif bind_state == 1 then
        if teamskeet_kb:Get() == 1 then
            bind_state = 'holding'
        else
            bind_state = 'HELD'
        end
    end
    --end

    if data_k[bind_name] == nil then
        data_k[bind_name] = {alpha_k = 0}
    end

    data_k[bind_name].alpha_k = math_lerp(frametime, data_k[bind_name].alpha_k,binds:IsActive() and 1 or 0)

    if teamskeet_kb:Get() == 0 then
        bind_state_size = Render_CalcTextSize(bind_state, 10, pixel7)
        bind_name_size = Render_CalcTextSize(bind_name, 10, pixel7)
    else
        bind_state_size = Render_CalcTextSize(bind_state, 11, verdana11_r)
        bind_name_size = Render_CalcTextSize(bind_name, 11, verdana11_r)
    end
    if teamskeet_kb:Get() == 1 then
        Render_Text(bind_name, Vector2_new(x_k+4, y_k + 21 + add_y), Color_new(0, 0, 0, data_k[bind_name].alpha_k), 11, verdana11_r)
        Render_Text('['..bind_state..']', Vector2_new(x_k+1 + (width_ka - bind_state_size.x - 8), y_k + 21 + add_y), Color_new(0, 0, 0, data_k[bind_name].alpha_k), 11, verdana11_r)

        Render_Text(bind_name, Vector2_new(x_k+3, y_k + 20 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 11, verdana11_r)
        Render_Text('['..bind_state..']', Vector2_new(x_k + (width_ka - bind_state_size.x- 8), y_k + 20 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 11, verdana11_r)
    else
        if gradient:GetBool() then
            Render_Text(bind_name, Vector2_new(x_k+5, y_k + 21 + add_y), Color_new(0, 0.7843137254901961, 1, data_k[bind_name].alpha_k), 10, pixel7, true)
            Render_Text(bind_state, Vector2_new(x_k + (width_ka - bind_state_size.x- 8)+4, y_k + 21 + add_y), Color_new(1, 0.9176470588235294, 0, data_k[bind_name].alpha_k), 10, pixel7, true)
        else
            Render_Text(bind_name, Vector2_new(x_k+5, y_k + 21 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 10, pixel7)
            Render_Text(bind_state, Vector2_new(x_k + (width_ka - bind_state_size.x- 8)+4, y_k + 21 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 10, pixel7, true)
        end
    end
    add_y = add_y + 16 * data_k[bind_name].alpha_k


    local width_k = bind_state_size.x + bind_name_size.x + 18

    if width_k > widthh then
        if width_k > max_width then
            max_width = width_k
        end
    end
    if binds:IsActive() then
        table_insert(active_binds, binds)
    end
end
alpha_k = math_lerp(frametime,alpha_k, (Cheat_IsMenuVisible() or #active_binds > 0) and 1 or 0)
width_ka = math_lerp(frametime,width_ka,math_max(max_width, widthh))
keybinds_v = #active_binds > 0


end

local hit_id = 0
local miss_id = 0
local shot_id = 0
local choke = 0
local missgroup_names = { 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local hitgroup_names = { 'generic', 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local miss_reason = { 'resolver', 'spread', 'occlusion', 'prediction error' }
Cheat_RegisterCallback('ragebot_shot', function(shot)
if advanced_shot_logger:GetBool() then
if EntityList_GetLocalPlayer() == nil then return end
total_hits = EntityList_GetLocalPlayer():GetProp('m_totalHitsOnServer')
if total_hits == nil then return end
miss_hitbox = missgroup_names[shot.hitgroup] or '?'
self_choke = ClientState.m_choked_commands
choke = time_to_ticks1(GlobalVars.curtime - EntityList_GetClientEntity(shot.index):GetPlayer():GetProp("m_flSimulationTime")) + 1;
if choke < 0 then
choke = 0
elseif choke > 14 then
choke = 14
end
end
end)
function num_format(b) local c=b%10;if c==1 and b~=11 then return b..'st'elseif c==2 and b~=12 then return b..'nd'elseif c==3 and b~=13 then return b..'rd'else return b..'th'end end
shot_id = 0
hit_ids = 0
total_hits = 0
local missgroup_names = { 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local miss_reason = { '?', 'spread', 'occlusion', 'prediction error' }
function time_to_ticks1(a)
return math_floor(0.5 + a / GlobalVars.interval_per_tick)
end

stuff = {}

function round(x)
return x >= 0 and math_floor(x+0.5) or math_ceil(x-0.5)
end

function yaw_normalize(yaw)
if yaw > 180 or yaw < -180 then
local revolutions = round(math_abs(yaw / 360))
if yaw < 0 then yaw = yaw + 360*revolutions else yaw = yaw - 360*revolutions end
end
return yaw
end

function _verification(shot)
local text = ''

local hg_diff = hgroup ~= aimed_hgroup
local dmg_diff = shot.damage ~= shot.wanted_damage

if hg_diff or dmg_diff then
text = string_format(
' | mismatch: [ %s ]', (function()
local addr = ''

if dmg_diff then addr = 'dmg: ' .. shot.wanted_damage .. (hg_diff and ' | ' or '') end
if hg_diff then addr = addr .. (hg_diff and 'hitgroup: ' .. aimed_hgroup or '') end

return addr
end)()
)
end

return text
end
choke = 0
local engine_client = Utils_CreateInterface('engine.dll', 'VEngineClient014')
local interfacePointer = ffi_typeof('void***')
local I_EngineClientPtr = ffi_cast(interfacePointer, engine_client) or error('engine_client is nil', 2)
local getNetChannelInfo = ffi_cast('void*(__thiscall*)(void*)', I_EngineClientPtr[0][78]) or error('I_EngineClientPtr is nil')
function registered_shot(shot)
hit_id = hit_id + 1

shot_id = num_format((hit_id % 15) + 1)
local safety = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Safe Points'):Get()
local name = string_lower(EntityList_GetClientEntity(shot.target_index):GetPlayer():GetName())
if name == nil then return end
local hgroup = hitgroup_names[shot.hitgroup + 1] or '?'
local hit_chance = tostring(math_floor(shot.hitchance + 0.5))
local backtrack = shot.backtrack
local m_iHealth = EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_iHealth')
if m_iHealth == nil then return end
local health = m_iHealth - shot.damage
if health < 0 then health = 0 end
local aimed_hgroup = hitgroup_names[shot.wanted_hitgroup + 1] or '?'

local feet_yaw = math_min(58, math_max(yaw_normalize(EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_flPoseParameter')[12] * 120 - 60), -58))
if EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_flPoseParameter') == nil then return end
if feet_yaw == nil then return end
local ping = EngineClient_GetNetChannelInfo():GetLatency(0)*1000
local avg_ping = EngineClient_GetNetChannelInfo():GetAvgLatency(0)*1000
--if shot.reason == nil or hit_id == nil or aimed_hgroup == nil or shot_id == nil or feet_yaw == nil or safety == nil or name == nil or hit_chance == nil or ping == nil or avg_ping == nil then return end
local netChannelInfo = ffi_cast('void***', getNetChannelInfo(I_EngineClientPtr)) or error('netchaninfo is nil')
local netChannel = GetNetChannel(netChannelInfo)
local net_state = string_format(
'delay: %d:%.2f | dropped: %.0f',
avg_ping, math_abs(avg_ping-ping), (netChannel.AvgLoss*100)
)

local uflags = {
math_abs(avg_ping-ping) < 1 and 0 or 1,
CVar_FindVar('cl_clock_correction'):GetInt() == 1 and 0 or 1,
CVar_FindVar('cl_clock_correction_force_server_tick') == 999 and 0 or 1
}

local pflags = {
ClientState.m_choked_commands > 1 and 1 or 0,
EntityList_GetLocalPlayer():GetProp('m_flVelocityModifier') < 1.00 and 1 or 0,
(EntityList_GetLocalPlayer():GetRenderOrigin().z <= EntityList_GetClientEntity(shot.target_index):GetPlayer():GetRenderOrigin().z) and 1 or 0
}

local correction = Menu_FindVar('Aimbot', 'Ragebot', 'Main', 'Override Resolver'):GetBool()
if shot.reason == 0 then
text = string_format('Registered %s shot in %s's %s for %d damage [angle: %.2f° | %d:%d°] ( hitchance: %s%% | safety: %s | history(Δ): %d | flags: %s%s )',
shot_id, name, hgroup, shot.damage, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, hit_chance, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags), _verification(shot))
textc = string_format('Registered %s shot in %s's %s for %d damage [angle: %.2f° | %d:%d°] ( hitchance: %s | safety: %s | history(Δ): %d | flags: %s%s )',
shot_id, name, hgroup, shot.damage, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, hit_chance .. "%%", safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags), _verification(shot))
elseif shot.reason == 1 then
shot_reason = (shot.reason == 1 and total_hits ~= EntityList_GetLocalPlayer():GetProp('m_totalHitsOnServer')) and 'damage rejection' or string_format('unknown [angle: %.2f° | %d:%d°]', shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw)
text = string_format('Missed %s shot at %s's %s(%s%%) due to %s ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot_reason, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 2 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to spread [angle: %.2f° | %d:%d°] ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 3 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to occlusion [angle: %.2f° | %d:%d°] ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 4 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to prediction error [%s] [vel_modifier: %.1f | history(Δ): %d | error: %s]',
shot_id, name, miss_hitbox, hit_chance, net_state, EntityList_GetLocalPlayer():GetProp('m_flVelocityModifier'), backtrack, table_concat(uflags))
else
text = string_format('Missed %s shot at %s's %s(%s%%) due to death [dropped: %d | flags: %s | error: %s]',
shot_id, name, miss_hitbox, hit_chance, EngineClient_GetNetChannelInfo():GetAvgLoss(0), table_concat(pflags), table_concat(uflags))
end

if shot.reason == 0 then
colored_print(Color.RGBA(23, 250, 29, 255), "[alien.lua] " .. textc .. '
')

else
colored_print(Color.RGBA(255, 23, 23, 255), "[alien.lua] " .. text .. '
')

end

table_insert(hitlogs, {text = text, time = GlobalVars.realtime})
end

function log_draw()
local x, y = 5, 5
for i, hitlog in ipairs(hitlogs) do
--if draw_type:Get(2) then
Render_Text(hitlog.text, Vector2_new(x+1, y+1), Color_RGBA(0, 0, 0, math_floor((hitlog.time + 10 - GlobalVars.realtime)*500)-105), 10, lucida_console)
Render_Text(hitlog.text, Vector2_new(x, y), Color_RGBA(255, 255, 255, math_floor((hitlog.time + 10 - GlobalVars.realtime)*500)), 10, lucida_console)
--end
y = y + 15
if #hitlogs > 15 then table_remove(hitlogs,1) end
if hitlog.time + 10 < GlobalVars.realtime then table_remove(hitlogs, i) end
end
end
--anti_bruteforce_work.phases:SetVisible(false)


wall_dmg = 0
ent_exists = false
data = {
    xPos = 1,
    yPos = 1,
}
function round_p(a, prec)
    return math_floor(a + 0.5*prec)
end

function prenetration_prediction()
    local me = EntityList_GetLocalPlayer()
    if me == false then return end
    local weap = me:GetActiveWeapon()
    if weap == nil then return end
    local weapon_id = weap:GetWeaponID()
    if weapon_id == nil then return end

    if weap:IsKnife() or weap:IsGrenade() or weapon_id == 31 then
        wall_dmg = 0
        return
    end

    local eye_pos = me:GetEyePosition()
    local eyeX = eye_pos.x
    local eyeY = eye_pos.y
    local eyeZ = eye_pos.z
    local pitch = me:GetRenderAngles().pitch
    local yaw = me:GetRenderAngles().yaw

    local sin_pitch = math_sin(math_rad(pitch))
    local cos_pitch = math_cos(math_rad(pitch))
    local sin_yaw = math_sin(math_rad(yaw))
    local cos_yaw = math_cos(math_rad(yaw))

    local dirVector = { cos_pitch * cos_yaw, cos_pitch * sin_yaw, -sin_pitch }

    local fraction = EngineTrace.TraceRay(Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * 8192), eyeY + (dirVector[2] * 8192), eyeZ + (dirVector[3] * 8192)), me, 0xFFFFFFFF)
    wall_dmg = 0
    ent_exists = false

    if fraction.fraction < 1 then
        local ent, dmg = Cheat_FireBullet(me:GetPlayer(), Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * (8192 * fraction.fraction + 128)), eyeY + (dirVector[2] * (8192 * fraction.fraction + 128)), eyeZ + (dirVector[3] * (8192 * fraction.fraction + 128)))).trace.hit_entity, Cheat_FireBullet(me:GetPlayer(), Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * (8192 * fraction.fraction + 128)), eyeY + (dirVector[2] * (8192 * fraction.fraction + 128)), eyeZ + (dirVector[3] * (8192 * fraction.fraction + 128)))).damage

        if dmg ~= nil then
            ent_exists = true
        end
        if ent == nil then
            ent = -1
        end
        if wall_dmg < dmg then
            wall_dmg = dmg
        end
    end
   
end

function penetration_ind()
    if EngineClient_GetLocalPlayer() == nil or EntityList_GetLocalPlayer() == nil or wall_dmg == nil or not EntityList_GetLocalPlayer():IsAlive() or not penetration:GetBool() then return end

    if wall_dmg > 0 and not penetration_rainbow:GetBool() then
        Render_Text(tostring(round_p(wall_dmg, 1)), Vector2_new((screen_size.x / 2), (screen_size.y / 2 + penetration_position:GetInt())), penetration:GetColor(), 12, verdana12)
    elseif wall_dmg > 0 and penetration_rainbow:GetBool() then
        r, g, b = math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100)) * 127 + 128), math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100) + 2) * 127 + 128), math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100) + 4) * 127 + 128)
        Render_Text(tostring(round_p(wall_dmg, 1)), Vector2_new((screen_size.x / 2), (screen_size.y / 2 + penetration_position:GetInt())), Color_RGBA(r, g, b, 255), 12, verdana12)
    end
end

local phrases = {
'сын инвалида мб Alien.lua прикупишь?',
'не блюй в мой чат ',
'умер , посиди подумай в спектах',
'Алеу какая там ситуацыя с юидом ',
'але 13146 вещает ',
'ХУЙЛАН Я ТВОЮ МАТЬ ЕБАЛ',
'Alien.lua забустила ',
'он еще даже телку не трахал но человека убил ',
'нормально ты так споткнулся',
'ты слишком хуев для этой карты , выйди не позорься',
'ты че пидорас в светлое будущие попрыгал ',
'1.',
'есть всего 3 расы : белые , желтые  и негры . Ты относишься к 4 расе , имбицылов',
'вчера пил пиво , а теперь ебу твою сестру',
'вроде не срал , но уже воняет',
'ты любишь когда тебя хсают nn?',
'хочешь узнать ,  как выглядит твой батя ? а хуй знает',
'в один момент понимаешь , что ебешь не телку , а барана',
'когда открываю гачи мучи вспоминаю твоего отца',
'в кусте ебали твою мать , а ты не знаешь его ИМЕНИ задумайся об этом ....',
'что chimera lua не забустила ',
'а это правда что твоя семья малоимущие и твоему отцу пришлось отсосать хуй у администратора пятерочки за пакетик эклеров??',
'',
'▼- стрелочка вниз - ДАДАДА ИМЕННО В ТОМ МЕСТЕ ТВОЯ МАТЬ У МЕНЯ ОТРАБАТЫВАЕТ',
'ммовский хуесос ты для чего на паблик зашел, заблудился или что?',
'хахах просто легкий пидорас',
'"спи нахуй пидораска',
'ХАХАХА ЧЕ ТЫ ТАМ ВРЕДИТЕЛЬ АХАХАХ СПОТИФАЙ ХАХА Х',
'"СПОТЛАЙТ СПОТЛАЙТ АХАХА СПИНОЙ ПИДОРАСА УБИВАЮ ХАХА',
'ало пидорас ебаный молчишь потому что ебу твой рот',
'Почему улетаешь прикупи  Alien.lua',
'ez '
}

local function get_phrase()
return phrases[Utils.RandomInt(1, #phrases)]:gsub('"', '')
end

function trashtalk(e)
if e:GetName() ~= "player_death" then return end

local me = EntityList.GetLocalPlayer()
local victim = EntityList.GetPlayerForUserID(e:GetInt("userid"))
local attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"))

if victim == attacker or attacker ~= me then return end


EngineClient.ExecuteClientCmd('say "' .. get_phrase() .. '"')
end

current_choke = 0
ind_phase, ind_num, ind_time = 0, 0, 0
last_sent, current_choke = 0, 0
teleport = 0
last_origin = 0
breaking_lc = 0
function gram_create(value, count) local gram = { }; for i=1, count do gram[i] = value; end return gram; end
function gram_update(tab, value, forced) local new_tab = tab; if forced or new_tab[#new_tab] ~= value then table_insert(new_tab, value); table_remove(new_tab, 1); end; tab = new_tab; end
function get_average(tab) local elements, sum = 0, 0; for k, v in pairs(tab) do sum = sum + v; elements = elements + 1; end return sum / elements; end
gram_fyaw = gram_create(0, 2)
teleport_data = gram_create(0, 3)
gram_update(gram_fyaw, math_min(math_abs(AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation()), 58), true)

local frequency = 144

function get_color(number, max, i)
local Colors = {
    { 255, 0, 0 },
    { 237, 27, 3 },
    { 235, 63, 6 },
    { 229, 104, 8 },
    { 228, 126, 10 },
    { 220, 169, 16 },
    { 213, 201, 19 },
    { 176, 205, 10 },
    { 124, 195, 13 }
}

function math_num(int, max, declspec)
    local int = (int > max and max or int)
    local tmp = max / int;

    if not declspec then declspec = max end

    local i = (declspec / tmp)
    i = (i >= 0 and math_floor(i + 0.5) or math_ceil(i - 0.5))

    return i
end

i = math_num(number, max, #Colors)

return
Colors[i <= 1 and 1 or i][1],
Colors[i <= 1 and 1 or i][2],
Colors[i <= 1 and 1 or i][3],
i
end
function update_choked()
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
if ClientState.m_choked_commands == 0 then
    local m_origin = EntityList_GetLocalPlayer():GetProp('m_vecOrigin')

    if last_origin ~= nil then
        teleport = (m_origin-last_origin):Length2D()

        gram_update(teleport_data, teleport, true)
    end

    gram_update(gram_fyaw, math_min(math_abs(breaking_lc == 2 and (AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation())/2 or (AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation())), 58), true)

    last_sent = current_choke
    last_origin = m_origin
end

current_choke = ClientState.m_choked_commands
breaking_lc =
get_average(teleport_data) > 65 and 1 or
(Exploits_GetCharge() > 0.7 and 2 or 0)
end

lag_data = gram_create(0, 90)

request_time, frametime = 0, 0
frametimes = {}

function renderer_gradient(x,y,w,h,c1,c2,ishorizon)
if ishorizon == true then
    Render_GradientBoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1,c2,c1,c2)
else
    Render_GradientBoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1,c1,c2,c2)
end
end

function renderer_rectangle(x,y,w,h,c1)
if blur_back:GetBool() then
    Render_Blur(Vector2_new(x,y),Vector2_new(x+w,y+h), Color.RGBA(255, 255, 255, 255))
end
Render_BoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1)

end

function renderer_text(x,y,cent,string,c1,font,size,alpha)
Render_Text(string,Vector2_new(x+1,y+1), Color_RGBA(0, 0, 0, alpha),size,font,false,cent)
Render_Text(string,Vector2_new(x,y),c1,size,font,false,cent)
end

function renderer_line(x,y,w,h,c1)
Render_Line(Vector2_new(x, y), Vector2_new(w,h), c1)
end

formatting = (function(avg)
if avg < 1 then return ('%.2f'):format(avg) end
if avg < 10 then return ('%.1f'):format(avg) end
return ('%d'):format(avg)
end)
fps_data = gram_create(0, 30)
g_frameRate, g_prev_frameRate = 0, 0
function solus_ui()
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
avg = math_abs(frametime*600)
local addr, nval = '', false
local r, g, b = 150, 150, 150

local fr = GlobalVars.frametime * 3.75
local min_offset = 1200+math_max(0, get_average(teleport_data)-3800)
local teleport_mt = math_abs(math_min(teleport-3800, min_offset) / min_offset * 100)

if ind_num ~= teleport_mt and ind_time < GlobalVars.realtime then
    ind_time = GlobalVars.realtime + 0.005
    ind_num = ind_num + (ind_num > teleport_mt and -1 or 1)
end
ind_phase = ind_phase + (breaking_lc == 1 and fr or -fr)
ind_phase = ind_phase > 1 and 1 or ind_phase
ind_phase = ind_phase < 0 and 0 or ind_phase
if breaking_lc == 2 then
    addr, ind_phase, ind_num = ' | SHIFTING', 0, 0
    r, g, b = 228, 126, 10
elseif ind_phase > 0.1 then
    addr = ' | dst:          '
end
local text_FL = ('FL: %s%s'):format(
(function()
if tonumber(last_sent) < 10 then
    return '  ' .. last_sent
end
return last_sent
end)(),
addr)
local h_FL, w_FL = 17, (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and Render_CalcTextSize(text_FL,11,verdana11_r).x + 8 or -4
local x_FL, y_FL = screen_size.x, (windows_value:Get(1) and 35 or 10) + (25*0)

x_FL = x_FL - w_FL - 10
if windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive() then
    renderer_rectangle(x_FL, y_FL, w_FL, h_FL, Color_new(.1, .1, .1, alpha_slider:Get()/255))

    renderer_gradient(x_FL, y_FL+h_FL, w_FL-w_FL/2, 1, Color_new(.1, .1, .1, alpha_slider:Get()/255), Color_RGBA(r, g, b,255),true)
    renderer_gradient(x_FL + w_FL/2, y_FL + h_FL, w_FL - w_FL/2, 1, Color_RGBA(r, g, b,255), Color_new(.1, .1, .1, alpha_slider:Get()/255),true)

    if ind_phase > 0 then
        renderer_gradient(
        x_FL + w_FL - Render_CalcTextSize(' | dst: ',11,verdana11_r).x + 2,
        y_FL + 6, math_min(100, ind_num) / 100 * 24, 5,

        Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, ind_phase*220/255),
        Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, ind_phase * 25/255),

        true
        )
    end
    renderer_text(x_FL+4, y_FL + 2,false,text_FL,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end

local add_text = (get_average(gram_fyaw) > 0) and '     ' or ''
text_FI = ('%sFAKE (%.1f°)'):format(add_text, get_average(gram_fyaw))
local h_FI, w_FI = 18, (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and Render_CalcTextSize(text_FI,11,verdana11_r).x + 8 or 0

local r,g,b = get_color(get_average(gram_fyaw),30)
local dec = { math_ceil(r - (r/100 * 50)), math_ceil(g - (g/100 * 50)), math_ceil(b - (b/100 * 50)) }
if (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) then
    renderer_gradient(x_FL - w_FI - 6, y_FL, 2, h_FI / 2,Color_RGBA(dec[1], dec[2], dec[3],0),Color_RGBA(r,g,b,255),false)
    renderer_gradient(x_FL - w_FI - 6, y_FL + h_FI / 2, 2, h_FI / 2,Color_RGBA(r,g,b,255),Color_RGBA(dec[1], dec[2], dec[3],0),false)
    renderer_gradient(x_FL - w_FI - 4, y_FL, w_FI / 2, h_FI,Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/20)),Color_new(.1, .1, .1, alpha_slider:Get()/255) ,true)
    renderer_gradient(x_FL - w_FI - 4 + w_FI / 2, y_FL, w_FI / 2, h_FI, Color_new(.1, .1, .1, alpha_slider:Get()/255),Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/20)),true)
    renderer_text(x_FL - w_FI, y_FL + 2,false,text_FI,Color_RGBA(255,255,255,255),verdana11_r,11,120)
    if get_average(gram_fyaw) > 0 then
        Render_Circle(Vector2_new(x_FL - w_FI + 6, y_FL + 8.5), 5, 32, Color_RGBA(89, 119, 239, 255), 2, 0, math.min(360, get_average(gram_fyaw)*6.21))
    end
end

local text_HZ = ('%sms / %dhz'):format(formatting(avg), frequency)

local h_HZ, w_HZ = 17, windows_value:Get(4) and Render_CalcTextSize(text_HZ,11,verdana11_r).x+8 or -4
local x_HZ, y_HZ = screen_size.x, (windows_value:Get(1) and 35 or 10) + (25*((windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and 1 or 0))

local x_HZ = x_HZ - w_HZ - 10
if windows_value:Get(4) then
    local interp = { get_color(15-avg, 15) }
    renderer_gradient(x_HZ,y_HZ+h_HZ,w_HZ/2,1, Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/3)),Color_RGBA(interp[1], interp[2], interp[3], 255),true  )
    renderer_gradient(x_HZ + w_HZ/2, y_HZ+h_HZ, w_HZ-w_HZ/2, 1,Color_RGBA(interp[1], interp[2], interp[3], 255), Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/3)), true)
    renderer_rectangle(x_HZ, y_HZ, w_HZ, h_HZ, Color_new(.1, .1, .1, alpha_slider:Get()/255) or Color_RGBA(237,237,237,alpha_slider:Get()/255))
    renderer_text(x_HZ+4, y_HZ + 2,false,text_HZ,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end
g_frameRate = 0.9 * g_frameRate + (1.0 - 0.9) * GlobalVars.absoluteframetime
gram_update(fps_data, math_abs(g_prev_frameRate-(1/g_frameRate)), true)
g_prev_frameRate = 1/g_frameRate
local g_nValues_t = {
    avg, 1, 3,
    get_average(fps_data)/4, 0
}

local min_value, max_value = math_min(unpack(g_nValues_t)), math_max(unpack(g_nValues_t))

local text_IO_sub = '       '
local text_IO = 'IO | ' ..  text_IO_sub
local w_IE = Render_CalcTextSize(text_IO_sub,11,verdana11_r).x+3
local h_IO, w_IO = 18, Render_CalcTextSize(text_IO,11,verdana11_r).x+8
local graphics = graphs()
if windows_value:Get(4) then
    renderer_rectangle(x_HZ - w_IO - 4, y_HZ, w_IO, h_IO, Color_new(.1, .1, .1, alpha_slider:Get()/255))
    renderer_text(x_HZ - w_IO, y_HZ + 2,false,text_IO,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end
end

function custom_hitsound(e)
if e:GetName() ~= 'player_hurt' then return end
me = EntityList_GetLocalPlayer()
if me == nil then return end
attacker = EntityList_GetPlayerForUserID(e:GetInt('attacker'))
if attacker == nil then return end
if attacker ~= me then return end
--if hitsound_custom:Get() == 1 then sound = 'arena_switch_press_02.wav' else sound = hitsound_name:Get() end
EngineClient_ExecuteClientCmd('playvol buttons/arena_switch_press_02.wav 1')
end

_set_clantag = ffi.cast('int(__fastcall*)(const char*, const char*)', Utils_PatternScan('engine.dll', '53 56 57 8B DA 8B F9 FF 15'))
_last_clantag = nil
function set_clantag(v)
if v == _last_clantag then return end
_set_clantag(v, v)
_last_clantag = v
end

function time_to_ticks(time)
return math_floor(time / GlobalVars.interval_per_tick + 0.5)
end

function gamesense_anim(text, indices)
if not EngineClient_IsConnected() then return end
local text_anim = '              ' .. text .. '                      '
local tickinterval = GlobalVars.interval_per_tick
local tickcount = GlobalVars.tickcount + time_to_ticks(EngineClient_GetNetChannelInfo():GetLatency(0))
local i = tickcount / time_to_ticks(0.3)
i = math_floor(i % #indices)
i = indices[i+1]+1

return string_sub(text_anim, i, i+15)
end
enabled_prev = true

function run_tag_animation()
if clan_tag:GetBool() and EngineClient_IsConnected() then
    --don't advertise other cheats using this or drone strike
    local clan_tag = gamesense_anim('alien.lua', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25})
    if clan_tag ~= clan_tag_prev then
        set_clantag(clan_tag)
    end
    clan_tag_prev = clan_tag
end
end

function clantag(ctx)
if clan_tag:GetBool() then
    local local_player = EntityList_GetLocalPlayer()
    if local_player ~= nil and (not local_player:IsAlive()) and GlobalVars.tickcount % 2 == 0 then --missing noclip check
        run_tag_animation()
    end
end
end

function on_run_command(s)
if clan_tag:GetBool() then
    if ClientState.m_choked_commands == 0 then
        run_tag_animation()
    end
    enabled_prev = false
elseif not clan_tag:GetBool() and enabled_prev == false then
    set_clantag('')
    enabled_prev = true
end
end

ffi_handler = {}
ffi_handler.VGUI_System = ffi_cast(ffi_typeof('void***'), Utils_CreateInterface('vgui2.dll', 'VGUI_System010'))
ffi_handler.get_clipboard_text_length = ffi_cast('get_clipboard_text_length', ffi_handler.VGUI_System[0][7])
ffi_handler.get_clipboard_text = ffi_cast('get_clipboard_text', ffi_handler.VGUI_System[0][11])
ffi_handler.set_clipboard_text = ffi_cast('set_clipboard_text', ffi_handler.VGUI_System[0][9])
function Clipboard.Get()
local clipboard_text_length = ffi_handler.get_clipboard_text_length(ffi_handler.VGUI_System)

if (clipboard_text_length > 0) then
    local buffer = ffi_new('char[?]', clipboard_text_length)

    ffi_handler.get_clipboard_text(ffi_handler.VGUI_System, 0, buffer, clipboard_text_length * ffi_sizeof('char[?]', clipboard_text_length))
    return ffi_string(buffer, clipboard_text_length - 1)
end

return ''
end

function Clipboard.Set(text)
ffi_handler.set_clipboard_text(ffi_handler.VGUI_System, text, #text)
end


local JSON = Panorama_LoadString([[
return {
stringify: JSON.stringify,
parse: JSON.parse
};
]])()

cfg_data = {
bools = {
    dormant_aim,
    enable__aa,
    Hitmarker,
    auto_peek,
    vel_mod_ind,
    screen_dmg,
    avoid_backstab,
    conditions,
    override_on_use,
    override_stand,
    air_hitchance,
    noscope_hitchance,
    proper_baim,
    auto_teleport_in_air,
    override_crouch,
    override_slowwalk,
    override_move,
    override_air,
    enabled_antibrute,
    types[On_Use].mega_shit,
    types[Air].mega_shit,
    types[Crouch].mega_shit,
    types[SlowWalk].mega_shit,
    penetration_rainbow,
    types[Move].mega_shit,
    types[Stay].mega_shit,
    types[Shared].mega_shit,
    types[anti_aim_preset].mega_shit,
    types[Manual].mega_shit,
    types[On_Use].fakelag,
    types[Air].fakelag,
    types[Crouch].fakelag,
    types[SlowWalk].fakelag,
    types[Move].fakelag,
    types[Stay].fakelag,
    penetration,
    types[Shared].fakelag,
    types[anti_aim_preset].fakelag,
    types[Manual].fakelag,
    enable_b2,
    enable_b3,
    enable_b4,
    blur_back,
    custom_scope_switch,
    screen_dmg,
    clan_tag,
    hitsound_custom,
    shit_talk,
    idealpeek,
    advanced_shot_logger
},

ints = {
    air_hitchance_value,
    noscope_hitchance_value,
    dormant_mindmg,
    type,
    manual_yaw_base,
    yaw_on_use,
    scope_size,
    scope_gap,
    arrows_ind,
    teamskeet_kb,
    windows_value,
    types[On_Use].yaw_add_r,
    types[On_Use].yaw_add_l,
    types[On_Use].jitter_mode,
    types[On_Use].jitter,
    types[On_Use].jitter_value_min,
    types[On_Use].jitter_value_max,
    types[On_Use].fake_limit_type,
    types[On_Use].left_desync_value,
    types[On_Use].right_desync_value,
    types[On_Use].fake_option,
    types[On_Use].lby_mode,
    types[On_Use].freestand_desync,
    types[On_Use].desync_on_shot,
    types[On_Use].fakelag_value,
    types[On_Use].random_value,

    --types[Air].yaw,
    types[Air].yaw_add_r,
    types[Air].yaw_add_l,
    types[Air].jitter_mode,
    types[Air].jitter,
    types[Air].jitter_value_min,
    types[Air].jitter_value_max,
    types[Air].fake_limit_type,
    types[Air].left_desync_value,
    types[Air].right_desync_value,
    types[Air].fake_option,
    types[Air].lby_mode,
    types[Air].freestand_desync,
    types[Air].desync_on_shot,
    types[Air].fakelag_value,
    types[Air].random_value,
    penetration_position,
    penetration_speed,
    --types[Crouching].yaw,
    types[Crouch].yaw_add_r,
    types[Crouch].yaw_add_l,
    types[Crouch].jitter_mode,
    types[Crouch].jitter,
    types[Crouch].jitter_value_min,
    types[Crouch].jitter_value_max,
    types[Crouch].fake_limit_type,
    types[Crouch].left_desync_value,
    types[Crouch].right_desync_value,
    types[Crouch].fake_option,
    types[Crouch].lby_mode,
    types[Crouch].freestand_desync,
    types[Crouch].desync_on_shot,
    types[Crouch].fakelag_value,
    types[Crouch].random_value,

    --types[Slowwalk].yaw,
    types[SlowWalk].yaw_add_r,
    types[SlowWalk].yaw_add_l,
    types[SlowWalk].jitter_mode,
    types[SlowWalk].jitter,
    types[SlowWalk].jitter_value_min,
    types[SlowWalk].jitter_value_max,
    types[SlowWalk].fake_limit_type,
    types[SlowWalk].left_desync_value,
    types[SlowWalk].right_desync_value,
    types[SlowWalk].fake_option,
    types[SlowWalk].lby_mode,
    types[SlowWalk].freestand_desync,
    types[SlowWalk].desync_on_shot,
    types[SlowWalk].fakelag_value,
    types[SlowWalk].random_value,

    --types[Moving].yaw,
    types[Move].yaw_add_r,
    types[Move].yaw_add_l,
    types[Move].jitter_mode,
    types[Move].jitter,
    types[Move].jitter_value_min,
    types[Move].jitter_value_max,
    types[Move].fake_limit_type,
    types[Move].left_desync_value,
    types[Move].right_desync_value,
    types[Move].fake_option,
    types[Move].lby_mode,
    types[Move].freestand_desync,
    types[Move].desync_on_shot,
    types[Move].fakelag_value,
    types[Move].random_value,

    --types[Standing].yaw,
    types[Stay].yaw_add_r,
    types[Stay].yaw_add_l,
    types[Stay].jitter_mode,
    types[Stay].jitter,
    types[Stay].jitter_value_min,
    types[Stay].jitter_value_max,
    types[Stay].fake_limit_type,
    types[Stay].left_desync_value,
    types[Stay].right_desync_value,
    types[Stay].fake_option,
    types[Stay].lby_mode,
    types[Stay].freestand_desync,
    types[Stay].desync_on_shot,
    types[Stay].fakelag_value,
    types[Stay].random_value,

    --types[Shared].yaw,
    types[Shared].yaw_add_r,
    types[Shared].yaw_add_l,
    types[Shared].jitter_mode,
    types[Shared].jitter,
    types[Shared].jitter_value_min,
    types[Shared].jitter_value_max,
    types[Shared].fake_limit_type,
    types[Shared].left_desync_value,
    types[Shared].right_desync_value,
    types[Shared].fake_option,
    types[Shared].lby_mode,
    types[Shared].freestand_desync,
    types[Shared].desync_on_shot,
    types[Shared].fakelag_value,
    types[Shared].random_value,

    types[anti_aim_preset].yaw_add_r,
    types[anti_aim_preset].yaw_add_l,
    types[anti_aim_preset].jitter_mode,
    types[anti_aim_preset].jitter,
    types[anti_aim_preset].jitter_value_min,
    types[anti_aim_preset].jitter_value_max,
    types[anti_aim_preset].fake_limit_type,
    types[anti_aim_preset].left_desync_value,
    types[anti_aim_preset].right_desync_value,
    types[anti_aim_preset].fake_option,
    types[anti_aim_preset].lby_mode,
    types[anti_aim_preset].freestand_desync,
    types[anti_aim_preset].desync_on_shot,
    types[anti_aim_preset].fakelag_value,
    types[anti_aim_preset].random_value,

    types[Manual].yaw_add_r,
    types[Manual].yaw_add_l,
    types[Manual].jitter_mode,
    types[Manual].jitter,
    types[Manual].jitter_value_min,
    types[Manual].jitter_value_max,
    types[Manual].fake_limit_type,
    types[Manual].left_desync_value,
    types[Manual].right_desync_value,
    types[Manual].fake_option,
    types[Manual].lby_mode,
    types[Manual].freestand_desync,
    types[Manual].desync_on_shot,
    types[Manual].fakelag_value,
    types[Manual].random_value,

    jitter_b1,
    lby_mode_b1,
    jitter_b2,
    lby_mode_b2,
    jitter_b3,
    lby_mode_b3,
    jitter_b4,
    lby_mode_b4,
    yaw_add_l_b1,
    yaw_add_r_b1,
    jitter_value_b1,
    phase1,
    yaw_add_l_b2,
    yaw_add_r_b2,
    jitter_value_b2,
    phase2,
    yaw_add_l_b3,
    yaw_add_r_b3,
    jitter_value_b3,
    phase3,
    yaw_add_l_b4,
    yaw_add_r_b4,
    jitter_value_b4,
    phase4,
    indicators_style,
    indicators_add,
    teleport_weapons,
    screen_dmg_x,
    screen_dmg_y,
    vel_mod_add_x,
    vel_mod_add_y,
    alpha_slider,
    keybinds_x,
    keybinds_y
},

floats = {

},

strings = {

},

colors = {
    Hitmarker,
    auto_peek,
    penetration,
    accent_color
}
}

de_en_coding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='

function encode(data)
return ((data:gsub('.', function(x)
local r,de_en_coding='',x:byte()
for i=8,1,-1 do r=r..(de_en_coding%2^i-de_en_coding%2^(i-1)>0 and '1' or '0') end
return r;
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c=0
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
return de_en_coding:sub(c+1,c+1)
end)..({ '', '==', '=' })[#data%3+1])
end

function decode(data)
data = string_gsub(data, '[^'..de_en_coding..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(de_en_coding:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string_char(c)
end))
end

export_cfg:RegisterCallback(function()
local Code = {{}, {}, {}, {}, {}}

for _, bools in pairs(cfg_data.bools) do
table_insert(Code[1], bools:GetBool())
end

for _, ints in pairs(cfg_data.ints) do
table_insert(Code[2], ints:GetInt())
end

for _, floats in pairs(cfg_data.floats) do
table_insert(Code[3], floats:GetFloat())
end

for _, strings in pairs(cfg_data.strings) do
table_insert(Code[4], strings:GetString())
end

for _, colors in pairs(cfg_data.colors) do
local clr = colors:GetColor()
table_insert(Code[5], string_format('%02X%02X%02X%02X', math_floor(clr.r * 255), math_floor(clr.g * 255), math_floor(clr.b * 255), math_floor(clr.a * 255)))
end

Clipboard.Set(encode(JSON.stringify(Code)))
end)

function loadcfg(text)
decode_cfg = JSON.parse(decode(text))
if decode_cfg == nil then
print('Error!')
else
for k, v in pairs(decode_cfg) do
    k = ({[1] = 'bools', [2] = 'ints', [3] = 'floats', [4] = 'strings', [5] = 'colors'})[k]

    for k2, v2 in pairs(v) do
        if (k == 'bools') then
            cfg_data[k][k2]:SetBool(v2)
        end

        if (k == 'ints') then
            cfg_data[k][k2]:SetInt(v2)
        end

        if (k == 'floats') then
            cfg_data[k][k2]:SetFloat(v2)
        end

        if (k == 'strings') then
            cfg_data[k][k2]:SetString(v2)
        end

        if (k == 'colors') then
            cfg_data[k][k2]:SetColor(Color_new(tonumber('0x'..v2:sub(1, 2))/255, tonumber('0x'..v2:sub(3, 4))/255, tonumber('0x'..v2:sub(5, 6))/255, tonumber('0x'..v2:sub(7, 8))/255))
        end
    end
end
end
end
import_cfg:RegisterCallback(function()
    loadcfg(Clipboard.Get())
end)
default_cfg:RegisterCallback(function()
    Http.GetAsync('https://www.toptal.com/developers/hastebin/raw/ovosovobuh', function(url_content)
        loadcfg(url_content)
    end)
end)

Cheat_RegisterCallback("frame_stage", function(s)
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
if s == 5 then
on_run_command()
if request_time + 1 < GlobalVars.curtime then
    frametime = GlobalVars.frametime
    request_time = GlobalVars.curtime
    table_insert(frametimes, 1, frametime)

    if #frametimes > 4 then
        table_remove(frametimes, i)
    end
end
end
end)

Cheat_RegisterCallback('registered_shot', function(shot)
reg_shot(shot)


if advanced_shot_logger:GetBool() then
registered_shot(shot)
end
end)

Cheat_RegisterCallback('destroy', function()
Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):SetInt(ref_remove_scope)
CVar_FindVar('sv_disable_radar'):SetInt(0);

end)

Cheat_RegisterCallback('createmove', function(cmd)
if roll_aa_active == true then
actual_move = Vector2_new(cmd.forwardmove, cmd.sidemove) / 2
else
actual_move = Vector2_new(cmd.forwardmove, cmd.sidemove)
end
roll_move_fix(cmd)
update_choked()

end)

Cheat_RegisterCallback('prediction', function(cmd)
    if proper_baim:GetBool() then
        proper_baim_lethal()
    end
teleport_in_air()
dormant_aimbot(cmd)
anti_aims(cmd)
if idealpeek:GetBool() then
ideal_peek()
end
end)

Cheat_RegisterCallback('pre_prediction', function(cmd)
    if penetration:GetBool() then
        prenetration_prediction()
    end
end)

Cheat_RegisterCallback('events', function(e)
load_markers_modules(e)
resetter(e)
anti_bruteforcee(e)
if hitsound_custom:GetBool() then
custom_hitsound(e)
end
if shit_talk:GetBool() then
trashtalk(e)
end
end)

--anti_bruteforce_work.phases:SetVisible(false)

Cheat_RegisterCallback('draw', function()
    if penetration:GetBool() then
        penetration_ind()
    end
if Hitmarker:GetBool() then
damage_markerd()

move_position()
end

if auto_peek:GetBool() then
autopeek()
end
if custom_scope_switch:GetBool() then
custom_scope()
end
if clan_tag:GetBool() then
clantag()
end
handle_brutforcetime()
indicators()
log_draw()
if windows_value:Get(2) then
keybinds()
end
if windows_value:Get(1) then
watermark()
end
if windows_value:Get(3) or windows_value:Get(4) then
solus_ui()
end

if Cheat_IsMenuVisible() then
dormant_mindmg:SetVisible(dormant_aim:GetBool())
air_hitchance_value:SetVisible(air_hitchance:GetBool())
noscope_hitchance_value:SetVisible(noscope_hitchance:GetBool())
teleport_weapons:SetVisible(auto_teleport_in_air:GetBool())
for k,v in pairs(types) do
    for i,data in pairs(v) do
        if conditions:GetBool() and enable__aa:GetBool() then data:SetVisible(type:Get()+1 == k and enable__aa:GetBool()) else data:SetVisible(9 == k and enable__aa:GetBool()) end
        if conditions:GetBool() and enable__aa:GetBool() and type:Get() == 8 then
            data:SetVisible(false)
        end
    end
end
avoid_backstab:SetVisible(enable__aa:GetBool())
conditions:SetVisible(enable__aa:GetBool())
type:SetVisible(conditions:GetBool() and enable__aa:GetBool())
yaw_on_use:SetVisible(override_on_use:GetBool() and conditions:GetBool() and enable__aa:GetBool() and type:Get() == 1)
override_on_use:SetVisible(type:Get() == 1 and conditions:GetBool() and enable__aa:GetBool() )
override_stand:SetVisible(type:Get() == 2 and conditions:GetBool() and enable__aa:GetBool() )
override_crouch:SetVisible(type:Get() == 3 and conditions:GetBool() and enable__aa:GetBool() )
override_slowwalk:SetVisible(type:Get() == 4 and conditions:GetBool() and enable__aa:GetBool() )
override_move:SetVisible(type:Get() == 5 and conditions:GetBool() and enable__aa:GetBool() )
override_air:SetVisible(type:Get() == 6 and conditions:GetBool() and enable__aa:GetBool())
override_manual:SetVisible(type:Get() == 7 and conditions:GetBool() and enable__aa:GetBool())
enabled_antibrute:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool())
enable_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
yaw_add_l_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
yaw_add_r_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
jitter_b1:SetVisible(type:Get() == 8 and enable__aa:GetBool() )
jitter_value_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
lby_mode_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
phase1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
teamskeet_kb:SetVisible(windows_value:Get(2))
gradient:SetVisible(windows_value:Get(2) and teamskeet_kb:Get() == 0)
yaw_add_l_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
yaw_add_r_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
jitter_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
jitter_value_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
lby_mode_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
phase2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )

enable_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
yaw_add_l_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_r_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_value_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
lby_mode_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
phase3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
penetration_position:SetVisible(penetration:GetBool())
    penetration_rainbow:SetVisible(penetration:GetBool())
    penetration_speed:SetVisible(penetration:GetBool())
enable_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_l_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_r_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_value_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
lby_mode_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
phase4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )


indicators_add:SetVisible(indicators_style:GetBool(1))
alpha_slider:SetVisible(windows_value:Get(2) or windows_value:Get(3) or windows_value:Get(4) or windows_value:Get(1))
blur_back:SetVisible(windows_value:Get(2) or windows_value:Get(3) or windows_value:Get(4) or windows_value:Get(1))
scope_size:SetVisible(custom_scope_switch:GetBool())
scope_gap:SetVisible(custom_scope_switch:GetBool())
scope_color:SetVisible(custom_scope_switch:GetBool())
screen_dmg_x:SetVisible(screen_dmg:GetBool())
vel_mod_add_x:SetVisible(vel_mod_ind:GetBool())
vel_mod_add_y:SetVisible(vel_mod_ind:GetBool())
screen_dmg_y:SetVisible(screen_dmg:GetBool())
end

end)

Пожалуйста, авторизуйтесь для просмотра ссылки.
Это делал тот парень которйы солус что-ли купил?
 
Забаненный
Статус
Оффлайн
Регистрация
30 Мар 2019
Сообщения
32
Реакции[?]
2
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Олдфаг
Статус
Оффлайн
Регистрация
28 Дек 2018
Сообщения
2,585
Реакции[?]
1,436
Поинты[?]
2K
Я не знаю какой смысл сливать весь этот шлак, в этих луа уже кроме названия ничего не меняют. Даже при js на кряк вантапа такого не было.
 
Пользователь
Статус
Оффлайн
Регистрация
3 Июл 2021
Сообщения
833
Реакции[?]
93
Поинты[?]
10K
code_language.asm6502:
local ffi = require 'ffi'
-- local variables for API functions. any changes to the line below will be lost on re-generation
AntiAim_GetCurrentRealRotation, AntiAim_GetInverterState, AntiAim_OverrideInverter, AntiAim_OverrideLimit, bit_band, bit_lshift, Cheat_AddNotify, Cheat_GetBinds, Cheat_GetCheatUserName, Cheat_GetMousePos, Cheat_IsKeyDown, Cheat_IsMenuVisible, Cheat_RegisterCallback, Color_new, Color_RGBA, EngineClient_ExecuteClientCmd, EngineClient_GetNetChannelInfo, EngineClient_GetScreenSize, EngineClient_GetViewAngles, EngineClient_IsConnected, EngineClient_IsInGame, EntityList_GetClientEntity, EntityList_GetEntitiesByClassID, EntityList_GetLocalPlayer, EntityList_GetPlayerForUserID, EntityList_GetPlayerFromHandle, EntityList_GetPlayers, Exploits_GetCharge, Exploits_OverrideDoubleTapSpeed, math_abs, math_atan2, math_cos, math_deg, math_floor, math_max, math_min, math_sin, Menu_Button, Menu_ColorEdit, Menu_Combo, Menu_FindVar, Menu_MultiCombo, Menu_SliderInt, Menu_Switch, Menu_Text, Utils_PatternScan, Utils_RandomInt, pairs, Panorama_Open, Render_Box, Render_BoxFilled, Render_CalcTextSize, Render_Circle, Render_GradientBoxFilled, Render_InitFont, Render_PolyFilled, Render_Text, string_sub, tostring, Vector2_new, print, string_format, table_insert, table_remove, ipairs, Vector_new, EngineClient_GetLocalPlayer, EntityList_GetEntitiesByName, math_pi, QAngle_new, Cheat_FireBullet, math_sqrt, bit_bor, ffi_cdef, ffi_typeof, ffi_cast, EngineClient_GetGameDirectory, string_gsub, ffi_C, ffi_string, RageBot_OverrideMinDamage, math_ceil, Menu_SwitchColor, string_lower, Utils_CreateInterface, CVar_FindVar, table_concat, AntiAim_GetFakeRotation, ffi_new, EntityList_GetClientEntityFromHandle, string_find, Render_LoadImage, ffi_copy, AntiAim_OverrideYawOffset, Render_WorldToScreen, Render_Blur, Panorama_LoadString, ffi_sizeof, string_char, Render_Circle3DFilled, RageBot_OverrideHitchance, Exploits_ForceTeleport, math_rad = AntiAim.GetCurrentRealRotation, AntiAim.GetInverterState, AntiAim.OverrideInverter, AntiAim.OverrideLimit, bit.band, bit.lshift, Cheat.AddNotify, Cheat.GetBinds, Cheat.GetCheatUserName, Cheat.GetMousePos, Cheat.IsKeyDown, Cheat.IsMenuVisible, Cheat.RegisterCallback, Color.new, Color.RGBA, EngineClient.ExecuteClientCmd, EngineClient.GetNetChannelInfo, EngineClient.GetScreenSize, EngineClient.GetViewAngles, EngineClient.IsConnected, EngineClient.IsInGame, EntityList.GetClientEntity, EntityList.GetEntitiesByClassID, EntityList.GetLocalPlayer, EntityList.GetPlayerForUserID, EntityList.GetPlayerFromHandle, EntityList.GetPlayers, Exploits.GetCharge, Exploits.OverrideDoubleTapSpeed, math.abs, math.atan2, math.cos, math.deg, math.floor, math.max, math.min, math.sin, Menu.Button, Menu.ColorEdit, Menu.Combo, Menu.FindVar, Menu.MultiCombo, Menu.SliderInt, Menu.Switch, Menu.Text, Utils.PatternScan, Utils.RandomInt, pairs, Panorama.Open, Render.Box, Render.BoxFilled, Render.CalcTextSize, Render.Circle, Render.GradientBoxFilled, Render.InitFont, Render.PolyFilled, Render.Text, string.sub, tostring, Vector2.new, print, string.format, table.insert, table.remove, ipairs, Vector.new, EngineClient.GetLocalPlayer, EntityList.GetEntitiesByName, math.pi, QAngle.new, Cheat.FireBullet, math.sqrt, bit.bor, ffi.cdef, ffi.typeof, ffi.cast, EngineClient.GetGameDirectory, string.gsub, ffi.C, ffi.string, RageBot.OverrideMinDamage, math.ceil, Menu.SwitchColor, string.lower, Utils.CreateInterface, CVar.FindVar, table.concat, AntiAim.GetFakeRotation, ffi.new, EntityList.GetClientEntityFromHandle, string.find, Render.LoadImage, ffi.copy, AntiAim.OverrideYawOffset, Render.WorldToScreen, Render.Blur, Panorama.LoadString, ffi.sizeof, string.char, Render.Circle3DFilled, RageBot.OverrideHitchance, Exploits.ForceTeleport, math.rad
Cheat_AddNotify('Alien.lua', 'Welcome to alien.lua, '..Cheat_GetCheatUserName()..'!')
Clipboard = {}
ffi.cdef[[
typedef void*(__thiscall* getnetchannel_t)(void*); // engineclient 78
typedef unsigned short WORD;
typedef struct _SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
}
SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

typedef int(__thiscall* get_clipboard_text_length)(void*);
typedef void(__thiscall* set_clipboard_text)(void*, const char*, int);
typedef void(__thiscall* get_clipboard_text)(void*, int, const char*, int);

void GetLocalTime(
LPSYSTEMTIME lpSystemTime
);
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);
typedef struct {
    uint8_t r; uint8_t g; uint8_t b; uint8_t a;
} color_struct_t;

typedef void (*console_color_print)(const color_struct_t&, const char*, ...);
void* GetProcAddress(void* hModule, const char* lpProcName);
void* GetModuleHandleA(const char* lpModuleName);

int       CreateDirectoryA(const char*, void*);
void*     CreateFileA(const char*, uintptr_t, uintptr_t, void*, uintptr_t, uintptr_t, void*);
uintptr_t GetFileSize(void*, uintptr_t*);
int       ReadFile(void*, void*, uintptr_t, uintptr_t*, void*);
int       WriteFile(void*, const void*, uintptr_t, uintptr_t*, void*);
int       CloseHandle(void*);
typedef float*(__thiscall* bound)(void*);

]]

color_print_fn = ffi.cast("console_color_print", ffi.C.GetProcAddress(ffi.C.GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXABVColor@@PBDZZ"))

function colored_print(color, text)
    local col = ffi.new("color_struct_t")
    for i, v in pairs({"r", "g", "b", "a"}) do
        col[v] = color[v] * 255
    end
    color_print_fn(col, text)
end

local urlmon = ffi.load 'UrlMon'
local wininet = ffi.load 'WinInet'
local screen_size = EngineClient_GetScreenSize()

local default_cfg = Menu_Button('Global', 'Configs', 'Load Default Config', '')
local export_cfg = Menu_Button('Global', 'Configs', 'Export Config', '')
local import_cfg = Menu_Button('Global', 'Configs', 'Import Config', '')
Menu_Text('Global', 'Information', 'Welcome '..Cheat_GetCheatUserName()..'!

Version: Live 0.1!')

local dormant_aim = Menu_Switch('Rage', 'Ragebot', 'Dormant Aimbot', false)
local dormant_mindmg = Menu_SliderInt('Rage', 'Ragebot', 'Dormant MinDmg', 10, 1, 100)
local air_hitchance = Menu_Switch('Rage', 'Ragebot', 'Custom Air Hitchance', false)
local air_hitchance_value = Menu_SliderInt('Rage', 'Ragebot', 'Air Hitchance', 1, 1, 100)
local noscope_hitchance = Menu_Switch('Rage', 'Ragebot', 'Custom Noscope Hitchance', false)
local noscope_hitchance_value = Menu_SliderInt('Rage', 'Ragebot', 'Noscope Hitchance', 1, 1, 100)
local auto_teleport_in_air = Menu_Switch('Rage', 'Ragebot', 'Automatic Cross Teleport in Air', false)
local teleport_weapons = Menu_MultiCombo('Rage', 'Ragebot', 'Teleport weapons', {'AWP', 'AutoSnipers', 'Scout', 'Deagle', 'Revolver', 'Nades', 'Other', 'Pistols', 'Rifle/LMG', 'SMG', 'Shotgun', 'Taser'}, 0)
local proper_baim = Menu_Switch('Rage', 'Ragebot', 'Force Baim if Lethal', false)

local enable__aa = Menu_Switch('Anti Aim', 'Anti Aim', 'Enable', false)
local avoid_backstab = Menu_Switch('Anti Aim', 'Anti Aim', 'Avoid Backstab', false)
local conditions = Menu_Switch('Anti Aim', 'Anti Aim', 'Conditions', false)
local type = Menu_Combo('Anti Aim', 'Anti Aim', 'Currect Condition', {'Shared', 'On Use', 'Stay', 'Crouch', 'Slow Walk', 'Move', 'Air', 'Manual', 'Anti-Bruteforce'}, 0)
local manual_yaw_base = Menu_Combo('Anti Aim', 'Anti Aim', 'Manual Yaw Base', {'Disabled', 'Forward', 'Backward', 'Right', 'Left', 'At Target', 'Freestanding'}, 0)
local override_on_use = Menu_Switch('Anti Aim', 'Anti Aim', 'Override On Use', false)
local override_stand = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Stay', false)
local override_crouch = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Crouch', false)
local override_slowwalk = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Slow Walk', false)
local override_move = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Move', false)
local override_air = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Air', false)
local enabled_antibrute = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Anti Bruteforce', false)
local override_manual = Menu_Switch('Anti Aim', 'Anti Aim', 'Override Manual', false)

local types = {}
local numtotext = {
    [0] = 'Shared',
    [1] = 'On Use',
    [2] = 'Stay',
    [3] = 'Crouch',
    [4] = 'Slow Walk',
    [5] = 'Move',
    [6] = 'Air',
    [7] = 'Manual',
    [8] = 'Anti Aim Preset',
}
local i = 0
local yaw_on_use = Menu_Combo('Anti Aim', 'On Use', 'Yaw Base', {'Forward', 'Backward', 'Right', 'Left', 'At Target', 'Freestanding'}, 0)
while #types ~= 9 do
    table_insert(types, {
        yaw_add_l = Menu_SliderInt('Anti Aim', numtotext[i], 'Yaw Add Left', 0, -180, 180),
        yaw_add_r = Menu_SliderInt('Anti Aim', numtotext[i], 'Yaw Add Right', 0, -180, 180),
        jitter_mode = Menu_Combo('Anti Aim', numtotext[i], 'Yaw Modifier Mode', {'Disabled', 'Random'}, 0),
        jitter = Menu_Combo('Anti Aim', numtotext[i], 'Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0),
        --jitter_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree',0, -180, 180),
        jitter_value_min = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree Min',0, -180, 180),
        jitter_value_max = Menu_SliderInt('Anti Aim', numtotext[i], 'Modifier Degree Max',0, -180, 180),
        fake_limit_type = Menu_Combo('Anti Aim', numtotext[i], 'Fake Limit Type', {'Static', 'Jitter'}, 0),
        left_desync_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Left Limit', 0, 0, 60),
        right_desync_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Right Limit', 0, 0, 60),
        fake_option = Menu_MultiCombo('Anti Aim', numtotext[i], 'Fake Options', {'Avoid Overlap', 'Jitter', 'Randomize Jitter', 'Anti Bruteforce'}, 0),
        lby_mode = Menu_Combo('Anti Aim', numtotext[i], 'LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0),
        freestand_desync = Menu_Combo('Anti Aim', numtotext[i], 'Freestanding Desync', {'Off', 'Peek Fake', 'Peek Real'}, 0),
        desync_on_shot = Menu_Combo('Anti Aim', numtotext[i], 'Desync On Shot', {'Disabled', 'Opposite', 'Freestanding', 'Switch'}, 0),
        fakelag = Menu_Switch('Anti Aim', numtotext[i], 'Enable Fake Lag', false),
        fakelag_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Limit', 0, 0, 14),
        random_value = Menu_SliderInt('Anti Aim', numtotext[i], 'Randomization', 0, 0, 14),
        mega_shit = Menu_Switch('Anti Aim', numtotext[i], 'Roll AA', false),
    })
    i = i + 1
end

yaw_add_l_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Yaw Add Left', 0, -180, 180)
yaw_add_r_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Yaw Add Right', 0, -180, 180)
jitter_b1 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[1] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Modifier Degree',0,-180,180)
lby_mode_b1 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[1] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase1 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[1] Fake Limit', 0, -60, 60)

enable_b2 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 2', false)
yaw_add_l_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Yaw Add Left', 0, -180, 180)
yaw_add_r_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Yaw Add Right', 0, -180, 180)
jitter_b2 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[2] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Modifier Degree',0,-180,180)
lby_mode_b2 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[2] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase2 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[2] Fake Limit', 0, -60, 60)

enable_b3 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 3', false)
yaw_add_l_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Yaw Add Left', 0, -180, 180)
yaw_add_r_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Yaw Add Right', 0, -180, 180)
jitter_b3 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[3] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Modifier Degree',0,-180,180)
lby_mode_b3 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[3] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase3 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[3] Fake Limit', 0, -60, 60)

enable_b4 = Menu_Switch('Anti Aim', 'Anti Bruteforce', 'Enable Miss 4', false)
yaw_add_l_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Yaw Add Left', 0, -180, 180)
yaw_add_r_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Yaw Add Right', 0, -180, 180)
jitter_b4 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[4] Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0)
jitter_value_b4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Modifier Degree',0,-180,180)
lby_mode_b4 = Menu_Combo('Anti Aim', 'Anti Bruteforce', '[4] LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0)
phase4 = Menu_SliderInt('Anti Aim', 'Anti Bruteforce', '[4] Fake Limit', 0, -60, 60)

local indicators_style = Menu_MultiCombo('Visuals', 'Visuals', 'Crosshair Indicators', {'Drain yaw', 'Acatel', 'Medusa', 'Arctic', 'Half-Life'}, 0)
local indicators_add = Menu_MultiCombo('Visuals', 'Visuals', 'Indicators Add', {'Script Name', 'Inverter', 'Anti-Aim Arrow',  'Anti-Aim State', 'Double-Tap', 'Hide Shots', 'Minimum Damage', 'Force Body Aim', 'Force Safe Points', 'Freestanding', 'Ideal tick'}, 0)
local windows_value = Menu_MultiCombo('Visuals', 'Visuals', 'Windows', {'Watermark', 'Hotkey list', 'Anti-aimbot indication', 'Frequency update information'}, 0)
local teamskeet_kb = Menu_Combo('Visuals', 'Visuals', 'Hotkey list theme', {'Teamskeet', "Default"}, 0)
local gradient = Menu_Switch('Visuals', 'Visuals', 'Hotkey list Gradient', false)
local custom_scope_switch = Menu_Switch('Visuals', 'Visuals', 'Custom Scope', false)
local auto_peek = Menu_SwitchColor('Visuals', 'Visuals', 'Glow AutoPeek', false, Color_RGBA(255, 0, 0, 255))
local arrows_ind = Menu_Combo('Visuals', 'Visuals', 'Arrows', {'Disable', 'Teamskeet', 'Modern', "Default", 'Drain yaw'}, 0)
local vel_mod_ind = Menu_Switch('Visuals', 'Visuals', 'Velocity Modifier Indicator', false)
local screen_dmg = Menu_Switch('Visuals', 'Visuals', 'Min damage Indicator', false)
local Hitmarker = Menu_SwitchColor('Visuals', 'Visuals', 'Hitmarker', false, Color_RGBA(255, 255, 255, 255))
local penetration = Menu_SwitchColor('Visuals', 'Visuals', 'Penetration indicator', false, Color_RGBA(255, 195, 13, 255))

local accent_color = Menu_ColorEdit('Visuals', 'Settings', 'Accent Color', Color_RGBA(177, 171, 255, 255))
local alpha_slider = Menu_SliderInt('Visuals', 'Settings', 'Background Alpha', 222, 0, 255)
local blur_back = Menu_Switch('Visuals', 'Settings', 'Background Blur', false)
local keybinds_x = Menu_SliderInt('Visuals', 'Settings', 'x_pos', screen_size.x/2-250, 1, screen_size.x)
local keybinds_y = Menu_SliderInt('Visuals', 'Settings', 'y_pos', screen_size.y/2-50, 1, screen_size.y)
local ind_clr = Menu_ColorEdit('Visuals', 'Settings', 'Arrow Color', Color_RGBA(175, 255, 0, 255))
local ind_clr2 = Menu_ColorEdit('Visuals', 'Settings', 'Arrow Desync Color', Color_RGBA(0, 200, 255, 255))
local vel_mod_add_x = Menu_SliderInt('Visuals', 'Settings', 'Velocity Modifier X', 22, -screen_size.x, screen_size.x)
local vel_mod_add_y = Menu_SliderInt('Visuals', 'Settings', 'Velocity Modifier Y', 200, -screen_size.y, screen_size.y)
local screen_dmg_x = Menu_SliderInt('Visuals', 'Settings', 'Mindamage Add X', 0, -100, 100)
local screen_dmg_y = Menu_SliderInt('Visuals', 'Settings', 'Mindamage Add Y', 0, -100, 100)
local scope_size = Menu_SliderInt('Visuals', 'Settings', 'Custom Scope Size', 50, 50, screen_size.y/2)
local scope_gap = Menu_SliderInt('Visuals', 'Settings', 'Custom Scope Gap', 10, 0, screen_size.y/2)

local scope_color = Menu_ColorEdit('Visuals', 'Settings', 'Scope Color', Color_RGBA(255, 255, 255, 255))
local scope_color1 = Menu_ColorEdit('Visuals', 'Settings', 'Scope Color 1', Color_RGBA(255, 255, 255, 0))
local penetration_position = Menu_SliderInt('Visuals', 'Settings', 'Position indicator', -25, -50, 50)
local penetration_rainbow = Menu_Switch('Visuals', 'Settings', 'Rainbow mode', false)
local penetration_speed = Menu_SliderInt('Visuals', 'Settings', 'Speed rainbow', 50, 1, 100)
scope_color1:SetVisible(false)
download_file_from_url = function(from, to)
wininet.DeleteUrlCacheEntryA(from)
urlmon.URLDownloadToFileA(nil, from, to, 0,0)
end

ct = ffi_typeof('char[?]')
c_invalid_handle_value = ffi_cast('void*', -1)
local netChannelInt = ffi_typeof('int(__thiscall*)(void*, int)')
local netChannelBool = ffi_typeof('bool(__thiscall*)(void*)')
local netChannelBoolWithArgs = ffi_typeof('bool(__thiscall*)(void*, int, int)')
local netChannelFloat = ffi_typeof('float(__thiscall*)(void*, int)')
function GetNetChannel(netChannelInfo)
if netChannelInfo == nil then
    return
end

local SequenceNr = ffi_cast(netChannelInt, netChannelInfo[0][17])(netChannelInfo, 1)

return {
    SequenceNr = SequenceNr,

    IsLoopback = ffi_cast(netChannelBool, netChannelInfo[0][6])(netChannelInfo),
    IsTimingOut = ffi_cast(netChannelBool, netChannelInfo[0][7])(netChannelInfo),

    Latency = {
        RTT = function(flow) return ffi_cast(netChannelFloat, netChannelInfo[0][9])(netChannelInfo, flow) end,
        AvgLatency = function(flow) return ffi_cast(netChannelFloat, netChannelInfo[0][10])(netChannelInfo, flow) end,
    },

    AvgLoss = ffi_cast(netChannelFloat, netChannelInfo[0][11])(netChannelInfo, 1),
    AvgChoke = ffi_cast(netChannelFloat, netChannelInfo[0][12])(netChannelInfo, 1),
    InputBytes = ffi_cast(netChannelFloat, netChannelInfo[0][13])(netChannelInfo, 1),
    SendBytes = ffi_cast(netChannelFloat, netChannelInfo[0][13])(netChannelInfo, 0),

    IsValidPacket = ffi_cast(netChannelBoolWithArgs, netChannelInfo[0][18])(netChannelInfo, 1, SequenceNr-1),
}
end

function package.loaded.readfile(filename)
local fp = ffi_C.CreateFileA(filename, 0x80000000, 3, nil, 3, 128, nil)
if c_invalid_handle_value ~= fp then
    local size = ffi_C.GetFileSize(fp, nil)
    local buf = ct(size + 1)
    ffi_C.ReadFile(fp, buf, size, nil, nil)
    ffi_C.CloseHandle(fp)
    return ffi_string(buf, size)
end
end

game_path_str = EngineClient_GetGameDirectory()
game_path = string_gsub(game_path_str, '\csgo', '\')

if (package.loaded.readfile('nl\alien\fonts\small_pixel.ttf') and package.loaded.readfile('nl\alien\fonts\arrows.ttf')) then

else
ffi.C.CreateDirectoryA('nl\alien\', NULL)
ffi.C.CreateDirectoryA('nl\alien\fonts\', NULL)

download_file_from_url('https://fontsforyou.com/downloads/99851-smallestpixel97', 'nl\alien\fonts\small_pixel.ttf')
download_file_from_url('https://cdn.discordapp.com/attachments/947429839101624320/952177029867003924/arrows.ttf', 'nl\alien\fonts\arrows.ttf')
Menu_Text('Global', 'Information', 'Dear User, Restart script!')
Cheat_AddNotify('alien', 'Files downloaded, restart script!')
end

local anti_bruteforce_work = {
phases = stagesb,
work = false,
work_value = 0.0,
work_memory = {

},
memory = {

}
}

for i = 0, 64 do
table_insert(anti_bruteforce_work.memory,i,{count = 0})
end


local advanced_shot_logger = Menu_Switch('Misc', 'Misc', 'Advanced Shot Logger', false)
local hitsound_custom = Menu_Switch('Misc', 'Misc', 'Skeet Hitsound', false)
local clan_tag = Menu_Switch('Misc', 'Misc', 'Clan-Tag Changer', false)
local shit_talk = Menu_Switch('Misc', 'Misc', 'TrashTalk', false)
local idealpeek = Menu_Switch('Misc', 'Misc', 'Ideal Peek', false)

local Shared = 1
local On_Use = 2
local Stay = 3
local Crouch = 4
local SlowWalk = 5
local Move = 6
local Air = 7
local Manual = 8
local legitaa_time = GlobalVars.realtime
local anti_aim_preset = 9
local ConVar = {
yaw = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'),
yaw_add = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Add'),
jitter = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Modifier'),
jitter_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Modifier Degree'),
left_desync_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Left Limit'),
right_desync_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Right Limit'),
fake_option = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Fake Options'),
lby_mode = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'LBY Mode'),
freestand_desync = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Freestanding Desync'),
desync_on_shot = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Desync On Shot'),
fakelag = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Enable Fake Lag'),
fakelag_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Limit'),
random_value = Menu_FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Randomization'),

slowwalk = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Slow Walk'),
fakeduck = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Fake Duck'),
}
local original_aa = true

function modify_velocity(cmd, goalspeed)
local minspeed = math_sqrt((cmd.forwardmove * cmd.forwardmove) + (cmd.sidemove * cmd.sidemove))
if goalspeed <= 0 or minspeed <= 0 then
    return
end

if EntityList_GetLocalPlayer():GetProp('m_flDuckAmount') >= 1 then
    goalspeed = goalspeed * 2.94117647
end

if minspeed <= goalspeed then
    return
end

local speedfactor = goalspeed / minspeed
cmd.forwardmove = cmd.forwardmove * speedfactor
cmd.sidemove = cmd.sidemove * speedfactor
end

roundStarted = 0
player_info_prev = {}
dormant_flag = false

for i = 1, 64 do
player_info_prev[i] = {
    origin = Vector_new(0, 0, 0),
}
end

function calc_angle(src, dst)
local vecdelta = Vector_new(dst.x - src.x, dst.y - src.y, dst.z - src.z)
local angles = QAngle_new(math_atan2(-vecdelta.z, vecdelta:Length2D()) * 180.0 / math_pi, (math_atan2(vecdelta.y, vecdelta.x) * 180.0 / math_pi), 0.0)
return angles
end

min = Vector_new()
max = Vector_new()
target_correct = true
last_value = 0
should = false
dmg_type = 0
once = false
prsd_damage = 0


function dormant_aimbot(cmd)

local players = EntityList_GetPlayers()
local m_bIsScoped = EntityList_GetLocalPlayer():GetProp('m_bIsScoped')
local is_in_air = bit_band(EntityList_GetLocalPlayer():GetProp('m_fFlags'), bit_lshift(1,0)) ~= 0
local weapon = EntityList_GetLocalPlayer():GetActiveWeapon()
if weapon == nil then return end
for _, enemy in ipairs(players) do
    if not enemy:IsTeamMate() and enemy ~= EntityList_GetLocalPlayer() then
        local enemy_index = enemy:EntIndex()
        if air_hitchance:GetBool() and not is_in_air then
            RageBot_OverrideHitchance(enemy_index, air_hitchance_value:GetInt())
        elseif noscope_hitchance:GetBool() and not m_bIsScoped and weapon:IsSniper() then
            RageBot_OverrideHitchance(enemy_index, noscope_hitchance_value:GetInt())
        end
    end
end
if dormant_aim:GetBool() then
    local lp = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if lp == nil then return end

    local ent = lp:GetActiveWeapon()
    if not ent then
        return
    end

    --local ent = native_GetClientEntity(my_weapon)
    --if ent == nil or not native_IsWeapon(ent) then
    --    return
    --end

    local inaccuracy = ent:GetInaccuracy(ent)
    if inaccuracy == nil then
        return
    end

    local tickcount = GlobalVars.tickcount
    local eyepos = lp:GetEyePosition()
    local simtime = lp:GetProp('m_flSimulationTime')
    local weapon = ent:GetWeaponID()
    local scoped = lp:GetProp('m_bIsScoped')

    local onground = bit_band(lp:GetProp('m_fFlags'), bit_lshift(1, 0))
    if tickcount < roundStarted then return end -- to prevent shooting at ghost dormant esp @ the beginning of round
    local is_AWP = weapon == 9
    local is_auto = (weapon == 38 or weapon == 11)
    local is_scout = weapon == 40
    if ent:IsKnife() or ent:IsGrenade() or weapon == 31 then return end
    local can_shoot
    local hs_fix = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Hide Shots'):GetBool() and 0.3 or 0
    if weapon == 64 then -- for some reason can_shoot returns always false with r8 despite all 3 props being true, no idea why
        can_shoot = simtime > ent:GetProp('m_flNextPrimaryAttack') + hs_fix -- doing this fixes it ><
    elseif ent:IsPistol() and not weapon == 64 and not weapon == 1 then
        can_shoot = false
    else
        can_shoot = simtime > math_max(lp:GetProp('m_flNextAttack') + hs_fix, ent:GetProp('m_flNextPrimaryAttack') + hs_fix, ent:GetProp('m_flNextSecondaryAttack'))
    end

    -- new player info
    local players = EntityList_GetEntitiesByName('CCSPlayer')
    local player_info = {}
    for i = 1, #players do
        local player = players[i]:GetPlayer()
        if EngineClient_IsConnected() and lp:IsAlive() then
            --if plist_get(player, 'Add to whitelist') then goto skip end
            if player:IsDormant() and not player:IsTeamMate() and player:GetProp('m_iHealth') > 0 and player ~= lp then
                local can_hit

                local origin = player:GetProp('m_vecOrigin')
                local min = Vector_new()
                local max = Vector_new()
                local bounds = player:GetRenderBounds(min, max)
                local alpha_multiplier = player:GetESPAlpha() -- grab alpha of the dormant esp

                if player_info_prev[i] ~= nil and origin.x ~= 0 and alpha_multiplier > 0 then -- if origin / dormant esp is valid
                    -- update check
                    local dormant_accurate = alpha_multiplier > 0.1 -- for debug purposes lower this to 0.1

                    if dormant_accurate then
                        local target_points = {
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 28) or Vector_new(0, 0, 38)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 30) or Vector_new(0, 0, 40)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 32) or Vector_new(0, 0, 42)),
                            origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 40) or Vector_new(0, 0, 50))
                        }

                        for i = 1, #target_points do
                            local target = target_points[i]
                            --local target = origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector_new(0, 0, 30) or Vector_new(0, 0, 40))
                            local target_pos = calc_angle(eyepos, target)
                            local dmg = Cheat_FireBullet(lp, eyepos, target)

                            if is_AWP then
                                max_player_speed_alt = 100
                            elseif is_auto then
                                max_player_speed_alt = 120
                            else
                                max_player_speed_alt = is_scout and ent:GetMaxSpeed() * 0.8 or ent:GetMaxSpeed()
                            end
                            can_hit = (dmg.trace.hit_entity == nil or dmg.trace.hit_entity:EntIndex() == player:EntIndex()) and (dmg.damage > dormant_mindmg:GetInt()) and (not player:IsVisible(target)) -- added visibility check to mitigate shooting at anomalies?
                            if can_shoot and can_hit then
                                modify_velocity(cmd, (scoped and max_player_speed_alt or ent:GetMaxSpeed())*0.33)
                                dormant_flag = true
                                -- autoscope
                                if not scoped and ent:IsSniper() and onground == 1 then
                                    cmd.buttons = bit_bor(cmd.buttons, 2048)
                                end

                                if inaccuracy < 0.009 and ClientState.m_choked_commands == 0 then
                                    cmd.viewangles.pitch = target_pos.pitch
                                    cmd.viewangles.yaw = target_pos.yaw
                                    cmd.viewangles.roll = 0
                                    cmd.buttons = bit_bor(cmd.buttons, 1)
                                    dormant_flag = true
                                    -- dont shoot again
                                    can_shoot = false
                                end
                            elseif can_hit == false then
                                dormant_flag = false
                            end
                        end
                    end
                end
                player_info[i] = {origin, alpha_multiplier, can_hit}
            end
        end
        --::skip::
    end
    player_info_prev = player_info
end

end

function resetter(e)
if e:GetName() ~= 'round_prestart' then return end
local lp = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
if lp == nil then return end
local freezetime = (CVar_FindVar('mp_freezetime'):GetFloat()+1) / GlobalVars.interval_per_tick -- get freezetime plus 1 second and disable dormantbob for that amount of ticks
roundStarted = GlobalVars.tickcount + freezetime
origin = nil
for i = 1, 64 do
    player_info_prev[i] = {
        origin = Vector_new(0, 0, 0),
    }
end
frametimes = {}
player_info_prev = {}
player_info = {}
end

function normalize_yaw(yaww) while yaww > 180 do yaww = yaww - 360 end while yaww < -180 do yaww = yaww + 360 end return yaww end
function math_deg_atan(xdelta, ydelta)
    if xdelta == 0 and ydelta == 0 then
        return 0
    end
    return math_deg(math_atan2(ydelta, xdelta))
end
function nearest()
    function IsValid(ent)
        if ent == nil then
            return false
        else
            if ent:IsAlive() then
                return true
            else
                return false
            end
        end
    end
    if EngineClient_IsConnected() == nil or EngineClient_GetNetChannelInfo() == nil then return end
    local eyepos = EntityList_GetLocalPlayer():GetEyePosition()
    local viewangles = EngineClient_GetViewAngles()
    local bestenemy = nil
    local fov = 180
    for i=1, #EntityList_GetPlayers() do
        if(EntityList_GetPlayers()[i] ~= EntityList_GetLocalPlayer() and EntityList_GetPlayers()[i]:IsTeamMate() ~= true and IsValid(EntityList_GetPlayers()[i]) == true) then
            local cur = EntityList_GetPlayers()[i]:GetProp('m_vecOrigin')
            local cur_fov = math_abs(normalize_yaw(math_deg_atan(eyepos.x - cur.x, eyepos.y - cur.y) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = EntityList_GetPlayers()[i]
            end
        end
    end
    return bestenemy == nil and EntityList_GetLocalPlayer() or bestenemy
end

function override_limit(angle, isoverride)
    if roll_aa_active == true then return end
    if angle < 0 then
        if isoverride == true then AntiAim_OverrideInverter(true) end
        AntiAim_OverrideLimit(math_abs(angle))
        if anti_bruteforce_work_count+1 == 1 then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b1:Get() or yaw_add_l_b1:Get())
            ConVar.jitter:Set(jitter_b1:Get())
            ConVar.jitter_value:Set(jitter_value_b1:Get())
            ConVar.lby_mode:Set(lby_mode_b1:Get())
        elseif anti_bruteforce_work_count+1 == 2 and enable_b2:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b2:Get() or yaw_add_l_b2:Get())
            ConVar.jitter:Set(jitter_b2:Get())
            ConVar.jitter_value:Set(jitter_value_b2:Get())
            ConVar.lby_mode:Set(lby_mode_b2:Get())
        elseif anti_bruteforce_work_count+1 == 3 and enable_b3:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b3:Get() or yaw_add_l_b3:Get())
            ConVar.jitter:Set(jitter_b3:Get())
            ConVar.jitter_value:Set(jitter_value_b3:Get())
            ConVar.lby_mode:Set(lby_mode_b3:Get())
        elseif anti_bruteforce_work_count+1 == 4 and enable_b4:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b4:Get() or yaw_add_l_b4:Get())
            ConVar.jitter:Set(jitter_b4:Get())
            ConVar.jitter_value:Set(jitter_value_b4:Get())
            ConVar.lby_mode:Set(lby_mode_b4:Get())
        end
    elseif angle == 0 or angle > 0  then
        if isoverride == true then AntiAim_OverrideInverter(false) end
        AntiAim_OverrideLimit(angle)
        if anti_bruteforce_work_count+1 == 1 then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b1:Get() or yaw_add_l_b1:Get())
            ConVar.jitter:Set(jitter_b1:Get())
            ConVar.jitter_value:Set(jitter_value_b1:Get())
            ConVar.lby_mode:Set(lby_mode_b1:Get())
        elseif anti_bruteforce_work_count+1 == 2 and enable_b2:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b2:Get() or yaw_add_l_b2:Get())
            ConVar.jitter:Set(jitter_b2:Get())
            ConVar.jitter_value:Set(jitter_value_b2:Get())
            ConVar.lby_mode:Set(lby_mode_b2:Get())
        elseif anti_bruteforce_work_count+1 == 3 and enable_b3:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b3:Get() or yaw_add_l_b3:Get())
            ConVar.jitter:Set(jitter_b3:Get())
            ConVar.jitter_value:Set(jitter_value_b3:Get())
            ConVar.lby_mode:Set(lby_mode_b3:Get())
        elseif anti_bruteforce_work_count+1 == 4 and enable_b4:GetBool() then
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b4:Get() or yaw_add_l_b4:Get())
            ConVar.jitter:Set(jitter_b4:Get())
            ConVar.jitter_value:Set(jitter_value_b4:Get())
            ConVar.lby_mode:Set(lby_mode_b4:Get())
        end
    end
end

function vec_closest_point_on_ray(target, ray_start, ray_end)
    local to = target - ray_start
    local direction = ray_end - ray_start
    local ray_length = #direction

    direction.x = direction.x / ray_length
    direction.y = direction.y / ray_length
    direction.z = direction.z / ray_length

    local direction_along = direction.x * to.x + direction.y * to.y + direction.z * to.z
    if direction_along < 0 then return ray_start end
    if direction_along > ray_length then return ray_end end

    return Vector_new(ray_start.x + direction.x * direction_along, ray_start.y + direction.y * direction_along, ray_start.z + direction.z * direction_along)
end

anti_bruteforce_work.tick_work = 0
anti_bruteforce_work.distance = 0
function bullet_impact(eye_pos, eyepos, impact)
    if not enabled_antibrute:GetBool() and roll_aa_active == true then return end
    anti_bruteforce_work.distance = vec_closest_point_on_ray(eye_pos, eyepos, impact):DistTo(eye_pos)
    if anti_bruteforce_work.distance > 65 then return end
    anti_bruteforce_work.tick_work = GlobalVars.tickcount
end

function handle_brutforcetime()
    if not enabled_antibrute:GetBool() and roll_aa_active == true then return end

    for i, var in ipairs(anti_bruteforce_work.work_memory) do
        if i > 1 then
            table_remove(anti_bruteforce_work.work_memory,i)
        end
        anti_bruteforce_work.work = true
        anti_bruteforce_work.work_value = GlobalVars.realtime - var.time
        if anti_bruteforce_work.work_value > 4 then
            anti_bruteforce_work.work_value = 0
            anti_bruteforce_work.work = false
            table_remove(anti_bruteforce_work.work_memory, i)
        end
    end
end
anti_bruteforce_work_count = 0

local hitlogs = {}
function anti_bruteforcee(e)
    if e:GetName() ~= 'bullet_impact' then return end
    if anti_bruteforce_work.tick_work == GlobalVars.tickcount then return end
    if EngineClient_GetNetChannelInfo() == nil then return end
    if not EngineClient_IsConnected() then return end
    if not EntityList_GetLocalPlayer():IsAlive() then return end
    if not EntityList_GetPlayerForUserID(e:GetInt('userid')) then return end
    if not e:GetInt('userid') then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsAlive() == false then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsDormant() == true then return end
    if EntityList_GetPlayerForUserID(e:GetInt('userid')):IsTeamMate() == true then return end
    if roll_aa_active == true then return end
    if not enabled_antibrute:GetBool() then return end
    if enable_b2:GetBool() and not enable_b3:GetBool() and not enable_b4:GetBool() then
        stagesb = 1
    elseif enable_b3:GetBool() and enable_b2:GetBool() and not enable_b4:GetBool() then
        stagesb = 2
    elseif enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() then
        stagesb = 3
    else
        stagesb = 0
    end
    local impact = Vector_new(e:GetInt('x'), e:GetInt('y'), e:GetInt('z'))
    local eyepos = EntityList_GetPlayerForUserID(e:GetInt('userid')):GetEyePosition()
    local eye_pos = EntityList_GetLocalPlayer():GetEyePosition()

    local head_vec = bullet_impact(eye_pos, eyepos, impact)

    if anti_bruteforce_work.distance < 65 then
        anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count + 1
        --print(stagesb)
        if stagesb < anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count then
            anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = 0
        end
        anti_bruteforce_work_count = anti_bruteforce_work.memory[EntityList_GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count
        text = string_format('Switch due to shot [dst: %.0f]', anti_bruteforce_work.distance)

        print(text)
        table_insert(hitlogs, {text = text, time = GlobalVars.realtime})
        table_insert(anti_bruteforce_work.work_memory, 1, {time = GlobalVars.realtime})
    end
end

function C_BasePlayer:GetFlag(shift)
    return bit_band(self:GetProp('m_fFlags'), bit_lshift(1, shift)) ~= 0
end

function get_enemies()
    local enemies = {}

    for _, player in pairs(EntityList_GetPlayers()) do
        if (not player:IsTeamMate() and player:IsAlive()) then
            table_insert(enemies, player:GetPlayer())
        end
    end

    return enemies
end

function C_BasePlayer:CanHit()
    local trace_info = Cheat_FireBullet(self, self:GetEyePosition(), EntityList_GetLocalPlayer():GetEyePosition())

    if (trace_info.damage > 0 and ((trace_info.trace.hit_entity and trace_info.trace.hit_entity:GetPlayer() == EntityList_GetLocalPlayer()) or false)) then
        return true
    end

    return false
end

function teleport_in_air()
    if (auto_teleport_in_air:GetBool() and teleport_weapons:Get() ~= 0 and Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):Get()) then
        local allow_teleport = false
        local enable_teleport = false

        local active_weapon = EntityList_GetLocalPlayer():GetActiveWeapon()
        if active_weapon == nil then return end
        local weapon_id = active_weapon:GetWeaponID()

        local is_AWP = weapon_id == 9
        local is_auto = (weapon_id == 38 or weapon_id == 11)
        local is_scout = weapon_id == 40
        local is_deagle = weapon_id == 1
        local is_r8 = weapon_id == 64
        local is_nades = active_weapon:IsGrenade()
        local is_pistols = active_weapon:IsPistol() and not is_deagle and not is_r8
        local is_smg = (weapon_id == 34 or weapon_id == 23 or weapon_id == 24 or weapon_id == 19 or weapon_id == 26 or weapon_id == 33 or weapon_id == 17)
        local is_shotguns = (weapon_id == 35 or weapon_id == 25 or weapon_id == 27 or weapon_id == 29)
        local is_rifle = active_weapon:IsRifle() and not is_smg and not is_shotguns
        local is_taser = weapon_id == 31

        for _, weapons in pairs({
            {Value = 1, active_weapon = is_AWP},
            {Value = 2, active_weapon = is_auto},
            {Value = 3, active_weapon = is_scout},
            {Value = 4, active_weapon = is_deagle},
            {Value = 5, active_weapon = is_r8},
            {Value = 6, active_weapon = is_nades},
            {Value = 7, active_weapon = not (is_AWP or is_auto or is_scout or is_deagle or is_r8 or is_nades or is_pistols or is_rifle or is_smg or is_shotguns or is_taser)},
            {Value = 8, active_weapon = is_pistols},
            {Value = 9, active_weapon = is_rifle},
            {Value = 10, active_weapon = is_smg},
            {Value = 11, active_weapon = is_shotguns},
            {Value = 12, active_weapon = is_taser}
        }) do
        if (teleport_weapons:Get(weapons.Value) and weapons.active_weapon) then
            allow_teleport = true
        end
    end

    if (allow_teleport) then
        for _, enemy in pairs(get_enemies()) do
            if (not enemy:IsDormant() and enemy:CanHit()) then
                enable_teleport = true
            end
        end
    end

    if (enable_teleport and not EntityList_GetLocalPlayer():GetFlag(0) and EntityList_GetLocalPlayer():GetProp('m_vecVelocity'):Length2D() > 25) then
        Exploits_ForceTeleport()
    end
end
end


function ang_vector(ang)
local forward, right = Vector_new(), Vector_new()

local pitch, yaw, roll = ang.pitch * math_pi / 180, ang.yaw * math_pi / 180, ang.roll * math_pi / 180
local cp = math_cos(pitch)
local sp = math_sin(pitch)

local cy = math_cos(yaw)
local sy = math_sin(yaw)

local cr = math_cos(roll)
local sr = math_sin(roll)

forward.x = cp * cy
forward.y = cp * sy
forward.z = -sp

right.x = -1 * sr * sp * cy + -1 * cr * -sy
right.y = -1 * sr * sp * sy + -1 * cr * cy
right.z = -1 * sr * cp

return forward, right
end

actual_move = Vector2_new(0, 0)

function roll_move_fix(cmd)
local frL, riL = ang_vector(QAngle_new(0, cmd.viewangles.yaw, 0))
local frC, riC = ang_vector(cmd.viewangles)

frL.z = 0
riL.z = 0
frC.z = 0
riC.z = 0

frL = frL / Vector_new(0, 0, 0).Length(frL)
riL = riL / Vector_new(0, 0, 0).Length(riL)
frC = frC / Vector_new(0, 0, 0).Length(frC)
riC = riC / Vector_new(0, 0, 0).Length(riC)

local world_coord = frL * actual_move.x + riL * actual_move.y;

cmd.sidemove = (frC.x * world_coord.y - frC.y * world_coord.x) / (riC.y * frC.x - riC.x * frC.y)
cmd.forwardmove = (riC.y * world_coord.x - riC.x * world_coord.y) / (riC.y * frC.x - riC.x * frC.y)
end
stagesb = 0
function anti_aims(cmd)
local entity_get_local_player = EntityList_GetLocalPlayer()
if entity_get_local_player == nil then return end
local velocity = entity_get_local_player:GetProp('m_vecVelocity'):Length2D()
if velocity == nil then return end
local ground = bit_band(entity_get_local_player:GetProp('m_hGroundEntity'), 1)
if ground == nil then return end
local crouch = entity_get_local_player:GetProp('m_flDuckAmount')
if crouch == nil then return end
local weapon = entity_get_local_player:GetActiveWeapon()
if weapon == nil then return end
local tickcount = GlobalVars.tickcount % 4 > 1
if anti_bruteforce_work.work == false then
    if conditions:GetBool() and enable__aa:GetBool() then
        if Cheat_IsKeyDown(0x45) and override_on_use:GetBool() then
            local C4 = EntityList_GetEntitiesByClassID(129);
            for C4i = 1, #C4 do
                defuse = entity_get_local_player:GetRenderOrigin():DistTo(C4[C4i]:GetRenderOrigin()) < 100
            end
            local plant = entity_get_local_player:GetProp('m_bInBombZone')
            local host = entity_get_local_player:GetProp('m_bIsGrabbingHostage')


            local weapon_id = weapon:GetWeaponID()
            if weapon_id == nil then return end
            if defuse then
                check = true
            elseif weapon_id == 49 and plant == true then
                check = true
            elseif host == true then
                check = true
            else
                check = false
            end
            if check == false then
                if original_aa then pitch_cache = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Get() original_aa = false end
                state_aa = 'legit'
                Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Set(0)
                ConVar.yaw:Set(yaw_on_use:Get())
                ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[On_Use].yaw_add_r:Get() or types[On_Use].yaw_add_l:Get())
                if types[On_Use].jitter_mode:Get() == 1 then
                    ConVar.jitter:Set(math.random(1, 4))
                else
                    ConVar.jitter:Set(types[On_Use].jitter:Get())
                end

                ConVar.jitter_value:Set(math.random(types[On_Use].jitter_value_min:Get(), types[On_Use].jitter_value_max:Get()))
                ConVar.left_desync_value:Set((types[On_Use].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[On_Use].left_desync_value:Get()) or types[On_Use].left_desync_value:Get()))
                ConVar.right_desync_value:Set((types[On_Use].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[On_Use].right_desync_value:Get()) or types[On_Use].right_desync_value:Get()))
                ConVar.fake_option:Set(types[On_Use].fake_option:Get())
                ConVar.lby_mode:Set(types[On_Use].lby_mode:Get())
                ConVar.freestand_desync:Set(types[On_Use].freestand_desync:Get())
                ConVar.desync_on_shot:Set(types[On_Use].desync_on_shot:Get())
                ConVar.fakelag:Set(types[On_Use].fakelag:Get())
                ConVar.fakelag_value:Set(types[On_Use].fakelag_value:Get())
                ConVar.random_value:Set(types[On_Use].random_value:Get())
                if types[On_Use].mega_shit:Get() and not weapon:IsGrenade() then
                    cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                    roll_aa_active = true
                    if ConVar.yaw:Get() == 2 then
                        ConVar.yaw_add:Set(-15)
                        AntiAim_OverrideInverter(false)
                    elseif ConVar.yaw:Get() == 3 then
                        ConVar.yaw_add:Set(15)
                        AntiAim_OverrideInverter(true)
                    else
                        ConVar.yaw_add:Set(5)
                        AntiAim_OverrideInverter(false)
                    end
                    AntiAim_OverrideLimit(60)

                else
                    roll_aa_active = false
                end
                if Cheat_IsKeyDown(0x45) then E = false if GlobalVars.realtime > legitaa_time + 0.2 then if E == false then EngineClient_ExecuteClientCmd('+use') E = true end if E == true then EngineClient_ExecuteClientCmd('-use') end end else  if E == true then EngineClient_ExecuteClientCmd('-use') E = false end end
            end
        elseif (ConVar.yaw:Get() == 3 or ConVar.yaw:Get() == 2) and override_manual:GetBool() then
            state_aa = 'manual'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Manual].yaw_add_r:Get() or types[Manual].yaw_add_l:Get())
            if types[Manual].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Manual].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Manual].jitter_value_min:Get(), types[Manual].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Manual].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Manual].left_desync_value:Get()) or types[Manual].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Manual].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Manual].right_desync_value:Get()) or types[Manual].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Manual].fake_option:Get())
            ConVar.lby_mode:Set(types[Manual].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Manual].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Manual].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Manual].fakelag:Get())
            ConVar.fakelag_value:Set(types[Manual].fakelag_value:Get())
            ConVar.random_value:Set(types[Manual].random_value:Get())
            if types[Manual].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif ground == 1 and override_air:GetBool() then
            state_aa = 'air'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Air].yaw_add_r:Get() or types[Air].yaw_add_l:Get())
            if types[Air].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Air].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Air].jitter_value_min:Get(), types[Air].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Air].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Air].left_desync_value:Get()) or types[Air].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Air].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Air].right_desync_value:Get()) or types[Air].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Air].fake_option:Get())
            ConVar.lby_mode:Set(types[Air].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Air].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Air].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Air].fakelag:Get())
            ConVar.fakelag_value:Set(types[Air].fakelag_value:Get())
            ConVar.random_value:Set(types[Air].random_value:Get())
            if types[Air].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif (crouch >= 0.7) and override_crouch:GetBool() then
            state_aa = 'crouching'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Crouch].yaw_add_r:Get() or types[Crouch].yaw_add_l:Get())
            if types[Crouch].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Crouch].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Crouch].jitter_value_min:Get(), types[Crouch].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Crouch].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Crouch].left_desync_value:Get()) or types[Crouch].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Crouch].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Crouch].right_desync_value:Get()) or types[Crouch].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Crouch].fake_option:Get())
            ConVar.lby_mode:Set(types[Crouch].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Crouch].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Crouch].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Crouch].fakelag:Get())
            ConVar.fakelag_value:Set(types[Crouch].fakelag_value:Get())
            ConVar.random_value:Set(types[Crouch].random_value:Get())
        elseif ConVar.slowwalk:Get() and override_slowwalk:GetBool() then
            state_aa = 'slowwalking'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[SlowWalk].yaw_add_r:Get() or types[SlowWalk].yaw_add_l:Get())
            if types[SlowWalk].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[SlowWalk].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[SlowWalk].jitter_value_min:Get(), types[SlowWalk].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[SlowWalk].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[SlowWalk].left_desync_value:Get()) or types[SlowWalk].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[SlowWalk].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[SlowWalk].right_desync_value:Get()) or types[SlowWalk].right_desync_value:Get()))
            ConVar.fake_option:Set(types[SlowWalk].fake_option:Get())
            ConVar.lby_mode:Set(types[SlowWalk].lby_mode:Get())
            ConVar.freestand_desync:Set(types[SlowWalk].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[SlowWalk].desync_on_shot:Get())
            ConVar.fakelag:Set(types[SlowWalk].fakelag:Get())
            ConVar.fakelag_value:Set(types[SlowWalk].fakelag_value:Get())
            ConVar.random_value:Set(types[SlowWalk].random_value:Get())
            if types[SlowWalk].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif velocity > 5 and override_move:GetBool() then
            state_aa = 'moving'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Move].yaw_add_r:Get() or types[Move].yaw_add_l:Get())
            if types[Move].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Move].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Move].jitter_value_min:Get(), types[Move].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Move].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Move].left_desync_value:Get()) or types[Move].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Move].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Move].right_desync_value:Get()) or types[Move].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Move].fake_option:Get())
            ConVar.lby_mode:Set(types[Move].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Move].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Move].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Move].fakelag:Get())
            ConVar.fakelag_value:Set(types[Move].fakelag_value:Get())
            ConVar.random_value:Set(types[Move].random_value:Get())
            if types[Move].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        elseif (velocity <= 2 and crouch < 0.7) and override_stand:GetBool() then
            state_aa = 'standing'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Stay].yaw_add_r:Get() or types[Stay].yaw_add_l:Get())
            if types[Stay].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Stay].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Stay].jitter_value_min:Get(), types[Stay].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Stay].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Stay].left_desync_value:Get()) or types[Stay].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Stay].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Stay].right_desync_value:Get()) or types[Stay].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Stay].fake_option:Get())
            ConVar.lby_mode:Set(types[Stay].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Stay].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Stay].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Stay].fakelag:Get())
            ConVar.fakelag_value:Set(types[Stay].fakelag_value:Get())
            ConVar.random_value:Set(types[Stay].random_value:Get())
            if types[Stay].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        else
            state_aa = 'shared'
            ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[Shared].yaw_add_r:Get() or types[Shared].yaw_add_l:Get())
            if types[Shared].jitter_mode:Get() == 1 then
                ConVar.jitter:Set(math.random(1, 4))
            else
                ConVar.jitter:Set(types[Shared].jitter:Get())
            end
            ConVar.jitter_value:Set(math.random(types[Shared].jitter_value_min:Get(), types[Shared].jitter_value_max:Get()))
            ConVar.left_desync_value:Set((types[Shared].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Shared].left_desync_value:Get()) or types[Shared].left_desync_value:Get()))
            ConVar.right_desync_value:Set((types[Shared].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[Shared].right_desync_value:Get()) or types[Shared].right_desync_value:Get()))
            ConVar.fake_option:Set(types[Shared].fake_option:Get())
            ConVar.lby_mode:Set(types[Shared].lby_mode:Get())
            ConVar.freestand_desync:Set(types[Shared].freestand_desync:Get())
            ConVar.desync_on_shot:Set(types[Shared].desync_on_shot:Get())
            ConVar.fakelag:Set(types[Shared].fakelag:Get())
            ConVar.fakelag_value:Set(types[Shared].fakelag_value:Get())
            ConVar.random_value:Set(types[Shared].random_value:Get())
            if types[Shared].mega_shit:Get() and not weapon:IsGrenade() then
                cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
                roll_aa_active = true
                if ConVar.yaw:Get() == 2 then
                    ConVar.yaw_add:Set(-15)
                    AntiAim_OverrideInverter(false)
                elseif ConVar.yaw:Get() == 3 then
                    ConVar.yaw_add:Set(15)
                    AntiAim_OverrideInverter(true)
                else
                    ConVar.yaw_add:Set(5)
                    AntiAim_OverrideInverter(false)
                end
                AntiAim_OverrideLimit(60)
            else
                roll_aa_active = false
            end
        end
    elseif not conditions:GetBool() and anti_bruteforce_work.work == false and enable__aa:GetBool() then
        state_aa = 'off'
        ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and types[anti_aim_preset].yaw_add_r:Get() or types[anti_aim_preset].yaw_add_l:Get())
        if types[anti_aim_preset].jitter_mode:Get() == 1 then
            ConVar.jitter:Set(math.random(1, 4))
        else
            ConVar.jitter:Set(types[anti_aim_preset].jitter:Get())
        end
        ConVar.jitter_value:Set(math.random(types[anti_aim_preset].jitter_value_min:Get(), types[anti_aim_preset].jitter_value_max:Get()))
        ConVar.left_desync_value:Set((types[anti_aim_preset].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[anti_aim_preset].left_desync_value:Get()) or types[anti_aim_preset].left_desync_value:Get()))
        ConVar.right_desync_value:Set((types[anti_aim_preset].fake_limit_type:Get() ~= 0 and (tickcount and 18 or types[anti_aim_preset].right_desync_value:Get()) or types[anti_aim_preset].right_desync_value:Get()))
        ConVar.fake_option:Set(types[anti_aim_preset].fake_option:Get())
        ConVar.lby_mode:Set(types[anti_aim_preset].lby_mode:Get())
        ConVar.freestand_desync:Set(types[anti_aim_preset].freestand_desync:Get())
        ConVar.desync_on_shot:Set(types[anti_aim_preset].desync_on_shot:Get())
        ConVar.fakelag:Set(types[anti_aim_preset].fakelag:Get())
        ConVar.fakelag_value:Set(types[anti_aim_preset].fakelag_value:Get())
        ConVar.random_value:Set(types[anti_aim_preset].random_value:Get())
        if types[anti_aim_preset].mega_shit:Get() and not weapon:IsGrenade() then
            cmd.viewangles.roll = AntiAim_GetInverterState() and 50 or -50
            roll_aa_active = true
            if ConVar.yaw:Get() == 2 then
                ConVar.yaw_add:Set(-15)
                AntiAim_OverrideInverter(false)
            elseif ConVar.yaw:Get() == 3 then
                ConVar.yaw_add:Set(15)
                AntiAim_OverrideInverter(true)
            else
                ConVar.yaw_add:Set(5)
                AntiAim_OverrideInverter(false)
            end
            AntiAim_OverrideLimit(60)
        else
            roll_aa_active = false
        end
    end
elseif anti_bruteforce_work.work == true and  enabled_antibrute:GetBool() then

    local phase = {
        [0] = phase1,
        [1] = phase2,
        [2] = phase3,
        [3] = phase4
    }
    override_limit(phase[anti_bruteforce_work.memory[nearest():EntIndex()].count]:Get(),true)

    --ConVar.yaw_add:Set(AntiAim_GetInverterState() == false and yaw_add_r_b:Get() or yaw_add_l_b:Get())
    --ConVar.jitter:Set(jitter_b:Get())
    --ConVar.jitter_value:Set(jitter_value_b:Get())
    --ConVar.lby_mode:Set(lby_mode_b:Get())
    --yaw_add_l_b
    --yaw_add_r_b
    --jitter_b
    --jitter_value_b
    --lby_mode_b

end
if manual_yaw_base:Get() ~= 0 and not (Cheat_IsKeyDown(0x45) and override_on_use:GetBool()) then ConVar.yaw:Set(manual_yaw_base:Get() - 1) end
if not Cheat_IsKeyDown(0x45) then legitaa_time = GlobalVars.realtime if not original_aa then Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'):Set(pitch_cache) original_aa = true end end
if avoid_backstab:GetBool() then
    all_players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #all_players do
        enemy = all_players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and not enemy:IsDormant() and enemy:IsAlive() and enemy:GetActiveWeapon() ~= nil and enemy:GetActiveWeapon():IsKnife() then
            enemy_origin = enemy:GetProp('m_vecOrigin')
            if 300 >= EntityList_GetLocalPlayer():GetRenderOrigin():DistTo(enemy:GetProp('m_vecOrigin')) then
                AntiAim_OverrideYawOffset(180)
            end
        end
    end
end

end


baim_hitboxes = {2,3,4}

function extrapolate_position(xpos,ypos,zpos,ticks,player)
    local x,y,z = player:GetProp('m_vecVelocity').x, player:GetProp('m_vecVelocity').y, player:GetProp('m_vecVelocity').z
    for i = 0, ticks do
        xpos =  xpos + (x * GlobalVars.interval_per_tick)
        ypos =  ypos + (y * GlobalVars.interval_per_tick)
        zpos =  zpos + (z * GlobalVars.interval_per_tick)
    end
    return xpos,ypos,zpos
end

lethalplayer = false

function is_baimable(ent, localplayer)  
    local final_damage = 0

    local eyepos = EntityList_GetLocalPlayer():GetEyePosition()
    local fs_stored_eyepos

    eyepos_x = extrapolate_position(eyepos.x, eyepos.y, eyepos.z, 20, localplayer)

    fs_stored_eyepos = eyepos

    for k,v in pairs(baim_hitboxes) do
        local hitbox = ent:GetHitboxCenter(v)

        local dmg = Cheat_FireBullet(localplayer, fs_stored_eyepos, Vector_new(hitbox.x, hitbox.y, hitbox.z)).damage
       
        if ( dmg > final_damage) then
            final_damage = dmg
        end
    end
   
    return final_damage
end

function proper_baim_lethal()
    local me = EntityList_GetLocalPlayer()
    local weapon = me:GetActiveWeapon()
    if weapon == nil or weapon:IsKnife() or weapon:IsGrenade() then
        lethalplayer = false
        return
    end
   
    all_players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #all_players do
        enemy = all_players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and enemy:IsAlive() and not enemy:IsDormant() then
            local enemy_index = enemy:EntIndex()
            if enemy_index == nil then return end
            local target_health = enemy:GetProp('m_iHealth')
            local is_lethal = is_baimable(enemy, me) >= target_health
            if target_health <= 0 then return end

            if is_lethal then
                lethalplayer = true
               
                RageBot.EnableHitbox(enemy_index, 0, false)
                RageBot.EnableHitbox(enemy_index, 1, false)
                for i=5, 18 do
                    RageBot.ForceHitboxSafety(enemy_index, 2)
                    RageBot.ForceHitboxSafety(enemy_index, 4)
                    RageBot.SetHitboxPriority(enemy_index, 3, 100)
                    RageBot.EnableHitbox(enemy_index, 2, true)
                    RageBot.EnableHitbox(enemy_index, 3, true)
                    RageBot.EnableHitbox(enemy_index, 4, true)
                    RageBot.EnableHitbox(enemy_index, i, false)
                   
                end
            else
                lethalplayer = false
            end
        else
            lethalplayer = false
        end
    end
end
ESP.CustomText('Proper Body Aim if Lethal', 'enemies', 'BAIM', function(ent)
    if not EntityList_GetLocalPlayer() or ent == nil then return end
    local target_health = ent:GetProp('m_iHealth')
    if target_health == nil or EntityList_GetLocalPlayer():GetActiveWeapon() == nil or EntityList_GetLocalPlayer():GetActiveWeapon():GetWeaponDamage() == nil then return end
    is_lethal = EntityList_GetLocalPlayer():GetActiveWeapon():GetWeaponDamage() >= target_health
    if lethalplayer and is_lethal then
        return 'BAIM'
    else
        return false
    end
end)
local original_aaa = true
local legitaa_timea = GlobalVars.realtime
function ideal_peek()
if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() then
    if original_aaa then
        yaw_base_cache = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Get()
        original_aaa = false
    end
    Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Set(5)
elseif Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() and (manual_yaw_base:Get() == 4 or manual_yaw_base:Get() == 5) then
    if not original_aaa then
        Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Set(yaw_base_cache)
        original_aaa = true
    end
    legitaa_timea = GlobalVars.realtime
end
end
local pixel9 = Render_InitFont('nl\alien\fonts\small_pixel.ttf', 9)
local verdanabd11 = Render_InitFont('Verdana', 11, {'b'})
local verdana11_r = Render_InitFont('verdana', 11, {'r'})
local verdana12 = Render_InitFont('verdana', 12)
local verdana23 = Render_InitFont('verdana', 20, {'b'})
local lucida_console = Render_InitFont('lucida console', 10, {'r'})
local arrows = Render_InitFont('nl\alien\fonts\arrows.ttf', 14)
local arrows18 = Render_InitFont('nl\alien\fonts\arrows.ttf', 20)
local dt_circle = 0

function update_enemies()
    local localplayer = EntityList_GetClientEntity(EngineClient_GetLocalPlayer())
    if not localplayer then return end

    local my_index = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not my_index then return end

    if EngineClient_IsConnected() and my_index:IsAlive() then
        local players = EntityList_GetEntitiesByName('CCSPlayer')
        local fov_enemy, maximum_fov = nil, 180
     
        for i = 1, #players do
            local enemy = players[i]:GetPlayer()
            if enemy ~= my_index and not enemy:IsTeamMate() and enemy:IsAlive() then
                local my_origin = my_index:GetRenderOrigin()
                local enemy_origin = enemy:GetRenderOrigin()

                local world_to_screen = (my_origin.x - enemy_origin.x == 0 and my_origin.y - enemy_origin.z == 0) and 0 or math_deg(math_atan2( my_origin.y - enemy_origin.y, my_origin.x - enemy_origin.x)) - EngineClient_GetViewAngles().yaw + 180

                local calculated_fov = math_abs(normalize_yaw(world_to_screen))
                if not fov_enemy or calculated_fov <= maximum_fov then
                    fov_enemy = enemy
                    maximum_fov = calculated_fov
                end
            end
        end

        return ({enemy = fov_enemy, fov = maximum_fov})
    end
end
function deg2rad(x)
return x * (math.pi / 180.0)
end

function Render_pd_Indicator(text, y2, y1, color, size, font, outline)
local textsize = Render_CalcTextSize(text, size, font)
Render_Text(text, Vector2_new(screen_size.x/2-textsize.x/2-y1, screen_size.y/2+y2), color, size, font, outline)
end
cock1 = false
cock = false
local function render_text(text, pos, color, size, text_font, outline, align)
local text_size = Render.CalcTextSize(text, size, text_font)
if outline == 1 then
    cock = true
    cock1 = false
elseif outline == 2 then
    cock1 = true
    cock = false
else
    cock1 = false
    cock = false
end
if align == 0 then -- To the left
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x+1 - text_size.x, pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, Vector2.new(pos.x - text_size.x, pos.y), color, size, text_font, cock)
elseif align == 1 then -- To the center
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x + 1 - (text_size.x / 2), pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, Vector2.new(pos.x - (text_size.x / 2), pos.y), color, size, text_font, cock)
elseif align == 2 then -- To the right
    if cock1 == true then
        Render.Text(text, Vector2.new(pos.x + 1, pos.y+1), Color_new(0,0,0,0.4), size, text_font, cock)
    end
    Render.Text(text, pos, color, size, text_font, cock)
end
end

function lerp(a, b, t)
return a + (b - a) * t
end

function angle_to_vec(pitch, yaw)
    local p = pitch / 180 * math_pi
    local y = yaw / 180 * math_pi

    local sin_p = math_sin(p)
    local cos_p = math_cos(p)
    local sin_y = math_sin(y)
    local cos_y = math_cos(y)

    return {cos_p * cos_y, cos_p * sin_y, -sin_p}
end

function calculate_angles(local_x, local_y, enemy_x, enemy_y)
    local delta_y = local_y - enemy_y
    local delta_x = local_x - enemy_x

    local relative_yaw = math.atan(delta_y / delta_x)
    relative_yaw = normalize_yaw(relative_yaw * 180 / math_pi)

    if delta_x >= 0 then
        relative_yaw = normalize_yaw(relative_yaw + 180)
    end

    return relative_yaw
end

function deg2rad(x)
    return x * (math_pi / 180.0)
end

function get_hit_side()
    local local_player = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not local_player then return end

    if EngineClient_IsConnected() and local_player:IsAlive() then
        local data, current_enemy = update_enemies(), nil
        if data ~= nil then
            current_enemy = data.enemy
        end
     
        if current_enemy ~= nil and current_enemy:IsAlive() then
            local predict_damage = function(x, y, z)
                local a, b, c = {}, {}, {}
                local enemy_head_position = current_enemy:GetHitboxCenter(1)
                local ticks = 40

                a[1], b[1], c[1] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z
                a[2], b[2], c[2] = enemy_head_position.x + ticks, enemy_head_position.y, enemy_head_position.z
                a[3], b[3], c[3] = enemy_head_position.x - ticks, enemy_head_position.y, enemy_head_position.z
             
                a[4], b[4], c[4] = enemy_head_position.x, enemy_head_position.y + ticks, enemy_head_position.z
                a[5], b[5], c[5] = enemy_head_position.x, enemy_head_position.y - ticks, enemy_head_position.z

                a[6], b[6], c[6] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z + ticks
                a[7], b[7], c[7] = enemy_head_position.x, enemy_head_position.y, enemy_head_position.z - ticks

                for i = 1, 7, 1 do
                    local damage = 0
                    local trace_damage = Cheat_FireBullet(current_enemy, Vector_new(a[i], b[i], c[i]), Vector_new(x, y, z)).damage
         
                    if trace_damage > damage then
                        damage = trace_damage
                    end
         
                    return damage
                end
            end

            local my_eye_position = local_player:GetEyePosition()
            local enemy_head_position = current_enemy:GetHitboxCenter(0)
            local calculated_yaw = calculate_angles(my_eye_position.x, my_eye_position.y, enemy_head_position.x, enemy_head_position.y)

            local left_direction_x, left_direction_y = angle_to_vec(0, (calculated_yaw + 90)), angle_to_vec(0, (calculated_yaw + 90))

            local right_direction_x, right_direction_y = angle_to_vec(0, (calculated_yaw - 90)), angle_to_vec(0, (calculated_yaw - 90))
         
            local rend_x = my_eye_position.x + right_direction_x[1] * 10
            local rend_y = my_eye_position.y + right_direction_y[1] * 10

            local lend_x = my_eye_position.x + left_direction_x[1] * 10
            local lend_y = my_eye_position.y + left_direction_y[1] * 10

            local rend_x_2 = my_eye_position.x + right_direction_x[1] * 100
            local rend_y_2 = my_eye_position.y + left_direction_y[1] * 100

            local lend_x_2 = my_eye_position.x + left_direction_x[1] * 100
            local lend_y_2 = my_eye_position.y + left_direction_y[1] * 100
         
            local left_trace = predict_damage(rend_x, rend_y, my_eye_position.z)
            local right_trace = predict_damage(lend_x, lend_y, my_eye_position.z)
            local left_trace_2 = predict_damage(rend_x_2, rend_y_2, my_eye_position.z)
            local right_trace_2 = predict_damage(lend_x_2, lend_y_2, my_eye_position.z)

            local hit_side = ((left_trace > 0 or right_trace > 0 or left_trace_2 > 0 or right_trace_2 > 0) and (left_trace > right_trace and 0.5 or right_trace > left_trace and -0.5 or left_trace_2 > right_trace_2 and 1 or right_trace_2 > left_trace_2 -1) or 0.0)

            return hit_side
        end
    end
end
function is_defensive()
    local state, shifting = false, 0
    local local_player = EntityList_GetClientEntity(EngineClient_GetLocalPlayer()):GetPlayer()
    if not local_player then return end
    if Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):GetBool() then
        local hit_side = get_hit_side()
        if hit_side == true or hit_side == false then
            hit_side = 0
            state = false
            shifting = nil
        end

        if hit_side ~= nil then
            if hit_side > 0 then
                state = true

                local tickbase = local_player:GetProp('m_nTickBase')
                local next_attack = local_player:GetProp('m_flNextAttack')
                local next_primary_attack = local_player:GetActiveWeapon():GetProp('m_flNextPrimaryAttack')

                local ticks = GlobalVars.interval_per_tick * (tickbase - 16)
                local shifting_tickbase = (ticks - next_primary_attack) * 2

                if shifting_tickbase <= 3 then shifting_tickbase = shifting_tickbase + (next_attack * 0.001) * 2 end

                if shifting_tickbase >= 17 then shifting_tickbase = 17 end
                shifting_tickbase = math_floor(shifting_tickbase)

                shifting = shifting_tickbase
            else
                state = false
                shifting = nil
            end
        else
            state = false
            shifting = nil
        end
    else
        state = false
        shifting = nil
    end

    return ({
        state = state,
        value = shifting
    })
end
function math_lerp(time,a,b)
return a * (1-time) + b * time
end
local pixel7 = Render.InitFont('Smallest Pixel-7', 10)
bar_antibrute = 0
prediction_anim = 0
cur_dmg = 0
verdana25 = Render_InitFont('verdana', 25)
tahoma_bold13 = Render_InitFont('tahoma', 13, {'b'})
a_width = 0
function get_dormant_enemy()
    local ret = {}

    local players = EntityList_GetEntitiesByName('CCSPlayer')
    for i = 1, #players do
        local enemy = players[i]:GetPlayer()
        if enemy ~= EntityList_GetLocalPlayer() and not enemy:IsTeamMate() and enemy:IsAlive() then
            if enemy:IsDormant() then
                table_insert(ret, enemy)
            end
        end
    end
                         
    return #ret
end
function indicators()
if not EngineClient_IsConnected() or not EntityList_GetLocalPlayer():IsAlive() then return end
local velocity = Vector_new(EntityList_GetLocalPlayer():GetProp('m_vecVelocity[0]'), EntityList_GetLocalPlayer():GetProp('m_vecVelocity[1]'), EntityList_GetLocalPlayer():GetProp('m_vecVelocity[2]'))
if velocity == nil then return end
local isDoubletap = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'):GetBool()
local isPeek = Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool()
local isHideshots = Menu_FindVar('Aimbot', 'Ragebot', 'Exploits', 'Hide Shots'):GetBool()
local isSafe = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Safe Points'):Get() == 2
local isBody = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Body Aim'):Get() == 2
local yaw_base = Menu_FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'):Get()
local isDuck = Menu_FindVar('Aimbot', 'Anti Aim', 'Misc', 'Fake Duck'):GetBool()
local crouch = EntityList_GetLocalPlayer():GetProp('m_flDuckAmount')
if crouch == nil then return end
local ground = bit_band(EntityList_GetLocalPlayer():GetProp('m_fFlags'), bit_lshift(1,0)) == 0
if ground == nil then return end
if dmg_type == 1 or dmg_type == 2 then
    cur_dmg = prsd_damage
else
    cur_dmg = Menu_FindVar('Aimbot', 'Ragebot', 'Accuracy', 'Minimum Damage'):GetInt()
    if cur_dmg == 0 then cur_dmg = 'auto' elseif cur_dmg > 100 then cur_dmg = '+'..cur_dmg-100 end
end
if cur_dmg == nil then return end
local isDmg = false
local isPing = false
local binds = Cheat_GetBinds()
for i = 1, #binds do
    local bind = binds[i]

    if bind:GetName() == 'Minimum Damage' and bind:IsActive() then
        isDmg = true
    end
    if bind:GetName() == 'Fake Ping' and bind:IsActive() then
        isPing = true
    end
end
local frames = GlobalVars.frametime*20
bar_antibrute = math_lerp(GlobalVars.frametime*20,bar_antibrute, (anti_bruteforce_work.work == true) and 1 or 0)
if indicators_style:GetBool(1) then
    add_y = 20

    add_y = add_y + 4
    if indicators_add:GetBool(3) then
        Render_PolyFilled(AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), Vector2_new(screen_size.x/2 + 30 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)), screen_size.y/2 + (30 * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)))), Vector2_new(screen_size.x/2 + 40 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1)), screen_size.y/2 + (40) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1))), Vector2_new(screen_size.x/2 + 26 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1) - math_rad(20)), screen_size.y/2 + (26) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) - 1) - math_rad(20))));
        Render_PolyFilled(AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Vector2_new(screen_size.x/2 + (30 * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1))), screen_size.y/2 + (30 * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1)))), Vector2_new(screen_size.x/2 + (40) * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1)), screen_size.y/2 + (40) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1))), Vector2_new(screen_size.x/2 + (26) * math_sin(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1) + math_rad(20)), screen_size.y/2 + (26) * math_cos(math_rad(normalize_yaw(AntiAim.GetCurrentRealRotation() - EngineClient.GetViewAngles().yaw - 180) + 1) + math_rad(20))));
        add_y = add_y + 25
    end
    if indicators_add:GetBool(1) then
        add_y = add_y + 9
        local alpha = math_sin(math_abs(-math_pi + GlobalVars.realtime * 1 % (math_pi * 2.0)))


        --Render_pd_Indicator('beta', add_y-17, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, alpha), 9, pixel9, true)

        Render_pd_Indicator('alien.lua°', add_y-11, -1, Color_new(0, 0, 0, 0.5), 11, verdanabd11, false)
        Render_pd_Indicator('alien', add_y-11, 13, AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 11, verdanabd11, false)
        Render_pd_Indicator('.lua°', add_y-11, -13, AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 11, verdanabd11, false)

    end

    --bar_antibrute*8
    if roll_aa_active == true then
        state = '/roll/'
    elseif ground then
        state = '/aerobic/'
    elseif crouch >= 1 then
        state = '/crouch/'
    elseif isSlow then
        state = '/slowwalk/'
    elseif velocity:Length2D() > 5 then
        state = '/running/'
    else
        state = '/standing/'
    end

    if indicators_add:GetBool(2) then
        if anti_bruteforce_work.work then
            Render_BoxFilled(Vector2_new(screen_size.x/2-26, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+3+add_y+3), Color_new(0, 0, 0, bar_antibrute/1.2))
            Render_BoxFilled(Vector2_new(screen_size.x/2-26 + 1, screen_size.y/2+2+add_y+2), Vector2_new(screen_size.x/2 + math_min((3.5 - anti_bruteforce_work.work_value / 0.569) * 7.2, 26), screen_size.y/2+3+add_y+2), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, bar_antibrute))
        else
            Render_GradientBoxFilled(Vector2_new(screen_size.x/2+25, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+6+add_y+1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0))
            Render_GradientBoxFilled(Vector2_new(screen_size.x/2-25, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2-26, screen_size.y/2+6+add_y+1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 0))
            Render_BoxFilled(Vector2_new(screen_size.x/2, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2+26, screen_size.y/2+3+add_y+1), AntiAim_GetInverterState() and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1))
            Render_BoxFilled(Vector2_new(screen_size.x/2, screen_size.y/2+2+add_y+1), Vector2_new(screen_size.x/2-26, screen_size.y/2+3+add_y+1), AntiAim_GetInverterState() and Color_new(1, 1, 1, 1) or Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
        end
        add_y = add_y + 6
    end

    if indicators_add:GetBool(4) then
        Render_pd_Indicator(state, bar_antibrute*1 + add_y, 0, Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(5) and isDoubletap then
        dt_circle = math_lerp(frames/2, dt_circle, Exploits_GetCharge())
        Render_pd_Indicator('dt', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, math_max(0.2, dt_circle)), 9, pixel9, true)
        Render_Circle(Vector2_new(screen_size.x / 2 + 10, screen_size.y / 2 + 5 + bar_antibrute*1 + add_y), 3.6, 32, Color_new(0, 0, 0, math_max(0.2, dt_circle)), 3)
        Render_Circle(Vector2_new(screen_size.x / 2 + 10, screen_size.y / 2 + 5 + bar_antibrute*1 + add_y), 3.6, 32, Color_new(1, 1, 1, math_max(0.2, dt_circle)), 2, -180, -180 + 360 *dt_circle)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(6) and isHideshots then
        Render_pd_Indicator('os', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(7) and isDmg then
        Render_pd_Indicator('dmg', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(8) and isBody then
        Render_pd_Indicator('body', bar_antibrute*1 + add_y, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(9) and isSafe then
        Render_pd_Indicator('safe', bar_antibrute*1 + add_y, 0, isSafe and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(10) and yaw_base == 5 then
        Render_pd_Indicator('fs', bar_antibrute*1 + add_y, 0, yaw_base == 5 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 9, pixel9, true)
        add_y = add_y + 9
    end
    if indicators_add:GetBool(11) and isPeek and isDoubletap and Exploits_GetCharge() ~= 1.0 then
        Render_pd_Indicator('+CHARGED IDEAL TICK+', -26, 0, Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 9, pixel9, true)
        add_y = add_y + 9
    end

end
if indicators_style:GetBool(2) then
    local acatel_style_2 = "-"
    if AntiAim_GetInverterState() then
        acatel_style_2 = "LEFT"
    else
        acatel_style_2 = "RIGHT"
    end
    local ind_dst = 0
    render_text('ALIEN', Vector2.new(screen_size.x/2, screen_size.y/2 + 30), Color.new(1, 1, 1, 1), 10, pixel7, 1, 2)
    render_text('BETA', Vector2.new(screen_size.x/2 + Render.CalcTextSize("ALIEN", 10, pixel7).x, screen_size.y/2 + 30), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, (math.floor(math.sin(GlobalVars.curtime * 2) * 220 + 221)) / 1000 * 6.92), 10, pixel7, 1, 2)
    --

    render_text("SMART:", Vector2.new(screen_size.x/2, screen_size.y/2 + 38.5), Color.RGBA(220, 91, 97, 255), 10, pixel7, 1, 2)
    render_text(acatel_style_2, Vector2.new(screen_size.x/2 + 29, screen_size.y/2 + 38.5), Color.RGBA(138, 137, 204, 255), 10, pixel7, 1, 2)
    --
    if isDoubletap then
        if Exploits_GetCharge() <= 0 then dt_color = Color.RGBA(255, 0, 0, 255) else dt_color = Color.RGBA(0, 255, 0, 255) end
    else
        dt_color = Color.new(0.3, 0.3, 0.3, 1)
    end
    --
    render_text("DT", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + ind_dst), dt_color, 10, pixel7, 1, 2)
    render_text("HS", Vector2.new(screen_size.x/2 + 11, screen_size.y/2 + 46 + ind_dst), isHideshots and Color_new(1, 1, 1, 1) or Color_new(0.3, 0.3, 0.3, 1), 10, pixel7, 1, 2)
    render_text("FS", Vector2.new(screen_size.x/2 + 23, screen_size.y/2 + 46 + ind_dst), yaw_base == 5 and Color.new(1, 1, 1, 1) or Color.new(0.3, 0.3, 0.3, 1), 10, pixel7, 1, 2)
    render_text("M:B", Vector2.new(screen_size.x/2 + 35, screen_size.y/2 + 46 + ind_dst), Color.new(1,1,1,1), 10, pixel7, 1, 2)
end
if indicators_style:GetBool(3) then
    add_y = 0

    if isPing then
        render_text("ping-spike", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 12, verdana12, 2, 1)
        textb = "ping-spike"
        add_y = add_y + 9
    end

    if isDuck then
        render_text("fake-duck", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, crouch), 12, verdana12, 2, 1)
        textb = "fake-duck"
        add_y = add_y + 9
    end

    if isHideshots then
        render_text("on-shot aa", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 12, verdana12, 2, 1)
        textb = "on-shot aa"
        add_y = add_y + 9
    end

    if isDoubletap then
        render_text("double-tap", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Exploits_GetCharge() == 1 and Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(0.4, 0.4, 0.4, 1), 12, verdana12, 2, 1)
        textb = "double-tap"
        add_y = add_y + 9
    end

    if isDmg then
        render_text("damage: "..cur_dmg, Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        textb = "damage: "..cur_dmg
        add_y = add_y + 9
    end

    if yaw_base == 5 then
        render_text("freestanding", Vector2.new(screen_size.x/2, screen_size.y/2 + 46 + add_y), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        textb = "freestanding"
        add_y = add_y + 9
    end

    if isDoubletap or isHideshots or yaw_base == 5 or isDmg or isPing or isDuck then
        text_sizeb = Render.CalcTextSize(textb, 12, verdana12)
        render_text("alien.lua", Vector2.new(screen_size.x/2, screen_size.y/2 + 28), Color.new(1, 1, 1, 1), 12, verdana12, 2, 1)
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(0, 0, 0, 0.3), Color.new(0, 0, 0, 0.3), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
        Render.BoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+43), Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+44), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 - 5 - text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 - 4 - text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2 + 5 + text_sizeb.x/2, screen_size.y/2+44), Vector2.new(screen_size.x/2 + 4 + text_sizeb.x/2, screen_size.y/2+52+add_y), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), Color.new(0, 0, 0, 0), Color.new(0, 0, 0, 0))
    end
end
if indicators_style:GetBool(4) then
    render_text('alien.lua', Vector2.new(screen_size.x/2, screen_size.y/2 + 32 ), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 10, pixel7, 1, 1)
    ind_dst = 0
    local aa_status = "STANDING"
    if ground then
        aa_status = "AIR"
    elseif crouch > 0.8 then
        aa_status = "CROUCHING"
    elseif isSlow then
        aa_status = "SLOWWALK"
    else
        aa_status = "STANDING"
    end
    render_text(aa_status, Vector2.new(screen_size.x/2, screen_size.y/2 + 40), Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 10, pixel7, 1, 1)

    if isDoubletap then
        if Exploits_GetCharge() <= 0 then dt_color = Color.new(0.5, 0.5, 0.5, 1) else dt_color = Color.RGBA(0, 255, 0, 255) end
    else
        dt_color = Color.new(0.5, 0.5, 0.5, 1)
    end
    render_text("DT", Vector2.new(screen_size.x/2 - 8, screen_size.y/2 + 48), dt_color, 10, pixel7, 1, 0)

    if yaw_base == 5 then arctic_fs =  Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) else arctic_fs = Color.new(0.5, 0.5, 0.5, 1) end
    render_text("FS", Vector2.new(screen_size.x/2, screen_size.y/2 + 48 + ind_dst), arctic_fs, 10, pixel7, 1, 1)

    if isHideshots then arctic_hs =  Color.new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) else arctic_hs = Color.new(0.5, 0.5, 0.5, 1) end
    render_text("HS", Vector2.new(screen_size.x/2 + 8, screen_size.y/2 + 48), arctic_hs, 10, pixel7, 1, 2)
end
if indicators_style:GetBool(5) then
    add_y = 30
    local alpha = math_floor(math_sin(math_abs(-math_pi + (GlobalVars.curtime * (1.25 / .75)) % (math_pi * 2))) * 200)
    Render_Text('alien', Vector2_new(screen_size.x/2, screen_size.y/2+add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    Render_Text('lua', Vector2_new(screen_size.x / 2 + 27, screen_size.y / 2 + add_y), Color_RGBA(200, 200, 200, alpha), 9, pixel9, true)
    add_y = add_y + 9
    --get_dormant_enemy
    local data, current_enemy = update_enemies(), nil
    if data ~= nil then
        current_enemy = data.enemy
    end
    if roll_aa_active then
        Render_Text('EXPLOITING:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

        Render_Text('z°', Vector2_new(screen_size.x / 2 + 50, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    elseif anti_bruteforce_work.work then
        Render_Text('ANTI ', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

        local counter = anti_bruteforce_work_count
        local side = AntiAim_GetInverterState() and 1 or -1
        local timer = math_floor(anti_bruteforce_work.work_value * 25.1)

        Render_Text(('BRUTEFORCE[%s][%s][%s%%]'):format(counter, side, timer), Vector2_new(screen_size.x / 2 + 21, screen_size.y / 2 + add_y),Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    else
        if is_defensive().state then
            if is_defensive().value ~= nil then
                Render_Text('DEFENSIVE:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)

                Render_Text(('%s'):format(is_defensive().value), Vector2_new(screen_size.x / 2 + 47, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
            end
        else
            Render_Text('BODY', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(197, 122, 108, 255), 9, pixel9, true)

            Render_Text(' YAW: ', Vector2_new(screen_size.x / 2 + 16, screen_size.y / 2 + add_y), Color_RGBA(197, 122, 108, 255), 9, pixel9, true)

            Render_Text(AntiAim_GetInverterState() and 'R' or 'L', Vector2_new(screen_size.x / 2 + 40, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
        end
    end
    add_y = add_y + 9
    Render_Text('DORMANCY:', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 201, 132, 255), 9, pixel9, true)
    Render_Text(('%s'):format(get_dormant_enemy()), Vector2_new(screen_size.x / 2 + 45, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    if isDoubletap then
        add_y = add_y + 9
        Render_Text('DT', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Exploits_GetCharge() == 1 and Color_RGBA(133, 235, 89, 255) or Color_RGBA(244, 11, 12, 255), 9, pixel9, true)
    end
    if isHideshots then
        add_y = add_y + 9
        Render_Text('HS', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 211, 168, 255), 9, pixel9, true)
    end
    if isDmg then
        add_y = add_y + 9
        Render_Text('DMG', Vector2_new(screen_size.x / 2, screen_size.y / 2 + add_y), Color_RGBA(255, 255, 255, 255), 9, pixel9, true)
    end
end
if screen_dmg:GetBool() then
    Render_Text(isDmg and '1' or '0', Vector2_new(screen_size.x / 2-25+screen_dmg_x:GetInt(), (screen_size.y - 200) / 2.5+45+screen_dmg_y:GetInt()), Color_RGBA(255, 255, 255, 255), 12, verdana12)
    Render_Text(tostring(cur_dmg), Vector2_new(screen_size.x / 2+screen_dmg_x:GetInt(), (screen_size.y - 200) / 2.5+45 +screen_dmg_y:GetInt()), Color_RGBA(255, 255, 255, 255), 12, verdana12)
end
if arrows_ind:Get() == 1 then
    Render_PolyFilled(yaw_base == 2 and ind_clr:GetColor() or Color_RGBA(35, 35, 35, 150), Vector2_new(screen_size.x / 2 + 55, screen_size.y / 2 - 2 + 2), Vector2_new(screen_size.x / 2 + 42, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 + 42, screen_size.y / 2 - 2 + 11))
    Render_PolyFilled(yaw_base == 3 and ind_clr:GetColor() or Color_RGBA(35, 35, 35, 150), Vector2_new(screen_size.x / 2 - 55, screen_size.y / 2 - 2 + 2), Vector2_new(screen_size.x / 2 - 42, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 - 42, screen_size.y / 2 - 2 + 11))

    Render_BoxFilled(Vector2_new(screen_size.x / 2 + 38, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 + 38 + 2, screen_size.y / 2 - 2 - 7 + 18), AntiAim_GetInverterState() == false and ind_clr2:GetColor() or Color_RGBA(35, 35, 35, 150))
    Render_BoxFilled(Vector2_new(screen_size.x / 2 - 40, screen_size.y / 2 - 2 - 7), Vector2_new(screen_size.x / 2 - 38, screen_size.y / 2 - 2 - 7 + 18), AntiAim_GetInverterState() == true and ind_clr2:GetColor() or Color_RGBA(35, 35, 35, 150))
elseif arrows_ind:Get() == 2 then
    textsize = Render_CalcTextSize('g', 20, arrows18)
    Render_Text('g', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)


    Render_Text('h', Vector2_new(screen_size.x/2+50, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)
    Render_Text('h', Vector2_new(screen_size.x/2+51, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, arrows18)
elseif arrows_ind:Get() == 3 then
    textsize = Render_CalcTextSize('<', 12, verdana12)
    Render_Text('<', Vector2_new(screen_size.x/2-52-textsize.x, screen_size.y/2-12), Color_RGBA(0, 0, 0, 100), 20, verdana23)
    Render_Text('<', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-13), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, verdana23)


    Render_Text('>', Vector2_new(screen_size.x/2+52, screen_size.y/2-12), Color_RGBA(0, 0, 0, 100), 20, verdana23)
    Render_Text('>', Vector2_new(screen_size.x/2+51, screen_size.y/2-13), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 20, verdana23)
elseif arrows_ind:Get() == 4 then
    textsize = Render_CalcTextSize('w', 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-50-textsize.x, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-50-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('w', Vector2_new(screen_size.x/2-51-textsize.x, screen_size.y/2-5), yaw_base == 3 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+50, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+51, screen_size.y/2-4), Color_new(0, 0, 0, 0.7), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+50, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
    Render_Text('x', Vector2_new(screen_size.x/2+51, screen_size.y/2-5), yaw_base == 2 and Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1) or Color_new(1, 1, 1, 1), 14, arrows)
end
if vel_mod_ind:GetBool() then
    local me = EntityList_GetLocalPlayer()
    if not me then return end
    if not me:IsAlive() then return end
    local modifier_vel = me:GetProp('m_flVelocityModifier') + 0.01
    if Cheat_IsMenuVisible() then
        modifier_vel = me:GetProp('m_flVelocityModifier')
    end
    if modifier_vel == 1.01 then return end

    local alpha_vel = math_abs(GlobalVars.curtime*4 % 2 - 1)*255

    local text_vel = string_format('Slowed down %.0f%%', math_floor(modifier_vel*100))
    local text_width_vel = 95

    a_width = lerp(a_width, math_floor((text_width_vel - 2) * modifier_vel), GlobalVars.frametime * 8)

    local x_vel = screen_size.x/2 - text_width_vel
    local y_vel = screen_size.y/2 - 350

    Render_PolyFilled(Color_RGBA(16, 16, 16, 255), Vector2_new(x_vel - 14 + vel_mod_add_x:Get(), y_vel - 16 + vel_mod_add_y:Get()), Vector2_new(x_vel + 6 + vel_mod_add_x:Get(), y_vel + 14+ vel_mod_add_y:Get()), Vector2_new(x_vel - 34 + vel_mod_add_x:Get(), y_vel + 14 + vel_mod_add_y:Get()))
    Render_PolyFilled(Color_new((124*2 - 124 * modifier_vel)/255, (195 * modifier_vel)/255, 13/255, alpha_vel/255), Vector2_new(x_vel - 14 + vel_mod_add_x:Get(), y_vel - 14 + vel_mod_add_y:Get()), Vector2_new(x_vel + 4 + vel_mod_add_x:Get(), y_vel + 13+ vel_mod_add_y:Get()), Vector2_new(x_vel - 32 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()))

    Render_Text('!', Vector2_new(x_vel - 18 + vel_mod_add_x:Get(), y_vel - 12+ vel_mod_add_y:Get()), Color_RGBA(16, 16, 16, 255), 25, verdana25)
    Render_Text(text_vel, Vector2_new(x_vel + 22 + vel_mod_add_x:Get(), y_vel - 15 + vel_mod_add_y:Get()), Color_RGBA(0, 0, 0, 255), 13, tahoma_bold13)
    Render_Text(text_vel, Vector2_new(x_vel + 21 + vel_mod_add_x:Get(), y_vel - 16 + vel_mod_add_y:Get()), Color_RGBA(255, 255, 255, 255), 13, tahoma_bold13)

    Render_BoxFilled(Vector2_new(x_vel + 22 + vel_mod_add_x:Get(), y_vel + 2 + vel_mod_add_y:Get()), Vector2_new(text_width_vel + screen_size.x/2-60 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()), Color_RGBA(25, 25, 25, 200))
    Render_BoxFilled(Vector2_new(x_vel + a_width + 37 + vel_mod_add_x:Get(), y_vel + 2 + vel_mod_add_y:Get()), Vector2_new(screen_size.x/2-73 + vel_mod_add_x:Get(), y_vel + 13 + vel_mod_add_y:Get()), Color_new((124*2 - 124 * modifier_vel)/255, (195 * modifier_vel)/255, 13/255, 1))
    Render_Box(Vector2_new(x_vel + 21 + vel_mod_add_x:Get(), y_vel + 1 + vel_mod_add_y:Get()), Vector2_new(text_width_vel + screen_size.x/2-59 + vel_mod_add_x:Get(), y_vel + 14 + vel_mod_add_y:Get()), Color_RGBA(55, 55, 55, 200))
end
end

particles = {}
hitmarkers = {}
damage_marker_log = {
log = {}
}


function autopeek()
if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() and auto_peek:GetBool() then
    if autopeek_pos == nil then
        autopeek_pos = EntityList_GetLocalPlayer():GetProp('m_vecOrigin')
    end

    if Menu_FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'):GetBool() then
        for i = 0, 49 do
            Render_Circle3DFilled(autopeek_pos, 16, i / -2.5, Color_new(auto_peek:GetColor().r, auto_peek:GetColor().g, auto_peek:GetColor().b, (i / 10 * auto_peek:GetColor().a) / 255), false)
            Render_Circle3DFilled(autopeek_pos, 8, i / -2.6, Color_new(auto_peek:GetColor().r, auto_peek:GetColor().g, auto_peek:GetColor().b, (i / 20 * auto_peek:GetColor().a) / 255), false)
        end
    end

else
    autopeek_pos = nil
end
end

function damage_markere(e)
if e:GetName() ~= 'player_hurt' then return end
if e:GetInt('attacker') == nil then return end
if e:GetInt('userid') == nil then return end
if EntityList_GetPlayerForUserID(e:GetInt('attacker')) == EntityList_GetLocalPlayer() then
    table_insert(damage_marker_log.log,{size = 120,pos = EntityList_GetPlayerForUserID(e:GetInt('userid')):GetHitboxCenter(e:GetInt('hitgroup')),damage = e:GetInt('dmg_health'),is_lethal = (e:GetInt('health') < 1),time = GlobalVars.realtime})
end
end
local verdana12b = Render_InitFont('verdana', 11, {'b'})
function damage_markerd()
if EntityList_GetLocalPlayer() == nil then return end
for i, mark in ipairs(damage_marker_log.log) do
    mark.pos.z = mark.pos.z + 50*GlobalVars.frametime
    local pos = Render_WorldToScreen(mark.pos)
    mark.size = mark.size - GlobalVars.frametime*55
    Render_Text(tostring(mark.damage), Vector2_new(pos.x+1,pos.y+1), Color_new(0.1,0.1,0.1,1), math_floor(math_min(mark.size,11)),verdana12b,false,true)
    Render_Text(tostring(mark.damage), Vector2_new(pos.x,pos.y), mark.is_lethal and Color_RGBA(155,200,20,255) or Color_RGBA(255,255,255,255), math_floor(math_min(mark.size,11)),verdana12b,false,true)

    if mark.time + 3 < GlobalVars.realtime or mark.size < 0 then table_remove(damage_marker_log.log,i) end
end
end

function reg_shot(shot)
local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
if not localplayer then return end

local my_index = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
if not my_index then return end
if EngineClient.IsConnected() and my_index:IsAlive() then
    local index = EntityList.GetClientEntity(shot.target_index)
    if not index then return end
    local get_player = index:GetPlayer()
    if not get_player then return end
    if shot.reason == 0 then
        local damage = shot.damage
        if damage < 1 then return end
        local bullet_position = get_player:GetHitboxCenter(shot.hitgroup)
        if not bullet_position then
            bullet_position = get_player:GetRenderOrigin()
            bullet_position.y = bullet_position.y + 30
        end

        bullet_position.x = (bullet_position.x - 10) + (math.random() * 20)
        bullet_position.y = (bullet_position.y - 10) + (math.random() * 20)
        bullet_position.z = (bullet_position.z - 15) + (math.random() * 30)
        table.insert(particles, {
            position = bullet_position,
            timer = GlobalVars.tickcount + 80,
            damage = damage,
            is_killed = get_player:GetProp("m_iHealth") - damage <= 0 and true or false
        })
        table.insert(hitmarkers, {
            position = get_player:GetHitboxCenter(shot.hitgroup),
            timer = GlobalVars.realtime,
            alpha = 0,
        })
    end
end
end

function move_position()
if #particles > 0 then
    for k, information in pairs(particles) do
        local delta = information.timer - GlobalVars.tickcount
        if delta > 0 then
            information.position.z = information.position.z + 0.3
        end
    end
end
end

function on_round_prestart(e)
if e:GetName() ~= "round_prestart" then return end
particles = {}
hitmarkers = {}
end

function on_self_connected(e)
if e:GetName() ~= "player_connect_full" then return end
particles = {}
hitmarkers = {}
end

function load_markers_modules(e)
damage_markere(e)
on_round_prestart(e)
on_self_connected(e)
end


ref_remove_scope = Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):GetInt()

anim_num = 0

function custom_scope()
Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):SetInt(2)
local_player = EntityList_GetLocalPlayer()

if not local_player or not local_player:IsAlive() or not local_player:GetProp('m_bIsScoped') then
    anim_num = lerp(anim_num, 0, 23 * GlobalVars.frametime)
else
    anim_num = lerp(anim_num, 1, 23 * GlobalVars.frametime)
end

scope_gap1 = scope_gap:GetInt() * anim_num
scope_size1 = scope_size:GetInt() * anim_num
scope_color_1 = scope_color:Get()
scope_color_2 = scope_color1:Get()
width = 1

scope_color_1.a = scope_color_1.a * anim_num
scope_color_2.a = scope_color_2.a * anim_num


start_x = screen_size.x / 2
start_y = screen_size.y / 2

--Left
Render_GradientBoxFilled(Vector2_new(start_x - scope_gap1, start_y), Vector2_new(start_x - scope_size1, start_y + width), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Right
Render_GradientBoxFilled(Vector2_new(start_x + scope_gap1, start_y), Vector2_new(start_x + scope_size1, start_y + width), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Up
Render_GradientBoxFilled(Vector2_new(start_x, start_y + scope_gap1), Vector2_new(start_x + width, start_y + scope_size1), scope_color_1, scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

--Down
Render_GradientBoxFilled(Vector2_new(start_x, start_y - scope_gap1), Vector2_new(start_x + width, start_y - scope_size1), scope_color_1, scope_color_1, Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color_new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))
end

function get_time()
local systym_time = ffi.new('SYSTEMTIME')
ffi.C.GetLocalTime(systym_time)

return {
    hour = systym_time.wHour,
    minute = systym_time.wMinute,
    second = systym_time.wSecond,
    milliseconds = systym_time.wMilliseconds,
}
end

local function get_latency()
local netchann_info = EngineClient:GetNetChannelInfo()
if netchann_info == nil then return '0' end
local latency = netchann_info:GetLatency(0)
return string_format('%1.f', math_max(0.0, latency) * 1000.0)
end

local textSize = 0

local function watermark()
local time = get_time()
if time.minute < 10 then time.minute = '0' .. time.minute end
local screen = EngineClient:GetScreenSize()
local ping = get_latency()
local ticks = math_floor(1.0 / GlobalVars.interval_per_tick)

local rightPadding = 12
local var = screen.x - textSize - rightPadding

local x = var - 15
local y = 8
local w = textSize + 20
local h = 17

local nexttext = 'alien.lua | '..Cheat_GetCheatUserName()..' | delay: '.. ping ..'ms | ' .. tostring(time.hour)..':'..tostring(time.minute)

if blur_back:GetBool() then
    Render_Blur(Vector2_new(x+10,y+2+1),Vector2_new(x+textSize+20,h * 1.5 + 4), Color.RGBA(255, 255, 255, 255))
end
Render_BoxFilled(Vector2_new(x+10,y+3),Vector2_new(x+textSize+20,h * 1.5 + 4), Color_new(.1, .1, .1, alpha_slider:Get()/255))
Render_BoxFilled(Vector2_new(x+10,y+3), Vector2_new(x+textSize+20,y+1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))

Render_Text(nexttext, Vector2_new(var+1,15),Color_RGBA(0, 0, 0, 180), 11, verdana11_r)
Render_Text(nexttext, Vector2_new(var,14), Color_RGBA(255, 255, 255, 255), 11, verdana11_r)
local wide = Render_CalcTextSize(nexttext, 11, verdana11_r)
var = var + wide.x

textSize = var - (screen.x - textSize - rightPadding)
end
local function getbinds()
local binds = {}
local cheat_binds = Cheat_GetBinds()

for i = 1, #cheat_binds do
    table_insert(binds, 1, cheat_binds[i])
end
return binds
end
local keybind_names = {
['Double Tap'] = 'Double tap',
['Hide Shots'] = 'On shot anti-aim',
['Slow Walk'] = 'Slow motion',
['Edge Jump'] = 'Jump at edge',
['Fake Ping'] = 'Ping spike',
['Override Resolver'] = 'Resolver override',
['Fake Duck'] = 'Duck peek assist',
['Minimum Damage'] = 'Damage override',
['Auto Peek'] = 'Quick peek assist',
['Body Aim'] = 'Force body aim',
['Safe Points'] = 'Safe points',
['Yaw Base'] = 'Yaw base',
['Enable Thirdperson'] = 'Thirdperson',
['Manual Yaw Base'] = 'Yaw base',
}

local alpha_k = 1
local data_k = {
[''] = {alpha_k = 0}
}

local drag = false
local width_k = 0
local width_ka = 0

function upper_to_lower(str)
str1 = string_sub(str, 2, #str)
str2 = string_sub(str, 1, 1)
return str2:upper()..str1:lower()
end


local function render_conteiner(x, y, w, h, name, font_size, font)
local name_size = Render.CalcTextSize(name, font_size, font)
if teamskeet_kb:Get() == 0 then
    if gradient:GetBool() then
        Render.GradientBoxFilled(Vector2.new(x, y+2), Vector2.new(x + w/2, y+2 - 1), Color.new(0, 0.7843137254901961, 1, 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(0, 0.7843137254901961, 1, 1), Color.new(1, 0, 0.9333333333333333, 1))
        Render.GradientBoxFilled(Vector2.new(x + w/2, y+2), Vector2.new(x + w, y+2 - 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(1, 0.9176470588235294, 0, 1), Color.new(1, 0, 0.9333333333333333, 1), Color.new(1, 0.9176470588235294, 0, 1))
    else
        Render.BoxFilled(Vector2.new(x, y+2), Vector2.new(x + w, y+2 - 1), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
    end
    Render.BoxFilled(Vector2.new(x, y+2), Vector2.new(x + w, y+2 + h - 1), Color.RGBA(20, 20, 20, 255))
    local frametime = GlobalVars.frametime * 16
    local binds = getbinds()
    local add_y = 0
    for i = 1, #binds do

        local bind_name = keybind_names[binds[i]:GetName()] == nil and upper_to_lower(binds[i]:GetName()) or keybind_names[binds[i]:GetName()]
        if data_k[bind_name] == nil then
            data_k[bind_name] = {alpha_k = 0}
        end

        data_k[bind_name].alpha_k = math_lerp(frametime, data_k[bind_name].alpha_k,binds[i]:IsActive() and 1 or 0)
        add_y = add_y + 16 * data_k[bind_name].alpha_k
    end


    Render.BoxFilled(Vector2.new(x, y + h + add_y + 5), Vector2.new(x + w, y + h + 1), Color.RGBA(25, 25, 25, 255))

    Render.Text(name, Vector2.new(x + w / 2 - name_size.x / 2, y + 2+2), Color.new(280, 280, 280), font_size, font, true)
else
    if blur_back:GetBool() then
        Render_Blur(Vector2_new(x-1, y-1), Vector2_new(x + w + 4, y + h + 3), Color.RGBA(255, 255, 255, 255))
    end
    Render_BoxFilled(Vector2_new(x, y), Vector2_new(x + w + 3, y + h + 2), Color_new(.1, .1, .1, alpha_slider:Get()/255))
    Render_BoxFilled(Vector2_new(x, y), Vector2_new(x + w + 3, y - 2), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1))
    --Render_BoxFilled(Vector2_new(x-1, y), Vector2_new(x+1 + w, y), Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, 1), 6)
    Render_Text(name, Vector2_new(x+2 + w / 2 + 1 - name_size.x / 2, y + 3), Color_RGBA(0, 0, 0, 180), font_size, font)
    Render_Text(name, Vector2_new(x+1 + w / 2 + 1 - name_size.x / 2, y + 2), Color_RGBA(255, 255, 255, 255), font_size, font)
end
end

keybinds_x:SetVisible(false)
keybinds_y:SetVisible(false)

keybinds_v = 0
widthh = 0
function keybinds()
local x_k, y_k = keybinds_x:GetInt(), keybinds_y:GetInt()
local max_width = 0
local frametime = GlobalVars.frametime * 16
local add_y = 0
local total_width = 66
local active_binds = {}
if teamskeet_kb:Get() == 0 then
    widthh = 200
else
    widthh = 135
end
local bind = getbinds()
if Cheat_IsMenuVisible() or keybinds_v then
    if teamskeet_kb:Get() == 0 then
        render_conteiner(x_k, y_k, width_ka, 16, 'keybinds', 10, pixel7)
    else
        render_conteiner(x_k, y_k, width_ka, 16, 'keybinds', 11, verdana11_r)
    end
    local mouse = Cheat_GetMousePos()
    if Cheat_IsKeyDown(1) and Cheat_IsMenuVisible() then
        if mouse.x >= x_k and mouse.y >= y_k and mouse.x <= x_k + width_ka and mouse.y <= y_k + 18 or drag then
            if not drag then
                drag = true
            else
                keybinds_x:SetInt(mouse.x - math_floor(width_ka / 2))
                keybinds_y:SetInt(mouse.y - 8)
            end
        end
    else
        drag = false
    end
end
for i = 1, #bind do
    local binds = bind[i]
    if teamskeet_kb:Get() == 1 then
        bind_name = keybind_names[binds:GetName()] == nil and upper_to_lower(binds:GetName()) or keybind_names[binds:GetName()]
    else
        if binds:GetValue() == 'on' then
            bndnm = ''
        else
            bndnm = " [" .. binds:GetValue() .. "]"
        end

        bind_name = keybind_names[binds:GetName()] == nil and (upper_to_lower((binds:GetName())) .. bndnm) or (keybind_names[binds:GetName()] ..bndnm)
    end

    --local bind_state = binds:GetValue():lower()
    --if bind_state == 'on' then
    --if binds:GetValue() == "on" then namess = binds:GetName() else namess = binds:GetName() .. " [" .. binds:GetValue() .. "]" end
    bind_state = binds:GetMode()
    if bind_state == 0 then
        bind_state = 'toggled'
    elseif bind_state == 1 then
        if teamskeet_kb:Get() == 1 then
            bind_state = 'holding'
        else
            bind_state = 'HELD'
        end
    end
    --end

    if data_k[bind_name] == nil then
        data_k[bind_name] = {alpha_k = 0}
    end

    data_k[bind_name].alpha_k = math_lerp(frametime, data_k[bind_name].alpha_k,binds:IsActive() and 1 or 0)

    if teamskeet_kb:Get() == 0 then
        bind_state_size = Render_CalcTextSize(bind_state, 10, pixel7)
        bind_name_size = Render_CalcTextSize(bind_name, 10, pixel7)
    else
        bind_state_size = Render_CalcTextSize(bind_state, 11, verdana11_r)
        bind_name_size = Render_CalcTextSize(bind_name, 11, verdana11_r)
    end
    if teamskeet_kb:Get() == 1 then
        Render_Text(bind_name, Vector2_new(x_k+4, y_k + 21 + add_y), Color_new(0, 0, 0, data_k[bind_name].alpha_k), 11, verdana11_r)
        Render_Text('['..bind_state..']', Vector2_new(x_k+1 + (width_ka - bind_state_size.x - 8), y_k + 21 + add_y), Color_new(0, 0, 0, data_k[bind_name].alpha_k), 11, verdana11_r)

        Render_Text(bind_name, Vector2_new(x_k+3, y_k + 20 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 11, verdana11_r)
        Render_Text('['..bind_state..']', Vector2_new(x_k + (width_ka - bind_state_size.x- 8), y_k + 20 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 11, verdana11_r)
    else
        if gradient:GetBool() then
            Render_Text(bind_name, Vector2_new(x_k+5, y_k + 21 + add_y), Color_new(0, 0.7843137254901961, 1, data_k[bind_name].alpha_k), 10, pixel7, true)
            Render_Text(bind_state, Vector2_new(x_k + (width_ka - bind_state_size.x- 8)+4, y_k + 21 + add_y), Color_new(1, 0.9176470588235294, 0, data_k[bind_name].alpha_k), 10, pixel7, true)
        else
            Render_Text(bind_name, Vector2_new(x_k+5, y_k + 21 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 10, pixel7)
            Render_Text(bind_state, Vector2_new(x_k + (width_ka - bind_state_size.x- 8)+4, y_k + 21 + add_y), Color_new(1, 1, 1, data_k[bind_name].alpha_k), 10, pixel7, true)
        end
    end
    add_y = add_y + 16 * data_k[bind_name].alpha_k


    local width_k = bind_state_size.x + bind_name_size.x + 18

    if width_k > widthh then
        if width_k > max_width then
            max_width = width_k
        end
    end
    if binds:IsActive() then
        table_insert(active_binds, binds)
    end
end
alpha_k = math_lerp(frametime,alpha_k, (Cheat_IsMenuVisible() or #active_binds > 0) and 1 or 0)
width_ka = math_lerp(frametime,width_ka,math_max(max_width, widthh))
keybinds_v = #active_binds > 0


end

local hit_id = 0
local miss_id = 0
local shot_id = 0
local choke = 0
local missgroup_names = { 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local hitgroup_names = { 'generic', 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local miss_reason = { 'resolver', 'spread', 'occlusion', 'prediction error' }
Cheat_RegisterCallback('ragebot_shot', function(shot)
if advanced_shot_logger:GetBool() then
if EntityList_GetLocalPlayer() == nil then return end
total_hits = EntityList_GetLocalPlayer():GetProp('m_totalHitsOnServer')
if total_hits == nil then return end
miss_hitbox = missgroup_names[shot.hitgroup] or '?'
self_choke = ClientState.m_choked_commands
choke = time_to_ticks1(GlobalVars.curtime - EntityList_GetClientEntity(shot.index):GetPlayer():GetProp("m_flSimulationTime")) + 1;
if choke < 0 then
choke = 0
elseif choke > 14 then
choke = 14
end
end
end)
function num_format(b) local c=b%10;if c==1 and b~=11 then return b..'st'elseif c==2 and b~=12 then return b..'nd'elseif c==3 and b~=13 then return b..'rd'else return b..'th'end end
shot_id = 0
hit_ids = 0
total_hits = 0
local missgroup_names = { 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
local miss_reason = { '?', 'spread', 'occlusion', 'prediction error' }
function time_to_ticks1(a)
return math_floor(0.5 + a / GlobalVars.interval_per_tick)
end

stuff = {}

function round(x)
return x >= 0 and math_floor(x+0.5) or math_ceil(x-0.5)
end

function yaw_normalize(yaw)
if yaw > 180 or yaw < -180 then
local revolutions = round(math_abs(yaw / 360))
if yaw < 0 then yaw = yaw + 360*revolutions else yaw = yaw - 360*revolutions end
end
return yaw
end

function _verification(shot)
local text = ''

local hg_diff = hgroup ~= aimed_hgroup
local dmg_diff = shot.damage ~= shot.wanted_damage

if hg_diff or dmg_diff then
text = string_format(
' | mismatch: [ %s ]', (function()
local addr = ''

if dmg_diff then addr = 'dmg: ' .. shot.wanted_damage .. (hg_diff and ' | ' or '') end
if hg_diff then addr = addr .. (hg_diff and 'hitgroup: ' .. aimed_hgroup or '') end

return addr
end)()
)
end

return text
end
choke = 0
local engine_client = Utils_CreateInterface('engine.dll', 'VEngineClient014')
local interfacePointer = ffi_typeof('void***')
local I_EngineClientPtr = ffi_cast(interfacePointer, engine_client) or error('engine_client is nil', 2)
local getNetChannelInfo = ffi_cast('void*(__thiscall*)(void*)', I_EngineClientPtr[0][78]) or error('I_EngineClientPtr is nil')
function registered_shot(shot)
hit_id = hit_id + 1

shot_id = num_format((hit_id % 15) + 1)
local safety = Menu_FindVar('Aimbot', 'Ragebot', 'Misc', 'Safe Points'):Get()
local name = string_lower(EntityList_GetClientEntity(shot.target_index):GetPlayer():GetName())
if name == nil then return end
local hgroup = hitgroup_names[shot.hitgroup + 1] or '?'
local hit_chance = tostring(math_floor(shot.hitchance + 0.5))
local backtrack = shot.backtrack
local m_iHealth = EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_iHealth')
if m_iHealth == nil then return end
local health = m_iHealth - shot.damage
if health < 0 then health = 0 end
local aimed_hgroup = hitgroup_names[shot.wanted_hitgroup + 1] or '?'

local feet_yaw = math_min(58, math_max(yaw_normalize(EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_flPoseParameter')[12] * 120 - 60), -58))
if EntityList_GetClientEntity(shot.target_index):GetPlayer():GetProp('m_flPoseParameter') == nil then return end
if feet_yaw == nil then return end
local ping = EngineClient_GetNetChannelInfo():GetLatency(0)*1000
local avg_ping = EngineClient_GetNetChannelInfo():GetAvgLatency(0)*1000
--if shot.reason == nil or hit_id == nil or aimed_hgroup == nil or shot_id == nil or feet_yaw == nil or safety == nil or name == nil or hit_chance == nil or ping == nil or avg_ping == nil then return end
local netChannelInfo = ffi_cast('void***', getNetChannelInfo(I_EngineClientPtr)) or error('netchaninfo is nil')
local netChannel = GetNetChannel(netChannelInfo)
local net_state = string_format(
'delay: %d:%.2f | dropped: %.0f',
avg_ping, math_abs(avg_ping-ping), (netChannel.AvgLoss*100)
)

local uflags = {
math_abs(avg_ping-ping) < 1 and 0 or 1,
CVar_FindVar('cl_clock_correction'):GetInt() == 1 and 0 or 1,
CVar_FindVar('cl_clock_correction_force_server_tick') == 999 and 0 or 1
}

local pflags = {
ClientState.m_choked_commands > 1 and 1 or 0,
EntityList_GetLocalPlayer():GetProp('m_flVelocityModifier') < 1.00 and 1 or 0,
(EntityList_GetLocalPlayer():GetRenderOrigin().z <= EntityList_GetClientEntity(shot.target_index):GetPlayer():GetRenderOrigin().z) and 1 or 0
}

local correction = Menu_FindVar('Aimbot', 'Ragebot', 'Main', 'Override Resolver'):GetBool()
if shot.reason == 0 then
text = string_format('Registered %s shot in %s's %s for %d damage [angle: %.2f° | %d:%d°] ( hitchance: %s%% | safety: %s | history(Δ): %d | flags: %s%s )',
shot_id, name, hgroup, shot.damage, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, hit_chance, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags), _verification(shot))
textc = string_format('Registered %s shot in %s's %s for %d damage [angle: %.2f° | %d:%d°] ( hitchance: %s | safety: %s | history(Δ): %d | flags: %s%s )',
shot_id, name, hgroup, shot.damage, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, hit_chance .. "%%", safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags), _verification(shot))
elseif shot.reason == 1 then
shot_reason = (shot.reason == 1 and total_hits ~= EntityList_GetLocalPlayer():GetProp('m_totalHitsOnServer')) and 'damage rejection' or string_format('unknown [angle: %.2f° | %d:%d°]', shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw)
text = string_format('Missed %s shot at %s's %s(%s%%) due to %s ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot_reason, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 2 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to spread [angle: %.2f° | %d:%d°] ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 3 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to occlusion [angle: %.2f° | %d:%d°] ( dmg: %d | safety: %d | history(Δ): %d | flags: %s )',
shot_id, name, miss_hitbox, hit_chance, shot.spread_degree, correction and 1 or 0, (feet_yaw < 10 and feet_yaw > -10) and 0 or feet_yaw, shot.wanted_damage, safety == 2 and 2 or (safety == 1 and 1 or 0), backtrack, table_concat(pflags))
elseif shot.reason == 4 then
text = string_format('Missed %s shot at %s's %s(%s%%) due to prediction error [%s] [vel_modifier: %.1f | history(Δ): %d | error: %s]',
shot_id, name, miss_hitbox, hit_chance, net_state, EntityList_GetLocalPlayer():GetProp('m_flVelocityModifier'), backtrack, table_concat(uflags))
else
text = string_format('Missed %s shot at %s's %s(%s%%) due to death [dropped: %d | flags: %s | error: %s]',
shot_id, name, miss_hitbox, hit_chance, EngineClient_GetNetChannelInfo():GetAvgLoss(0), table_concat(pflags), table_concat(uflags))
end

if shot.reason == 0 then
colored_print(Color.RGBA(23, 250, 29, 255), "[alien.lua] " .. textc .. '
')

else
colored_print(Color.RGBA(255, 23, 23, 255), "[alien.lua] " .. text .. '
')

end

table_insert(hitlogs, {text = text, time = GlobalVars.realtime})
end

function log_draw()
local x, y = 5, 5
for i, hitlog in ipairs(hitlogs) do
--if draw_type:Get(2) then
Render_Text(hitlog.text, Vector2_new(x+1, y+1), Color_RGBA(0, 0, 0, math_floor((hitlog.time + 10 - GlobalVars.realtime)*500)-105), 10, lucida_console)
Render_Text(hitlog.text, Vector2_new(x, y), Color_RGBA(255, 255, 255, math_floor((hitlog.time + 10 - GlobalVars.realtime)*500)), 10, lucida_console)
--end
y = y + 15
if #hitlogs > 15 then table_remove(hitlogs,1) end
if hitlog.time + 10 < GlobalVars.realtime then table_remove(hitlogs, i) end
end
end
--anti_bruteforce_work.phases:SetVisible(false)


wall_dmg = 0
ent_exists = false
data = {
    xPos = 1,
    yPos = 1,
}
function round_p(a, prec)
    return math_floor(a + 0.5*prec)
end

function prenetration_prediction()
    local me = EntityList_GetLocalPlayer()
    if me == false then return end
    local weap = me:GetActiveWeapon()
    if weap == nil then return end
    local weapon_id = weap:GetWeaponID()
    if weapon_id == nil then return end

    if weap:IsKnife() or weap:IsGrenade() or weapon_id == 31 then
        wall_dmg = 0
        return
    end

    local eye_pos = me:GetEyePosition()
    local eyeX = eye_pos.x
    local eyeY = eye_pos.y
    local eyeZ = eye_pos.z
    local pitch = me:GetRenderAngles().pitch
    local yaw = me:GetRenderAngles().yaw

    local sin_pitch = math_sin(math_rad(pitch))
    local cos_pitch = math_cos(math_rad(pitch))
    local sin_yaw = math_sin(math_rad(yaw))
    local cos_yaw = math_cos(math_rad(yaw))

    local dirVector = { cos_pitch * cos_yaw, cos_pitch * sin_yaw, -sin_pitch }

    local fraction = EngineTrace.TraceRay(Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * 8192), eyeY + (dirVector[2] * 8192), eyeZ + (dirVector[3] * 8192)), me, 0xFFFFFFFF)
    wall_dmg = 0
    ent_exists = false

    if fraction.fraction < 1 then
        local ent, dmg = Cheat_FireBullet(me:GetPlayer(), Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * (8192 * fraction.fraction + 128)), eyeY + (dirVector[2] * (8192 * fraction.fraction + 128)), eyeZ + (dirVector[3] * (8192 * fraction.fraction + 128)))).trace.hit_entity, Cheat_FireBullet(me:GetPlayer(), Vector_new(eyeX, eyeY, eyeZ), Vector_new(eyeX + (dirVector[1] * (8192 * fraction.fraction + 128)), eyeY + (dirVector[2] * (8192 * fraction.fraction + 128)), eyeZ + (dirVector[3] * (8192 * fraction.fraction + 128)))).damage

        if dmg ~= nil then
            ent_exists = true
        end
        if ent == nil then
            ent = -1
        end
        if wall_dmg < dmg then
            wall_dmg = dmg
        end
    end
   
end

function penetration_ind()
    if EngineClient_GetLocalPlayer() == nil or EntityList_GetLocalPlayer() == nil or wall_dmg == nil or not EntityList_GetLocalPlayer():IsAlive() or not penetration:GetBool() then return end

    if wall_dmg > 0 and not penetration_rainbow:GetBool() then
        Render_Text(tostring(round_p(wall_dmg, 1)), Vector2_new((screen_size.x / 2), (screen_size.y / 2 + penetration_position:GetInt())), penetration:GetColor(), 12, verdana12)
    elseif wall_dmg > 0 and penetration_rainbow:GetBool() then
        r, g, b = math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100)) * 127 + 128), math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100) + 2) * 127 + 128), math_floor(math_sin(GlobalVars.realtime * 2 / (penetration_speed:GetInt() / 100) + 4) * 127 + 128)
        Render_Text(tostring(round_p(wall_dmg, 1)), Vector2_new((screen_size.x / 2), (screen_size.y / 2 + penetration_position:GetInt())), Color_RGBA(r, g, b, 255), 12, verdana12)
    end
end

local phrases = {
'сын инвалида мб Alien.lua прикупишь?',
'не блюй в мой чат ',
'умер , посиди подумай в спектах',
'Алеу какая там ситуацыя с юидом ',
'але 13146 вещает ',
'ХУЙЛАН Я ТВОЮ МАТЬ ЕБАЛ',
'Alien.lua забустила ',
'он еще даже телку не трахал но человека убил ',
'нормально ты так споткнулся',
'ты слишком хуев для этой карты , выйди не позорься',
'ты че пидорас в светлое будущие попрыгал ',
'1.',
'есть всего 3 расы : белые , желтые  и негры . Ты относишься к 4 расе , имбицылов',
'вчера пил пиво , а теперь ебу твою сестру',
'вроде не срал , но уже воняет',
'ты любишь когда тебя хсают nn?',
'хочешь узнать ,  как выглядит твой батя ? а хуй знает',
'в один момент понимаешь , что ебешь не телку , а барана',
'когда открываю гачи мучи вспоминаю твоего отца',
'в кусте ебали твою мать , а ты не знаешь его ИМЕНИ задумайся об этом ....',
'что chimera lua не забустила ',
'а это правда что твоя семья малоимущие и твоему отцу пришлось отсосать хуй у администратора пятерочки за пакетик эклеров??',
'',
'▼- стрелочка вниз - ДАДАДА ИМЕННО В ТОМ МЕСТЕ ТВОЯ МАТЬ У МЕНЯ ОТРАБАТЫВАЕТ',
'ммовский хуесос ты для чего на паблик зашел, заблудился или что?',
'хахах просто легкий пидорас',
'"спи нахуй пидораска',
'ХАХАХА ЧЕ ТЫ ТАМ ВРЕДИТЕЛЬ АХАХАХ СПОТИФАЙ ХАХА Х',
'"СПОТЛАЙТ СПОТЛАЙТ АХАХА СПИНОЙ ПИДОРАСА УБИВАЮ ХАХА',
'ало пидорас ебаный молчишь потому что ебу твой рот',
'Почему улетаешь прикупи  Alien.lua',
'ez '
}

local function get_phrase()
return phrases[Utils.RandomInt(1, #phrases)]:gsub('"', '')
end

function trashtalk(e)
if e:GetName() ~= "player_death" then return end

local me = EntityList.GetLocalPlayer()
local victim = EntityList.GetPlayerForUserID(e:GetInt("userid"))
local attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"))

if victim == attacker or attacker ~= me then return end


EngineClient.ExecuteClientCmd('say "' .. get_phrase() .. '"')
end

current_choke = 0
ind_phase, ind_num, ind_time = 0, 0, 0
last_sent, current_choke = 0, 0
teleport = 0
last_origin = 0
breaking_lc = 0
function gram_create(value, count) local gram = { }; for i=1, count do gram[i] = value; end return gram; end
function gram_update(tab, value, forced) local new_tab = tab; if forced or new_tab[#new_tab] ~= value then table_insert(new_tab, value); table_remove(new_tab, 1); end; tab = new_tab; end
function get_average(tab) local elements, sum = 0, 0; for k, v in pairs(tab) do sum = sum + v; elements = elements + 1; end return sum / elements; end
gram_fyaw = gram_create(0, 2)
teleport_data = gram_create(0, 3)
gram_update(gram_fyaw, math_min(math_abs(AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation()), 58), true)

local frequency = 144

function get_color(number, max, i)
local Colors = {
    { 255, 0, 0 },
    { 237, 27, 3 },
    { 235, 63, 6 },
    { 229, 104, 8 },
    { 228, 126, 10 },
    { 220, 169, 16 },
    { 213, 201, 19 },
    { 176, 205, 10 },
    { 124, 195, 13 }
}

function math_num(int, max, declspec)
    local int = (int > max and max or int)
    local tmp = max / int;

    if not declspec then declspec = max end

    local i = (declspec / tmp)
    i = (i >= 0 and math_floor(i + 0.5) or math_ceil(i - 0.5))

    return i
end

i = math_num(number, max, #Colors)

return
Colors[i <= 1 and 1 or i][1],
Colors[i <= 1 and 1 or i][2],
Colors[i <= 1 and 1 or i][3],
i
end
function update_choked()
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
if ClientState.m_choked_commands == 0 then
    local m_origin = EntityList_GetLocalPlayer():GetProp('m_vecOrigin')

    if last_origin ~= nil then
        teleport = (m_origin-last_origin):Length2D()

        gram_update(teleport_data, teleport, true)
    end

    gram_update(gram_fyaw, math_min(math_abs(breaking_lc == 2 and (AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation())/2 or (AntiAim_GetCurrentRealRotation() - AntiAim_GetFakeRotation())), 58), true)

    last_sent = current_choke
    last_origin = m_origin
end

current_choke = ClientState.m_choked_commands
breaking_lc =
get_average(teleport_data) > 65 and 1 or
(Exploits_GetCharge() > 0.7 and 2 or 0)
end

lag_data = gram_create(0, 90)

request_time, frametime = 0, 0
frametimes = {}

function renderer_gradient(x,y,w,h,c1,c2,ishorizon)
if ishorizon == true then
    Render_GradientBoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1,c2,c1,c2)
else
    Render_GradientBoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1,c1,c2,c2)
end
end

function renderer_rectangle(x,y,w,h,c1)
if blur_back:GetBool() then
    Render_Blur(Vector2_new(x,y),Vector2_new(x+w,y+h), Color.RGBA(255, 255, 255, 255))
end
Render_BoxFilled(Vector2_new(x,y),Vector2_new(x+w,y+h),c1)

end

function renderer_text(x,y,cent,string,c1,font,size,alpha)
Render_Text(string,Vector2_new(x+1,y+1), Color_RGBA(0, 0, 0, alpha),size,font,false,cent)
Render_Text(string,Vector2_new(x,y),c1,size,font,false,cent)
end

function renderer_line(x,y,w,h,c1)
Render_Line(Vector2_new(x, y), Vector2_new(w,h), c1)
end

formatting = (function(avg)
if avg < 1 then return ('%.2f'):format(avg) end
if avg < 10 then return ('%.1f'):format(avg) end
return ('%d'):format(avg)
end)
fps_data = gram_create(0, 30)
g_frameRate, g_prev_frameRate = 0, 0
function solus_ui()
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
avg = math_abs(frametime*600)
local addr, nval = '', false
local r, g, b = 150, 150, 150

local fr = GlobalVars.frametime * 3.75
local min_offset = 1200+math_max(0, get_average(teleport_data)-3800)
local teleport_mt = math_abs(math_min(teleport-3800, min_offset) / min_offset * 100)

if ind_num ~= teleport_mt and ind_time < GlobalVars.realtime then
    ind_time = GlobalVars.realtime + 0.005
    ind_num = ind_num + (ind_num > teleport_mt and -1 or 1)
end
ind_phase = ind_phase + (breaking_lc == 1 and fr or -fr)
ind_phase = ind_phase > 1 and 1 or ind_phase
ind_phase = ind_phase < 0 and 0 or ind_phase
if breaking_lc == 2 then
    addr, ind_phase, ind_num = ' | SHIFTING', 0, 0
    r, g, b = 228, 126, 10
elseif ind_phase > 0.1 then
    addr = ' | dst:          '
end
local text_FL = ('FL: %s%s'):format(
(function()
if tonumber(last_sent) < 10 then
    return '  ' .. last_sent
end
return last_sent
end)(),
addr)
local h_FL, w_FL = 17, (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and Render_CalcTextSize(text_FL,11,verdana11_r).x + 8 or -4
local x_FL, y_FL = screen_size.x, (windows_value:Get(1) and 35 or 10) + (25*0)

x_FL = x_FL - w_FL - 10
if windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive() then
    renderer_rectangle(x_FL, y_FL, w_FL, h_FL, Color_new(.1, .1, .1, alpha_slider:Get()/255))

    renderer_gradient(x_FL, y_FL+h_FL, w_FL-w_FL/2, 1, Color_new(.1, .1, .1, alpha_slider:Get()/255), Color_RGBA(r, g, b,255),true)
    renderer_gradient(x_FL + w_FL/2, y_FL + h_FL, w_FL - w_FL/2, 1, Color_RGBA(r, g, b,255), Color_new(.1, .1, .1, alpha_slider:Get()/255),true)

    if ind_phase > 0 then
        renderer_gradient(
        x_FL + w_FL - Render_CalcTextSize(' | dst: ',11,verdana11_r).x + 2,
        y_FL + 6, math_min(100, ind_num) / 100 * 24, 5,

        Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, ind_phase*220/255),
        Color_new(accent_color:GetColor().r, accent_color:GetColor().g, accent_color:GetColor().b, ind_phase * 25/255),

        true
        )
    end
    renderer_text(x_FL+4, y_FL + 2,false,text_FL,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end

local add_text = (get_average(gram_fyaw) > 0) and '     ' or ''
text_FI = ('%sFAKE (%.1f°)'):format(add_text, get_average(gram_fyaw))
local h_FI, w_FI = 18, (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and Render_CalcTextSize(text_FI,11,verdana11_r).x + 8 or 0

local r,g,b = get_color(get_average(gram_fyaw),30)
local dec = { math_ceil(r - (r/100 * 50)), math_ceil(g - (g/100 * 50)), math_ceil(b - (b/100 * 50)) }
if (windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) then
    renderer_gradient(x_FL - w_FI - 6, y_FL, 2, h_FI / 2,Color_RGBA(dec[1], dec[2], dec[3],0),Color_RGBA(r,g,b,255),false)
    renderer_gradient(x_FL - w_FI - 6, y_FL + h_FI / 2, 2, h_FI / 2,Color_RGBA(r,g,b,255),Color_RGBA(dec[1], dec[2], dec[3],0),false)
    renderer_gradient(x_FL - w_FI - 4, y_FL, w_FI / 2, h_FI,Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/20)),Color_new(.1, .1, .1, alpha_slider:Get()/255) ,true)
    renderer_gradient(x_FL - w_FI - 4 + w_FI / 2, y_FL, w_FI / 2, h_FI, Color_new(.1, .1, .1, alpha_slider:Get()/255),Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/20)),true)
    renderer_text(x_FL - w_FI, y_FL + 2,false,text_FI,Color_RGBA(255,255,255,255),verdana11_r,11,120)
    if get_average(gram_fyaw) > 0 then
        Render_Circle(Vector2_new(x_FL - w_FI + 6, y_FL + 8.5), 5, 32, Color_RGBA(89, 119, 239, 255), 2, 0, math.min(360, get_average(gram_fyaw)*6.21))
    end
end

local text_HZ = ('%sms / %dhz'):format(formatting(avg), frequency)

local h_HZ, w_HZ = 17, windows_value:Get(4) and Render_CalcTextSize(text_HZ,11,verdana11_r).x+8 or -4
local x_HZ, y_HZ = screen_size.x, (windows_value:Get(1) and 35 or 10) + (25*((windows_value:Get(3) and EntityList_GetLocalPlayer():IsAlive()) and 1 or 0))

local x_HZ = x_HZ - w_HZ - 10
if windows_value:Get(4) then
    local interp = { get_color(15-avg, 15) }
    renderer_gradient(x_HZ,y_HZ+h_HZ,w_HZ/2,1, Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/3)),Color_RGBA(interp[1], interp[2], interp[3], 255),true  )
    renderer_gradient(x_HZ + w_HZ/2, y_HZ+h_HZ, w_HZ-w_HZ/2, 1,Color_RGBA(interp[1], interp[2], interp[3], 255), Color_RGBA(17,17,17,math_floor(alpha_slider:Get()/255/3)), true)
    renderer_rectangle(x_HZ, y_HZ, w_HZ, h_HZ, Color_new(.1, .1, .1, alpha_slider:Get()/255) or Color_RGBA(237,237,237,alpha_slider:Get()/255))
    renderer_text(x_HZ+4, y_HZ + 2,false,text_HZ,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end
g_frameRate = 0.9 * g_frameRate + (1.0 - 0.9) * GlobalVars.absoluteframetime
gram_update(fps_data, math_abs(g_prev_frameRate-(1/g_frameRate)), true)
g_prev_frameRate = 1/g_frameRate
local g_nValues_t = {
    avg, 1, 3,
    get_average(fps_data)/4, 0
}

local min_value, max_value = math_min(unpack(g_nValues_t)), math_max(unpack(g_nValues_t))

local text_IO_sub = '       '
local text_IO = 'IO | ' ..  text_IO_sub
local w_IE = Render_CalcTextSize(text_IO_sub,11,verdana11_r).x+3
local h_IO, w_IO = 18, Render_CalcTextSize(text_IO,11,verdana11_r).x+8
local graphics = graphs()
if windows_value:Get(4) then
    renderer_rectangle(x_HZ - w_IO - 4, y_HZ, w_IO, h_IO, Color_new(.1, .1, .1, alpha_slider:Get()/255))
    renderer_text(x_HZ - w_IO, y_HZ + 2,false,text_IO,Color_RGBA(255,255,255,255),verdana11_r,11,120)
end
end

function custom_hitsound(e)
if e:GetName() ~= 'player_hurt' then return end
me = EntityList_GetLocalPlayer()
if me == nil then return end
attacker = EntityList_GetPlayerForUserID(e:GetInt('attacker'))
if attacker == nil then return end
if attacker ~= me then return end
--if hitsound_custom:Get() == 1 then sound = 'arena_switch_press_02.wav' else sound = hitsound_name:Get() end
EngineClient_ExecuteClientCmd('playvol buttons/arena_switch_press_02.wav 1')
end

_set_clantag = ffi.cast('int(__fastcall*)(const char*, const char*)', Utils_PatternScan('engine.dll', '53 56 57 8B DA 8B F9 FF 15'))
_last_clantag = nil
function set_clantag(v)
if v == _last_clantag then return end
_set_clantag(v, v)
_last_clantag = v
end

function time_to_ticks(time)
return math_floor(time / GlobalVars.interval_per_tick + 0.5)
end

function gamesense_anim(text, indices)
if not EngineClient_IsConnected() then return end
local text_anim = '              ' .. text .. '                      '
local tickinterval = GlobalVars.interval_per_tick
local tickcount = GlobalVars.tickcount + time_to_ticks(EngineClient_GetNetChannelInfo():GetLatency(0))
local i = tickcount / time_to_ticks(0.3)
i = math_floor(i % #indices)
i = indices[i+1]+1

return string_sub(text_anim, i, i+15)
end
enabled_prev = true

function run_tag_animation()
if clan_tag:GetBool() and EngineClient_IsConnected() then
    --don't advertise other cheats using this or drone strike
    local clan_tag = gamesense_anim('alien.lua', {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25})
    if clan_tag ~= clan_tag_prev then
        set_clantag(clan_tag)
    end
    clan_tag_prev = clan_tag
end
end

function clantag(ctx)
if clan_tag:GetBool() then
    local local_player = EntityList_GetLocalPlayer()
    if local_player ~= nil and (not local_player:IsAlive()) and GlobalVars.tickcount % 2 == 0 then --missing noclip check
        run_tag_animation()
    end
end
end

function on_run_command(s)
if clan_tag:GetBool() then
    if ClientState.m_choked_commands == 0 then
        run_tag_animation()
    end
    enabled_prev = false
elseif not clan_tag:GetBool() and enabled_prev == false then
    set_clantag('')
    enabled_prev = true
end
end

ffi_handler = {}
ffi_handler.VGUI_System = ffi_cast(ffi_typeof('void***'), Utils_CreateInterface('vgui2.dll', 'VGUI_System010'))
ffi_handler.get_clipboard_text_length = ffi_cast('get_clipboard_text_length', ffi_handler.VGUI_System[0][7])
ffi_handler.get_clipboard_text = ffi_cast('get_clipboard_text', ffi_handler.VGUI_System[0][11])
ffi_handler.set_clipboard_text = ffi_cast('set_clipboard_text', ffi_handler.VGUI_System[0][9])
function Clipboard.Get()
local clipboard_text_length = ffi_handler.get_clipboard_text_length(ffi_handler.VGUI_System)

if (clipboard_text_length > 0) then
    local buffer = ffi_new('char[?]', clipboard_text_length)

    ffi_handler.get_clipboard_text(ffi_handler.VGUI_System, 0, buffer, clipboard_text_length * ffi_sizeof('char[?]', clipboard_text_length))
    return ffi_string(buffer, clipboard_text_length - 1)
end

return ''
end

function Clipboard.Set(text)
ffi_handler.set_clipboard_text(ffi_handler.VGUI_System, text, #text)
end


local JSON = Panorama_LoadString([[
return {
stringify: JSON.stringify,
parse: JSON.parse
};
]])()

cfg_data = {
bools = {
    dormant_aim,
    enable__aa,
    Hitmarker,
    auto_peek,
    vel_mod_ind,
    screen_dmg,
    avoid_backstab,
    conditions,
    override_on_use,
    override_stand,
    air_hitchance,
    noscope_hitchance,
    proper_baim,
    auto_teleport_in_air,
    override_crouch,
    override_slowwalk,
    override_move,
    override_air,
    enabled_antibrute,
    types[On_Use].mega_shit,
    types[Air].mega_shit,
    types[Crouch].mega_shit,
    types[SlowWalk].mega_shit,
    penetration_rainbow,
    types[Move].mega_shit,
    types[Stay].mega_shit,
    types[Shared].mega_shit,
    types[anti_aim_preset].mega_shit,
    types[Manual].mega_shit,
    types[On_Use].fakelag,
    types[Air].fakelag,
    types[Crouch].fakelag,
    types[SlowWalk].fakelag,
    types[Move].fakelag,
    types[Stay].fakelag,
    penetration,
    types[Shared].fakelag,
    types[anti_aim_preset].fakelag,
    types[Manual].fakelag,
    enable_b2,
    enable_b3,
    enable_b4,
    blur_back,
    custom_scope_switch,
    screen_dmg,
    clan_tag,
    hitsound_custom,
    shit_talk,
    idealpeek,
    advanced_shot_logger
},

ints = {
    air_hitchance_value,
    noscope_hitchance_value,
    dormant_mindmg,
    type,
    manual_yaw_base,
    yaw_on_use,
    scope_size,
    scope_gap,
    arrows_ind,
    teamskeet_kb,
    windows_value,
    types[On_Use].yaw_add_r,
    types[On_Use].yaw_add_l,
    types[On_Use].jitter_mode,
    types[On_Use].jitter,
    types[On_Use].jitter_value_min,
    types[On_Use].jitter_value_max,
    types[On_Use].fake_limit_type,
    types[On_Use].left_desync_value,
    types[On_Use].right_desync_value,
    types[On_Use].fake_option,
    types[On_Use].lby_mode,
    types[On_Use].freestand_desync,
    types[On_Use].desync_on_shot,
    types[On_Use].fakelag_value,
    types[On_Use].random_value,

    --types[Air].yaw,
    types[Air].yaw_add_r,
    types[Air].yaw_add_l,
    types[Air].jitter_mode,
    types[Air].jitter,
    types[Air].jitter_value_min,
    types[Air].jitter_value_max,
    types[Air].fake_limit_type,
    types[Air].left_desync_value,
    types[Air].right_desync_value,
    types[Air].fake_option,
    types[Air].lby_mode,
    types[Air].freestand_desync,
    types[Air].desync_on_shot,
    types[Air].fakelag_value,
    types[Air].random_value,
    penetration_position,
    penetration_speed,
    --types[Crouching].yaw,
    types[Crouch].yaw_add_r,
    types[Crouch].yaw_add_l,
    types[Crouch].jitter_mode,
    types[Crouch].jitter,
    types[Crouch].jitter_value_min,
    types[Crouch].jitter_value_max,
    types[Crouch].fake_limit_type,
    types[Crouch].left_desync_value,
    types[Crouch].right_desync_value,
    types[Crouch].fake_option,
    types[Crouch].lby_mode,
    types[Crouch].freestand_desync,
    types[Crouch].desync_on_shot,
    types[Crouch].fakelag_value,
    types[Crouch].random_value,

    --types[Slowwalk].yaw,
    types[SlowWalk].yaw_add_r,
    types[SlowWalk].yaw_add_l,
    types[SlowWalk].jitter_mode,
    types[SlowWalk].jitter,
    types[SlowWalk].jitter_value_min,
    types[SlowWalk].jitter_value_max,
    types[SlowWalk].fake_limit_type,
    types[SlowWalk].left_desync_value,
    types[SlowWalk].right_desync_value,
    types[SlowWalk].fake_option,
    types[SlowWalk].lby_mode,
    types[SlowWalk].freestand_desync,
    types[SlowWalk].desync_on_shot,
    types[SlowWalk].fakelag_value,
    types[SlowWalk].random_value,

    --types[Moving].yaw,
    types[Move].yaw_add_r,
    types[Move].yaw_add_l,
    types[Move].jitter_mode,
    types[Move].jitter,
    types[Move].jitter_value_min,
    types[Move].jitter_value_max,
    types[Move].fake_limit_type,
    types[Move].left_desync_value,
    types[Move].right_desync_value,
    types[Move].fake_option,
    types[Move].lby_mode,
    types[Move].freestand_desync,
    types[Move].desync_on_shot,
    types[Move].fakelag_value,
    types[Move].random_value,

    --types[Standing].yaw,
    types[Stay].yaw_add_r,
    types[Stay].yaw_add_l,
    types[Stay].jitter_mode,
    types[Stay].jitter,
    types[Stay].jitter_value_min,
    types[Stay].jitter_value_max,
    types[Stay].fake_limit_type,
    types[Stay].left_desync_value,
    types[Stay].right_desync_value,
    types[Stay].fake_option,
    types[Stay].lby_mode,
    types[Stay].freestand_desync,
    types[Stay].desync_on_shot,
    types[Stay].fakelag_value,
    types[Stay].random_value,

    --types[Shared].yaw,
    types[Shared].yaw_add_r,
    types[Shared].yaw_add_l,
    types[Shared].jitter_mode,
    types[Shared].jitter,
    types[Shared].jitter_value_min,
    types[Shared].jitter_value_max,
    types[Shared].fake_limit_type,
    types[Shared].left_desync_value,
    types[Shared].right_desync_value,
    types[Shared].fake_option,
    types[Shared].lby_mode,
    types[Shared].freestand_desync,
    types[Shared].desync_on_shot,
    types[Shared].fakelag_value,
    types[Shared].random_value,

    types[anti_aim_preset].yaw_add_r,
    types[anti_aim_preset].yaw_add_l,
    types[anti_aim_preset].jitter_mode,
    types[anti_aim_preset].jitter,
    types[anti_aim_preset].jitter_value_min,
    types[anti_aim_preset].jitter_value_max,
    types[anti_aim_preset].fake_limit_type,
    types[anti_aim_preset].left_desync_value,
    types[anti_aim_preset].right_desync_value,
    types[anti_aim_preset].fake_option,
    types[anti_aim_preset].lby_mode,
    types[anti_aim_preset].freestand_desync,
    types[anti_aim_preset].desync_on_shot,
    types[anti_aim_preset].fakelag_value,
    types[anti_aim_preset].random_value,

    types[Manual].yaw_add_r,
    types[Manual].yaw_add_l,
    types[Manual].jitter_mode,
    types[Manual].jitter,
    types[Manual].jitter_value_min,
    types[Manual].jitter_value_max,
    types[Manual].fake_limit_type,
    types[Manual].left_desync_value,
    types[Manual].right_desync_value,
    types[Manual].fake_option,
    types[Manual].lby_mode,
    types[Manual].freestand_desync,
    types[Manual].desync_on_shot,
    types[Manual].fakelag_value,
    types[Manual].random_value,

    jitter_b1,
    lby_mode_b1,
    jitter_b2,
    lby_mode_b2,
    jitter_b3,
    lby_mode_b3,
    jitter_b4,
    lby_mode_b4,
    yaw_add_l_b1,
    yaw_add_r_b1,
    jitter_value_b1,
    phase1,
    yaw_add_l_b2,
    yaw_add_r_b2,
    jitter_value_b2,
    phase2,
    yaw_add_l_b3,
    yaw_add_r_b3,
    jitter_value_b3,
    phase3,
    yaw_add_l_b4,
    yaw_add_r_b4,
    jitter_value_b4,
    phase4,
    indicators_style,
    indicators_add,
    teleport_weapons,
    screen_dmg_x,
    screen_dmg_y,
    vel_mod_add_x,
    vel_mod_add_y,
    alpha_slider,
    keybinds_x,
    keybinds_y
},

floats = {

},

strings = {

},

colors = {
    Hitmarker,
    auto_peek,
    penetration,
    accent_color
}
}

de_en_coding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='

function encode(data)
return ((data:gsub('.', function(x)
local r,de_en_coding='',x:byte()
for i=8,1,-1 do r=r..(de_en_coding%2^i-de_en_coding%2^(i-1)>0 and '1' or '0') end
return r;
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c=0
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
return de_en_coding:sub(c+1,c+1)
end)..({ '', '==', '=' })[#data%3+1])
end

function decode(data)
data = string_gsub(data, '[^'..de_en_coding..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(de_en_coding:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string_char(c)
end))
end

export_cfg:RegisterCallback(function()
local Code = {{}, {}, {}, {}, {}}

for _, bools in pairs(cfg_data.bools) do
table_insert(Code[1], bools:GetBool())
end

for _, ints in pairs(cfg_data.ints) do
table_insert(Code[2], ints:GetInt())
end

for _, floats in pairs(cfg_data.floats) do
table_insert(Code[3], floats:GetFloat())
end

for _, strings in pairs(cfg_data.strings) do
table_insert(Code[4], strings:GetString())
end

for _, colors in pairs(cfg_data.colors) do
local clr = colors:GetColor()
table_insert(Code[5], string_format('%02X%02X%02X%02X', math_floor(clr.r * 255), math_floor(clr.g * 255), math_floor(clr.b * 255), math_floor(clr.a * 255)))
end

Clipboard.Set(encode(JSON.stringify(Code)))
end)

function loadcfg(text)
decode_cfg = JSON.parse(decode(text))
if decode_cfg == nil then
print('Error!')
else
for k, v in pairs(decode_cfg) do
    k = ({[1] = 'bools', [2] = 'ints', [3] = 'floats', [4] = 'strings', [5] = 'colors'})[k]

    for k2, v2 in pairs(v) do
        if (k == 'bools') then
            cfg_data[k][k2]:SetBool(v2)
        end

        if (k == 'ints') then
            cfg_data[k][k2]:SetInt(v2)
        end

        if (k == 'floats') then
            cfg_data[k][k2]:SetFloat(v2)
        end

        if (k == 'strings') then
            cfg_data[k][k2]:SetString(v2)
        end

        if (k == 'colors') then
            cfg_data[k][k2]:SetColor(Color_new(tonumber('0x'..v2:sub(1, 2))/255, tonumber('0x'..v2:sub(3, 4))/255, tonumber('0x'..v2:sub(5, 6))/255, tonumber('0x'..v2:sub(7, 8))/255))
        end
    end
end
end
end
import_cfg:RegisterCallback(function()
    loadcfg(Clipboard.Get())
end)
default_cfg:RegisterCallback(function()
    Http.GetAsync('https://www.toptal.com/developers/hastebin/raw/ovosovobuh', function(url_content)
        loadcfg(url_content)
    end)
end)

Cheat_RegisterCallback("frame_stage", function(s)
if not EngineClient_IsInGame() or not EngineClient_IsConnected() or EntityList_GetLocalPlayer() == nil then return end
if s == 5 then
on_run_command()
if request_time + 1 < GlobalVars.curtime then
    frametime = GlobalVars.frametime
    request_time = GlobalVars.curtime
    table_insert(frametimes, 1, frametime)

    if #frametimes > 4 then
        table_remove(frametimes, i)
    end
end
end
end)

Cheat_RegisterCallback('registered_shot', function(shot)
reg_shot(shot)


if advanced_shot_logger:GetBool() then
registered_shot(shot)
end
end)

Cheat_RegisterCallback('destroy', function()
Menu_FindVar('Visuals', 'View', 'Camera', 'Remove Scope'):SetInt(ref_remove_scope)
CVar_FindVar('sv_disable_radar'):SetInt(0);

end)

Cheat_RegisterCallback('createmove', function(cmd)
if roll_aa_active == true then
actual_move = Vector2_new(cmd.forwardmove, cmd.sidemove) / 2
else
actual_move = Vector2_new(cmd.forwardmove, cmd.sidemove)
end
roll_move_fix(cmd)
update_choked()

end)

Cheat_RegisterCallback('prediction', function(cmd)
    if proper_baim:GetBool() then
        proper_baim_lethal()
    end
teleport_in_air()
dormant_aimbot(cmd)
anti_aims(cmd)
if idealpeek:GetBool() then
ideal_peek()
end
end)

Cheat_RegisterCallback('pre_prediction', function(cmd)
    if penetration:GetBool() then
        prenetration_prediction()
    end
end)

Cheat_RegisterCallback('events', function(e)
load_markers_modules(e)
resetter(e)
anti_bruteforcee(e)
if hitsound_custom:GetBool() then
custom_hitsound(e)
end
if shit_talk:GetBool() then
trashtalk(e)
end
end)

--anti_bruteforce_work.phases:SetVisible(false)

Cheat_RegisterCallback('draw', function()
    if penetration:GetBool() then
        penetration_ind()
    end
if Hitmarker:GetBool() then
damage_markerd()

move_position()
end

if auto_peek:GetBool() then
autopeek()
end
if custom_scope_switch:GetBool() then
custom_scope()
end
if clan_tag:GetBool() then
clantag()
end
handle_brutforcetime()
indicators()
log_draw()
if windows_value:Get(2) then
keybinds()
end
if windows_value:Get(1) then
watermark()
end
if windows_value:Get(3) or windows_value:Get(4) then
solus_ui()
end

if Cheat_IsMenuVisible() then
dormant_mindmg:SetVisible(dormant_aim:GetBool())
air_hitchance_value:SetVisible(air_hitchance:GetBool())
noscope_hitchance_value:SetVisible(noscope_hitchance:GetBool())
teleport_weapons:SetVisible(auto_teleport_in_air:GetBool())
for k,v in pairs(types) do
    for i,data in pairs(v) do
        if conditions:GetBool() and enable__aa:GetBool() then data:SetVisible(type:Get()+1 == k and enable__aa:GetBool()) else data:SetVisible(9 == k and enable__aa:GetBool()) end
        if conditions:GetBool() and enable__aa:GetBool() and type:Get() == 8 then
            data:SetVisible(false)
        end
    end
end
avoid_backstab:SetVisible(enable__aa:GetBool())
conditions:SetVisible(enable__aa:GetBool())
type:SetVisible(conditions:GetBool() and enable__aa:GetBool())
yaw_on_use:SetVisible(override_on_use:GetBool() and conditions:GetBool() and enable__aa:GetBool() and type:Get() == 1)
override_on_use:SetVisible(type:Get() == 1 and conditions:GetBool() and enable__aa:GetBool() )
override_stand:SetVisible(type:Get() == 2 and conditions:GetBool() and enable__aa:GetBool() )
override_crouch:SetVisible(type:Get() == 3 and conditions:GetBool() and enable__aa:GetBool() )
override_slowwalk:SetVisible(type:Get() == 4 and conditions:GetBool() and enable__aa:GetBool() )
override_move:SetVisible(type:Get() == 5 and conditions:GetBool() and enable__aa:GetBool() )
override_air:SetVisible(type:Get() == 6 and conditions:GetBool() and enable__aa:GetBool())
override_manual:SetVisible(type:Get() == 7 and conditions:GetBool() and enable__aa:GetBool())
enabled_antibrute:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool())
enable_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
yaw_add_l_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
yaw_add_r_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
jitter_b1:SetVisible(type:Get() == 8 and enable__aa:GetBool() )
jitter_value_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
lby_mode_b1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
phase1:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() )
teamskeet_kb:SetVisible(windows_value:Get(2))
gradient:SetVisible(windows_value:Get(2) and teamskeet_kb:Get() == 0)
yaw_add_l_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
yaw_add_r_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
jitter_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
jitter_value_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
lby_mode_b2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
phase2:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )

enable_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b2:GetBool() )
yaw_add_l_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_r_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_value_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
lby_mode_b3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
phase3:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
penetration_position:SetVisible(penetration:GetBool())
    penetration_rainbow:SetVisible(penetration:GetBool())
    penetration_speed:SetVisible(penetration:GetBool())
enable_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_l_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
yaw_add_r_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
jitter_value_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
lby_mode_b4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )
phase4:SetVisible(type:Get() == 8 and conditions:GetBool() and enable__aa:GetBool() and enable_b4:GetBool() and enable_b3:GetBool() and enable_b2:GetBool() )


indicators_add:SetVisible(indicators_style:GetBool(1))
alpha_slider:SetVisible(windows_value:Get(2) or windows_value:Get(3) or windows_value:Get(4) or windows_value:Get(1))
blur_back:SetVisible(windows_value:Get(2) or windows_value:Get(3) or windows_value:Get(4) or windows_value:Get(1))
scope_size:SetVisible(custom_scope_switch:GetBool())
scope_gap:SetVisible(custom_scope_switch:GetBool())
scope_color:SetVisible(custom_scope_switch:GetBool())
screen_dmg_x:SetVisible(screen_dmg:GetBool())
vel_mod_add_x:SetVisible(vel_mod_ind:GetBool())
vel_mod_add_y:SetVisible(vel_mod_ind:GetBool())
screen_dmg_y:SetVisible(screen_dmg:GetBool())
end

end)

Пожалуйста, авторизуйтесь для просмотра ссылки.
кинь фикс
 
Сверху Снизу