Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Essentials Lua By The_Belch
- -- dependencies
- print("Successfully Loaded Aimware Essentials Lua")
- local menuloc = gui.Reference("SETTINGS", "MISCELLANEOUS");
- local draw_Line, draw_TextShadow, draw_Color, draw_Text, draw_FilledRect, client_WorldToScreen, draw_GetScreenSize, client_GetConVar, client_SetConVar, client_exec, PlayerNameByUserID, PlayerIndexByUserID, GetLocalPlayer, gui_SetValue, gui_GetValue, LocalPlayerIndex, c_AllowListener, cb_Register, g_tickcount, g_realtime, g_curtime, math_floor, math_sqrt, GetPlayerResources, entities_FindByClass, GetPlayerResources = draw.Line, draw.TextShadow, draw.Color, draw.Text, draw.FilledRect, client.WorldToScreen, draw.GetScreenSize, client.GetConVar, client.SetConVar, client.Command, client.GetPlayerNameByUserID, client.GetPlayerIndexByUserID, entities.GetLocalPlayer, gui.SetValue, gui.GetValue, client.GetLocalPlayerIndex, client.AllowListener, callbacks.Register, globals.TickCount, globals.RealTime, globals.CurTime, math.floor, math.sqrt, entities.GetPlayerResources, entities.FindByClass, entities.GetPlayerResources
- -- GUI Additions
- local essentialsmenu = gui.Checkbox(menuloc, "essentialslua", "Show Aimware Essentials", false);
- -- window
- local window = gui.Window("essentialswindow", "Aimware Essentials", 1200, 300, 500, 700)
- local hvhgroupbox = gui.Groupbox(window, "HvH Essentials", 10, 20, 230, 300)
- local visualsgroupbox = gui.Groupbox(window, "Visuals Essentials", 260, 20, 230, 300)
- local miscgroupbox = gui. Groupbox(window, "Misc Essentials", 260, 350, 230, 300)
- -----------------------------HVH-------------------------
- -- jumpshot
- -- fakeduck improvements
- -- fakeduck indicator
- -- autobuy
- local Autobuy_Text = gui.Text( hvhgroupbox, "Autobuy" );
- local Autobuy_Enable = gui.Checkbox( hvhgroupbox, "lua_autobuy_enable", "Enable", 0 );
- local Autobuy_PrimaryWeapon = gui.Combobox( hvhgroupbox, "lua_autobuy_primaryweapon", "Primary Weapon", "Off", "Auto", "Scout", "AWP", "Rifle", "Famas : Galil AR", "AUG : SG 553", "MP9 : MAC-10", "MP7 : MP5-SD", "UMP-45", "P90", "PP-Bizon", "Nova", "XM1014", "MAG-7 : Sawed-Off", "M249", "Negev" );
- local Autobuy_SecondaryWeapon = gui.Combobox( hvhgroupbox, "lua_autobuy_secondaryweapon", "Secondary Weapon", "Off", "Dual Berettas", "P250", "Five-Seven : CZ75-Auto : Tec-9", "Desert Eagle : R8 Revolver" );
- local Autobuy_Armor = gui.Combobox( hvhgroupbox, "lua_autobuy_armor", "Armor", "Off", "Kevlar", "Kevlar + Helmet" );
- local Autobuy_Defuser = gui.Checkbox( hvhgroupbox, "lua_autobuy_defuser", "Defuser", 0 );
- local Autobuy_Taser = gui.Checkbox( hvhgroupbox, "lua_autobuy_taser", "Taser", 0 );
- local Autobuy_HEGrenade = gui.Checkbox( hvhgroupbox, "lua_autobuy_hegrenade", "HE Grenade", 0 );
- local Autobuy_Smoke = gui.Checkbox( hvhgroupbox, "lua_autobuy_smoke", "Smoke", 0 );
- local Autobuy_Molotov = gui.Checkbox( hvhgroupbox, "lua_autobuy_molotov", "Molotov", 0 );
- local Autobuy_Flashbang = gui.Checkbox( hvhgroupbox, "lua_autobuy_flashbang", "Flashbang", 0 );
- local Autobuy_Decoy = gui.Checkbox( hvhgroupbox, "lua_autobuy_decoy", "Decoy", 0 );
- local Money = 0
- local function LocalPlayerMoney()
- if Autobuy_Enable:GetValue() then
- if entities.GetLocalPlayer() ~= nil then
- Money = entities.GetLocalPlayer():GetProp( "m_iAccount" )
- end
- end
- end
- local function Autobuy( Event )
- local PrimaryWeapon = Autobuy_PrimaryWeapon:GetValue()
- local SecondaryWeapon = Autobuy_SecondaryWeapon:GetValue()
- local Armor = Autobuy_Armor:GetValue()
- if Autobuy_Enable:GetValue() then
- if Event:GetName() ~= "player_spawn" then
- return;
- end
- local INT_UID = Event:GetInt( "userid" );
- local PlayerIndex = client.GetPlayerIndexByUserID( INT_UID );
- if client.GetLocalPlayerIndex() == PlayerIndex then
- ME = true
- else
- ME = false
- end
- if ME and Money == 0 then
- -- Primary Weapon
- if PrimaryWeapon == 1 then client.Command( "buy scar20", true ); -- Auto
- elseif PrimaryWeapon == 2 then client.Command( "buy ssg08", true ); -- Scout
- elseif PrimaryWeapon == 3 then client.Command( "buy awp", true ); -- AWP
- elseif PrimaryWeapon == 4 then client.Command( "buy ak47", true ); -- Rifle
- elseif PrimaryWeapon == 5 then client.Command( "buy famas", true ); -- Famas : Galil AR
- elseif PrimaryWeapon == 6 then client.Command( "buy aug", true ); -- AUG : SG 553
- elseif PrimaryWeapon == 7 then client.Command( "buy mac10", true ); -- MP9 : MAC-10
- elseif PrimaryWeapon == 8 then client.Command( "buy mp7", true ); -- MP7 : MP5-SD
- elseif PrimaryWeapon == 9 then client.Command( "buy ump45", true ); -- UMP-45
- elseif PrimaryWeapon == 10 then client.Command( "buy p90", true ); -- P90
- elseif PrimaryWeapon == 11 then client.Command( "buy bizon", true ); -- PP-Bizon
- elseif PrimaryWeapon == 12 then client.Command( "buy nova", true ); -- Nova
- elseif PrimaryWeapon == 13 then client.Command( "buy xm1014", true ); -- XM1014
- elseif PrimaryWeapon == 14 then client.Command( "buy mag7", true ); -- MAG-7 : Sawed-Off
- elseif PrimaryWeapon == 15 then client.Command( "buy m249", true ); -- M249
- elseif PrimaryWeapon == 16 then client.Command( "buy negev", true ); -- Negev
- end
- -- Secondary Weapon
- if SecondaryWeapon == 1 then client.Command( "buy elite", true ); -- Dual Berettas
- elseif SecondaryWeapon == 2 then client.Command( "buy p250", true ); -- P250
- elseif SecondaryWeapon == 3 then client.Command( "buy tec9", true ); -- Five-Seven : CZ75-Auto : Tec-9
- elseif SecondaryWeapon == 4 then client.Command( "buy deagle", true ); -- Desert Eagle : R8 Revolver
- end
- -- Taser
- if Autobuy_Taser:GetValue() then
- client.Command( "buy taser", true );
- end
- elseif ME and Money <= 800 then
- -- Secondary Weapon
- if SecondaryWeapon == 1 then client.Command( "buy elite", true ); -- Dual Berettas
- elseif SecondaryWeapon == 2 then client.Command( "buy p250", true ); -- P250
- elseif SecondaryWeapon == 3 then client.Command( "buy tec9", true ); -- Five-Seven : CZ75-Auto : Tec-9
- elseif SecondaryWeapon == 4 then client.Command( "buy deagle", true ); -- Desert Eagle : R8 Revolver
- end
- -- Taser
- if Autobuy_Taser:GetValue() then
- client.Command( "buy taser", true );
- end
- elseif ME and Money > 800 then
- -- Primary Weapon
- if PrimaryWeapon == 1 then client.Command( "buy scar20", true ); -- Auto
- elseif PrimaryWeapon == 2 then client.Command( "buy ssg08", true ); -- Scout
- elseif PrimaryWeapon == 3 then client.Command( "buy awp", true ); -- AWP
- elseif PrimaryWeapon == 4 then client.Command( "buy ak47", true ); -- Rifle
- elseif PrimaryWeapon == 5 then client.Command( "buy famas", true ); -- Famas : Galil AR
- elseif PrimaryWeapon == 6 then client.Command( "buy aug", true ); -- AUG : SG 553
- elseif PrimaryWeapon == 7 then client.Command( "buy mac10", true ); -- MP9 : MAC-10
- elseif PrimaryWeapon == 8 then client.Command( "buy mp7", true ); -- MP7 : MP5-SD
- elseif PrimaryWeapon == 9 then client.Command( "buy ump45", true ); -- UMP-45
- elseif PrimaryWeapon == 10 then client.Command( "buy p90", true ); -- P90
- elseif PrimaryWeapon == 11 then client.Command( "buy bizon", true ); -- PP-Bizon
- elseif PrimaryWeapon == 12 then client.Command( "buy nova", true ); -- Nova
- elseif PrimaryWeapon == 13 then client.Command( "buy xm1014", true ); -- XM1014
- elseif PrimaryWeapon == 14 then client.Command( "buy mag7", true ); -- MAG-7 : Sawed-Off
- elseif PrimaryWeapon == 15 then client.Command( "buy m249", true ); -- M249
- elseif PrimaryWeapon == 16 then client.Command( "buy negev", true ); -- Negev
- end
- -- Secondary Weapon
- if SecondaryWeapon == 1 then client.Command( "buy elite", true ); -- Dual Berettas
- elseif SecondaryWeapon == 2 then client.Command( "buy p250", true ); -- P250
- elseif SecondaryWeapon == 3 then client.Command( "buy tec9", true ); -- Five-Seven : CZ75-Auto : Tec-9
- elseif SecondaryWeapon == 4 then client.Command( "buy deagle", true ); -- Desert Eagle : R8 Revolver
- end
- -- Armor
- if Armor == 1 then client.Command( "buy vest", true );
- elseif Armor == 2 then client.Command( "buy vesthelm", true );
- end
- -- Defuser
- if Autobuy_Defuser:GetValue() then
- client.Command( "buy defuser", true );
- end
- -- Taser
- if Autobuy_Taser:GetValue() then
- client.Command( "buy taser", true );
- end
- -- HE Grenade
- if Autobuy_HEGrenade:GetValue() then
- client.Command( "buy hegrenade", true );
- end
- -- Smoke
- if Autobuy_Smoke:GetValue() then
- client.Command( "buy smokegrenade", true );
- end
- -- Molotov
- if Autobuy_Molotov:GetValue() then
- client.Command( "buy molotov", true );
- end
- -- Flashbang
- if Autobuy_Flashbang:GetValue() then
- client.Command( "buy flashbang", true );
- end
- -- Decoy
- if Autobuy_Decoy:GetValue() then
- client.Command( "buy decoy", true );
- end
- end
- end
- end
- client.AllowListener( "player_spawn" )
- callbacks.Register( "Draw", "Local Player Money", LocalPlayerMoney )
- callbacks.Register( "FireGameEvent", "Autobuy", Autobuy )
- ----------------------VISUALS-------------------------
- -- bomb timer
- local bombtimer = gui.Checkbox(visualsgroupbox, "bombtimer", "Bomb Timer", false)
- local ref = gui.Reference("MISC", "GENERAL", "Main");
- local mouseX, mouseY, x, y, dx, dy, w, h = 0, 0, 650, 10, 0, 0, 400, 50;
- local shouldDrag = false;
- local fonticon = draw.CreateFont("icomoon", 25, 25);
- local fontinfo = draw.CreateFont("Verdana", 15, 15);
- local fonttext = draw.CreateFont("Verdana", 15, 15);
- local fontbombtext = draw.CreateFont("skeet Smallest Pixel-7 Modified", 10, 15);
- local defusing = false;
- function EventHook(Event)
- if gui.GetValue("bombtimer") == true then
- if Event:GetName() == "bomb_begindefuse" then
- defusing = true;
- elseif Event:GetName() == "bomb_abortdefuse" then
- defusing = false;
- elseif Event:GetName() == "round_officially_ended"
- or Event:GetName() == "bomb_defused" or Event:GetName() == "bomb_exploded" then
- defusing = false;
- end
- end
- local function dragFeature()
- if input.IsButtonDown(1) then
- mouseX, mouseY = input.GetMousePos();
- if shouldDrag then
- x = mouseX - dx;
- y = mouseY - dy;
- end
- if mouseX >= x and mouseX <= x + w and mouseY >= y and mouseY <= y + 40 then
- shouldDrag = true;
- dx = mouseX - x;
- dy = mouseY - y;
- end
- else
- shouldDrag = false;
- end
- end
- local function drawTimer()
- if entities.FindByClass("CPlantedC4")[1] ~= nil then
- local Bomb = entities.FindByClass("CPlantedC4")[1];
- if Bomb:GetProp("m_bBombTicking") and Bomb:GetProp("m_bBombDefused") == 0 and globals.CurTime() < Bomb:GetProp("m_flC4Blow") then
- local Player = entities.GetLocalPlayer();
- if defusing == true then
- local BombMath = ((globals.CurTime() - Bomb:GetProp("m_flDefuseCountDown")) * 0.5) / ((Bomb:GetProp("m_flDefuseCountDown") - Bomb:GetProp("m_flDefuseLength")) - Bomb:GetProp("m_flDefuseCountDown")) + 1;
- draw.Color(8, 8, 8, 30)
- draw.FilledRect(x, y, x + w, y + h)
- draw.FilledRect(x - 65, y, x + (w - 405), y + h )
- draw.Color(8, 8, 8, 90)
- draw.FilledRect(x + 20, y + 20, x + (w - 20), y + h - 20)
- draw.Color(0, 150, 255, 240)
- draw.FilledRect(x + 20, y + 20, (x + 20) * BombMath, y + h - 20)
- draw.Color(180, 180, 180, 120)
- draw.OutlinedRect(x, y, x + w, y + h)
- draw.OutlinedRect(x - 65,y , x + (w - 405), y + h)
- draw.Color(255, 255, 255, 255)
- draw.SetFont(fontbombtext)
- draw.Text(x - 48, y + 30, "BOMB")
- draw.SetFont(fonticon)
- draw.Text(x - 50, y + 10, "y")
- else
- local BombMath = ((globals.CurTime() - Bomb:GetProp("m_flC4Blow")) * 0.5) / ((Bomb:GetProp("m_flC4Blow") - Bomb:GetProp("m_flTimerLength")) - Bomb:GetProp("m_flC4Blow")) + 1;
- draw.Color(8, 8, 8, 30)
- draw.FilledRect(x, y, x + w, y + h)
- draw.FilledRect(x - 65, y, x + (w - 405), y + h )
- draw.Color(8, 8, 8, 90)
- draw.FilledRect(x + 20, y + 20, x + (w - 20), y + h - 20)
- draw.Color(130, 255, 0, 240)
- draw.FilledRect(x + 20, y + 20, (x + 20) * BombMath, y + h - 20)
- draw.Color(180, 180, 180, 120)
- draw.OutlinedRect(x, y, x + w, y + h)
- draw.OutlinedRect(x - 65,y , x + (w - 405), y + h)
- draw.Color(255, 255, 255, 255)
- draw.SetFont(fontbombtext)
- draw.Text(x - 48, y + 30, "BOMB")
- draw.SetFont(fonticon)
- draw.Text(x - 50, y + 10, "y")
- end
- if Player:IsAlive() and globals.CurTime() < Bomb:GetProp("m_flC4Blow") then
- if math.floor(0.5 + BombDamage(Bomb, Player)) >= Player:GetHealth() then
- draw.Color(255, 0, 0, 255)
- draw.SetFont(fontinfo)
- draw.Text(5, 0, "LETHAL");
- draw.TextShadow(5, 0, "LETHAL");
- else
- draw.Color(255, 255, 255, 255)
- draw.SetFont(fontinfo)
- draw.Text(5, 0, math.floor(0.5 + BombDamage(Bomb, Player)) .. " HP");
- draw.TextShadow(5, 0, math.floor(0.5 + BombDamage(Bomb, Player)) .. " HP");
- end
- end
- end
- end
- end
- function BombDamage(Bomb, Player)
- local C4Distance = math.sqrt((select(1,Bomb:GetAbsOrigin()) - select(1,Player:GetAbsOrigin())) ^ 2 +
- (select(2,Bomb:GetAbsOrigin()) - select(2,Player:GetAbsOrigin())) ^ 2 +
- (select(3,Bomb:GetAbsOrigin()) - select(3,Player:GetAbsOrigin())) ^ 2);
- local Gauss = (C4Distance - 75.68) / 789.2
- local flDamage = 450.7 * math.exp(-Gauss * Gauss);
- if Player:GetProp("m_ArmorValue") > 0 then
- local flArmorRatio = 0.5;
- local flArmorBonus = 0.5;
- if Player:GetProp("m_ArmorValue") > 0 then
- local flNew = flDamage * flArmorRatio;
- local flArmor = (flDamage - flNew) * flArmorBonus;
- if flArmor > Player:GetProp("m_ArmorValue") then
- flArmor = Player:GetProp("m_ArmorValue") * (1 / flArmorBonus);
- flNew = flDamage - flArmor;
- end
- flDamage = flNew;
- end
- end
- return math.max(flDamage, 0);
- end
- callbacks.Register( "Draw", "drag", dragFeature)
- callbacks.Register("FireGameEvent", "EventHookB", EventHook);
- callbacks.Register( "Draw", "drawTimer", drawTimer );
- end
- -- disable post prossesing
- local disablepost = gui.Checkbox(visualsgroupbox, "vis_disable_post", "Disable Post Processing", false)
- function disablepp()
- if disablepost:GetValue() then client_SetConVar("mat_postprocess_enable", 0, true); else client_SetConVar("mat_postprocess_enable", 1, true); end end
- cb_Register('Draw', "Disable Post Processing" ,disablepp);
- -- full bright
- local fullbright = gui.Checkbox(visualsgroupbox, "fulbright", "Full Bright", false)
- function full_bright() if fullbright:GetValue() then client_SetConVar("mat_fullbright", 1, true); else client_SetConVar("mat_fullbright", 0, true); end end
- cb_Register('Draw', "Full brightness" ,full_bright);
- -- scoped fov fix
- -- engine radar
- local ERadar = gui.Checkbox(visualsgroupbox, "esp_engine_radar", "Engine Radar", false)
- function engineradar()
- if ERadar:GetValue() then ERval = 1; else ERval = 0; end
- for o, radar in pairs(entities_FindByClass("CCSPlayer")) do radar:SetProp("m_bSpotted", ERval); end end
- cb_Register("Draw", "engine radar", engineradar);
- -- sniper crosshairs
- local ComboCrosshair = gui.Combobox(visualsgroupbox, "vis_sniper_crosshair", "Force Sniper Crosshairs", "Off", "Force Crosshair", "Force Crosshair (+Scoped)", "Aimware Crosshair", "Draw Crosshair")
- function ifCrosshair()
- if GetLocalPlayer() == nil then return; end
- local Weapon = GetLocalPlayer():GetPropEntity("m_hActiveWeapon");
- local Scoped = GetLocalPlayer():GetProp("m_bIsScoped") == 1 or GetLocalPlayer():GetProp("m_bIsScoped") == 257
- if Weapon == nil then return; end
- local cWep = Weapon:GetClass();
- if cWep == "CWeaponAWP" or cWep == "CWeaponSSG08" or cWep == "CWeaponSCAR20" or cWep == "CWeaponG3SG1" then drawCrosshair = true;
- else drawCrosshair = false; end
- local screenCenterX, screenY = draw_GetScreenSize(); local scX, scY = screenCenterX / 2, screenY / 2;
- if drawCrosshair == true and ComboCrosshair:GetValue() == 0 then client_SetConVar("weapon_debug_spread_show", 0, true)
- elseif drawCrosshair == true and ComboCrosshair:GetValue() == 1 then gui_SetValue('esp_crosshair', false); if Scoped then client_SetConVar("weapon_debug_spread_show", 0, true); else client_SetConVar("weapon_debug_spread_show", 3, true) end
- elseif drawCrosshair == true and ComboCrosshair:GetValue() == 2 then gui_SetValue('esp_crosshair', false); client_SetConVar("weapon_debug_spread_show", 3, true)
- elseif drawCrosshair == true and ComboCrosshair:GetValue() == 3 then if Scoped then gui_SetValue('esp_crosshair', false); else client_SetConVar("weapon_debug_spread_show", 0, true); gui_SetValue('esp_crosshair', true); end
- elseif drawCrosshair == false and ComboCrosshair:GetValue() == 3 then gui_SetValue('esp_crosshair', false)
- elseif drawCrosshair == true and ComboCrosshair:GetValue() == 4 then client_SetConVar("weapon_debug_spread_show", 0, true); gui_SetValue('esp_crosshair', false); draw.SetFont(ff);
- draw_Color(255,255,255,255); draw_Line(scX, scY - 8, scX, scY + 8); --[[ line down ]] draw_Line(scX - 8, scY, scX + 8, scY); --[[ line across ]] end end
- cb_Register("Draw", "sniper crosshairs", ifCrosshair);
- ---------------------------MISC------------------------
- -- viewmodel changer
- local function VM_Cache() xO = client_GetConVar("viewmodel_offset_x"); yO = client_GetConVar("viewmodel_offset_y"); zO = client_GetConVar("viewmodel_offset_z"); fO = client_GetConVar("viewmodel_fov"); end; VM_Cache()
- local show2, pressed2 = false, true
- local ViewModelShown = gui.Checkbox(miscgroupbox, "msc_vme", "Viewmodel Changer", false)
- local VM_W = gui.Window("VM_W", "Viewmodel Changer", 200,200,200,300)
- local VMStuff = gui.Groupbox(VM_W, "Viewmodel Changer", 15, 14, 170, 240)
- local VM_e = gui.Checkbox(VMStuff, "msc_vme", "Enable", false)
- local xS = gui.Slider(VMStuff, "VM_X", "X", xO, -20, 20)
- local yS = gui.Slider(VMStuff, "VM_Y", "Y", yO, -100, 100)
- local zS = gui.Slider(VMStuff, "VM_Z", "Z", zO, -20, 20)
- function press2() if ViewModelShown:GetValue() then show2 = true; else show2 = false; end if input.IsButtonPressed(gui_GetValue("msc_menutoggle")) then if pressed2 == true then pressed2 = false; else pressed2 = true; end end end
- function shows2() if show2 == true and pressed2 == true then VM_W:SetActive(1); elseif show2 == true and pressed2 == false or show2 == false and pressed2 == true or show2 == false and pressed2 == false then VM_W:SetActive(0); end end
- function VM_E() if VM_e:GetValue() then client_SetConVar("viewmodel_offset_x", xS:GetValue(), true); client_SetConVar("viewmodel_offset_y", yS:GetValue(), true); client_SetConVar("viewmodel_offset_z", zS:GetValue(), true);
- else client_SetConVar("viewmodel_offset_x", 2.0, true); client_SetConVar("viewmodel_offset_y", 0.0, true); client_SetConVar("viewmodel_offset_z", -2.0, true); end end
- cb_Register("Draw", "p2", press2); cb_Register("Draw", "s2", shows2); cb_Register("Draw", "vm sets", VM_E);
- -- aspect ratio
- local aspect_ratio_table = {};
- local aspect_ratio_check = gui.Checkbox(miscgroupbox, "msc_aspect_enable", "Aspect Ratio Changer", false)
- local aspect_ratio_reference = gui.Slider(miscgroupbox, "msc_aspect_value", "Force aspect ratio", 100, 1, 199) -- % times your original ratio
- local function gcd(m, n) while m ~= 0 do m, n = math.fmod(n, m), m; end return n; end
- local function set_aspect_ratio(aspect_ratio_multiplier) local screen_width, screen_height = draw_GetScreenSize(); local aspectratio_value = (screen_width*aspect_ratio_multiplier)/screen_height; if aspect_ratio_multiplier == 1 or not aspect_ratio_check:GetValue() then aspectratio_value = 0; end client_SetConVar( "r_aspectratio", tonumber(aspectratio_value), true); end
- local function on_aspect_ratio_changed() local screen_width, screen_height = draw_GetScreenSize(); for i=1, 200 do local i2=i*0.01; i2 = 2 - i2; local divisor = gcd(screen_width*i2, screen_height); if screen_width*i2/divisor < 100 or i2 == 1 then aspect_ratio_table[i] = screen_width*i2/divisor .. ":" .. screen_height/divisor; end end local aspect_ratio = aspect_ratio_reference:GetValue()*0.01; aspect_ratio = 2 - aspect_ratio; set_aspect_ratio(aspect_ratio); end
- cb_Register('Draw', "aspect ratio" ,on_aspect_ratio_changed);
- -- knife on left hand
- -- skeet hitsoud
- local MSC_PART_REF = gui.Reference( "MISC", "ENHANCEMENT", "Hitmarkers" );
- local AWMetallicHitsound = gui.Checkbox( miscgroupbox, "lua_hitsound", "Metallic Hitsound (Skeet)", 0 );
- local function MetallicHitsound( Event )
- if AWMetallicHitsound:GetValue() then
- if gui.GetValue( "msc_hitmarker_enable" ) then
- gui.SetValue( "msc_hitmarker_enable", 0 );
- end
- if ( Event:GetName() == "player_hurt" ) then
- local ME = client.GetLocalPlayerIndex();
- local INT_UID = Event:GetInt( "userid" );
- local INT_ATTACKER = Event:GetInt( "attacker" );
- local NAME_Victim = client.GetPlayerNameByUserID( INT_UID );
- local INDEX_Victim = client.GetPlayerIndexByUserID( INT_UID );
- local NAME_Attacker = client.GetPlayerNameByUserID( INT_ATTACKER );
- local INDEX_Attacker = client.GetPlayerIndexByUserID( INT_ATTACKER );
- if ( INDEX_Attacker == ME and INDEX_Victim ~= ME ) then
- volume = gui.GetValue("msc_hitmarker_volume");
- client.Command("playvol buttons\\arena_switch_press_02.wav "..volume, true);
- end
- end
- end
- end
- client.AllowListener( "player_hurt" );
- callbacks.Register( "FireGameEvent", "Metallic Hitsound", MetallicHitsound );
- -- hit log
- local HitLog = gui.Checkbox(miscgroupbox, "msc_hitlog", "Hit Log", false)
- function HitGroup(i_hitgroup) if i_hitgroup == nil then return; elseif i_hitgroup == 0 then return "body"; elseif i_hitgroup == 1 then return "head"; elseif i_hitgroup == 2 then return "chest"; elseif i_hitgroup == 3 then return "stomach"; elseif i_hitgroup == 4 then return "left arm"; elseif i_hitgroup == 5 then return "right arm"; elseif i_hitgroup == 6 then return "left leg"; elseif i_hitgroup == 7 then return "right leg"; elseif i_hitgroup == 10 then return "body"; end end
- local draw_hitsay = {};
- function ChatLogger(Event)
- if HitLog:GetValue() then
- if Event:GetName() == nil then return;
- elseif (Event:GetName() == 'player_hurt') then
- local ME = LocalPlayerIndex();
- local uid = Event:GetInt('userid');
- local i_attacker = Event:GetInt('attacker');
- local i_dmg = Event:GetString('dmg_health');
- local i_health = Event:GetString('health');
- local i_hitgroup = Event:GetInt('hitgroup');
- local ind_Attacker = PlayerIndexByUserID(i_attacker);
- local N_Attacker = PlayerNameByUserID(i_attacker);
- local ind_Victim = PlayerIndexByUserID(uid);
- local n_Victim = PlayerNameByUserID(uid);
- hitPlayerName = ""; hitSpot = ""; hitDmg = ""; hitHealthRemaining = "";
- hitPlayerName = n_Victim; hitSpot = i_hitgroup; hitDmg = i_dmg; hitHealthRemaining = i_health;
- response = string.format("Hit %s in the %s for %s damage (%s health remaining)\n", hitPlayerName, HitGroup(hitSpot), hitDmg, hitHealthRemaining);
- if ( ind_Attacker == ME and ind_Victim ~= ME ) then print(response);
- table.insert(draw_hitsay, {globals.RealTime(), response}); end end end end
- local On_Screen_Time, pixels_between_each_line, ScreenX, ScreenY = 10, 10, 10, 10
- function hitlog()
- if HitLog:GetValue() then local things_on_screen = 0;
- for k, l in pairs(draw_hitsay) do
- if globals.RealTime() > l[1] + On_Screen_Time then table.remove(draw_hitsay, k); else
- draw_Color(255,255,255,255); draw.SetFont(ff); draw_TextShadow(ScreenX, things_on_screen * pixels_between_each_line + ScreenY, l[2]); things_on_screen = things_on_screen + 1; end end end end
- c_AllowListener('player_hurt'); cb_Register('Draw', 'drawing your hits', hitlog); cb_Register('FireGameEvent', 'ChatLogger', ChatLogger);
- --------------------------------AA---------------------------------
- -- Manual AA
- -- menu toggle (DO NOT EDIT)
- local awMenu = gui.Reference("MENU");
- local function hideMenu()
- if awMenu:IsActive() then
- eActive = 1
- else
- eActive = 0
- end
- if (essentialsmenu:GetValue()) then
- window:SetActive(eActive);
- else
- window:SetActive(0);
- end
- end
- callbacks.Register("Draw", "hideMenu", hideMenu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement