SHARE
TWEET

Untitled

a guest Oct 13th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. -- dependencies
  3.  
  4. --print("Successfully Loaded Aimware Essentials Lua")
  5.  
  6. local menuloc = gui.Reference("SETTINGS", "MISCELLANEOUS");
  7.  
  8. 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
  9.  
  10. -- GUI Additions
  11.  
  12. local essentialsmenu = gui.Checkbox(menuloc, "essentialslua", "Show Aimware Essentials", false);
  13.  
  14.     -- window
  15.    
  16.         local window = gui.Window("essentialswindow", "Aimware Essentials", 600, 300, 500, 700)
  17.         local hvhgroupbox = gui.Groupbox(window, "HvH Essentials", 10, 20, 230, 300)
  18.         local visualsgroupbox = gui.Groupbox(window, "Visuals Essentials", 260, 20, 230, 300)
  19.         local miscgroupbox = gui. Groupbox(window, "Misc Essentials", 10, 20, 230, 300)
  20.  
  21.  
  22.  
  23. -----------------------------HVH-------------------------
  24.  
  25. -- jumpshot
  26.  
  27.  
  28. -- fakeduck improvements
  29.  
  30. -- fakeduck indicator
  31.  
  32. -- autobuy
  33.  
  34. ----------------------VISUALS-------------------------
  35.  
  36. -- bomb timer
  37.  
  38. local bombtimer = gui.Checkbox(visualsgroupbox, "bombtimer", "Bomb Timer", false)
  39. local ref = gui.Reference("MISC", "GENERAL", "Main");
  40. local mouseX, mouseY, x, y, dx, dy, w, h = 0, 0, 650, 10, 0, 0, 400, 50;
  41. local shouldDrag = false;
  42. local fonticon = draw.CreateFont("icomoon", 25, 25);
  43. local fontinfo = draw.CreateFont("Verdana", 15, 15);
  44. local fonttext = draw.CreateFont("Verdana", 15, 15);
  45. local fontbombtext = draw.CreateFont("skeet Smallest Pixel-7 Modified", 10, 15);
  46.  
  47. local defusing = false;
  48.  
  49. function EventHook(Event)
  50. if gui.GetValue("bombtimer") == true then
  51.    if Event:GetName() == "bomb_begindefuse" then
  52.      defusing = true;
  53.      elseif Event:GetName() == "bomb_abortdefuse" then
  54.      defusing = false;
  55.    elseif Event:GetName() == "round_officially_ended"
  56.      or Event:GetName() == "bomb_defused" or Event:GetName() == "bomb_exploded" then
  57.       defusing = false;
  58.     end
  59. end
  60.  
  61. local function dragFeature()
  62.     if input.IsButtonDown(1) then
  63.         mouseX, mouseY = input.GetMousePos();
  64.         if shouldDrag then
  65.             x = mouseX - dx;
  66.             y = mouseY - dy;
  67.         end
  68.         if mouseX >= x and mouseX <= x + w and mouseY >= y and mouseY <= y + 40 then
  69.             shouldDrag = true;
  70.             dx = mouseX - x;
  71.             dy = mouseY - y;
  72.         end
  73.     else
  74.         shouldDrag = false;
  75.     end
  76. end
  77.  
  78. local function drawTimer()
  79.  
  80. if entities.FindByClass("CPlantedC4")[1] ~= nil then
  81. local Bomb = entities.FindByClass("CPlantedC4")[1];
  82.  
  83. if Bomb:GetProp("m_bBombTicking") and Bomb:GetProp("m_bBombDefused") == 0 and globals.CurTime() < Bomb:GetProp("m_flC4Blow") then
  84. local Player = entities.GetLocalPlayer();
  85. if defusing == true then
  86. local BombMath = ((globals.CurTime() - Bomb:GetProp("m_flDefuseCountDown")) * 0.5) / ((Bomb:GetProp("m_flDefuseCountDown") - Bomb:GetProp("m_flDefuseLength")) - Bomb:GetProp("m_flDefuseCountDown")) + 1;
  87.  
  88. draw.Color(8, 8, 8, 30)
  89. draw.FilledRect(x, y, x + w, y + h)
  90. draw.FilledRect(x - 65, y, x + (w - 405), y + h )
  91.  
  92. draw.Color(8, 8, 8, 90)
  93. draw.FilledRect(x + 20, y + 20, x + (w - 20), y + h - 20)
  94.  
  95. draw.Color(0, 150, 255, 240)
  96. draw.FilledRect(x + 20, y + 20, (x + 20) * BombMath, y + h - 20)
  97.  
  98. draw.Color(180, 180, 180, 120)
  99. draw.OutlinedRect(x, y, x + w, y + h)
  100. draw.OutlinedRect(x - 65,y , x + (w - 405), y + h)
  101.  
  102. draw.Color(255, 255, 255, 255)
  103. draw.SetFont(fontbombtext)
  104. draw.Text(x - 48, y + 30, "BOMB")
  105. draw.SetFont(fonticon)
  106. draw.Text(x - 50, y + 10, "y")
  107.  
  108. else
  109.  
  110. local BombMath = ((globals.CurTime() - Bomb:GetProp("m_flC4Blow")) * 0.5) / ((Bomb:GetProp("m_flC4Blow") - Bomb:GetProp("m_flTimerLength")) - Bomb:GetProp("m_flC4Blow")) + 1;
  111.  
  112. draw.Color(8, 8, 8, 30)
  113. draw.FilledRect(x, y, x + w, y + h)
  114. draw.FilledRect(x - 65, y, x + (w - 405), y + h )
  115.  
  116. draw.Color(8, 8, 8, 90)
  117. draw.FilledRect(x + 20, y + 20, x + (w - 20), y + h - 20)
  118.  
  119. draw.Color(130, 255, 0, 240)
  120. draw.FilledRect(x + 20, y + 20, (x + 20) * BombMath, y + h - 20)
  121.  
  122. draw.Color(180, 180, 180, 120)
  123. draw.OutlinedRect(x, y, x + w, y + h)
  124. draw.OutlinedRect(x - 65,y , x + (w - 405), y + h)
  125.  
  126. draw.Color(255, 255, 255, 255)
  127. draw.SetFont(fontbombtext)
  128. draw.Text(x - 48, y + 30, "BOMB")
  129. draw.SetFont(fonticon)
  130. draw.Text(x - 50, y + 10, "y")
  131. end
  132.  
  133. if Player:IsAlive() and globals.CurTime() < Bomb:GetProp("m_flC4Blow") then
  134. if math.floor(0.5 + BombDamage(Bomb, Player)) >= Player:GetHealth() then
  135. draw.Color(255, 0, 0, 255)
  136. draw.SetFont(fontinfo)
  137. draw.Text(5, 0, "LETHAL");
  138. draw.TextShadow(5, 0, "LETHAL");
  139. else
  140. draw.Color(255, 255, 255, 255)
  141. draw.SetFont(fontinfo)
  142. draw.Text(5, 0, math.floor(0.5 + BombDamage(Bomb, Player)) .. " HP");
  143. draw.TextShadow(5, 0, math.floor(0.5 + BombDamage(Bomb, Player)) .. " HP");
  144. end
  145. end
  146. end
  147. end
  148. end
  149.  
  150. function BombDamage(Bomb, Player)
  151. local C4Distance = math.sqrt((select(1,Bomb:GetAbsOrigin()) - select(1,Player:GetAbsOrigin())) ^ 2 +
  152. (select(2,Bomb:GetAbsOrigin()) - select(2,Player:GetAbsOrigin())) ^ 2 +
  153. (select(3,Bomb:GetAbsOrigin()) - select(3,Player:GetAbsOrigin())) ^ 2);
  154.  
  155. local Gauss = (C4Distance - 75.68) / 789.2
  156. local flDamage = 450.7 * math.exp(-Gauss * Gauss);
  157.  
  158. if Player:GetProp("m_ArmorValue") > 0 then
  159.  
  160. local flArmorRatio = 0.5;
  161. local flArmorBonus = 0.5;
  162.  
  163. if Player:GetProp("m_ArmorValue") > 0 then
  164. local flNew = flDamage * flArmorRatio;
  165. local flArmor = (flDamage - flNew) * flArmorBonus;
  166.  
  167. if flArmor > Player:GetProp("m_ArmorValue") then
  168. flArmor = Player:GetProp("m_ArmorValue") * (1 / flArmorBonus);
  169. flNew = flDamage - flArmor;
  170. end
  171.  
  172. flDamage = flNew;
  173.  
  174. end
  175.  
  176. end
  177. return math.max(flDamage, 0);
  178. end
  179.  
  180. callbacks.Register( "Draw", "drag", dragFeature)
  181. callbacks.Register("FireGameEvent", "EventHookB", EventHook);
  182. callbacks.Register( "Draw", "drawTimer", drawTimer );
  183.  
  184. end
  185.  
  186. -- disable post prossesing
  187.  
  188. -- full bright
  189.  
  190. local fullbright = gui.Checkbox(visualsgroupbox, "fulbright", "Full Bright", false)
  191. function full_bright() if fullbright:GetValue() then client_SetConVar("mat_fullbright", 1, true); else client_SetConVar("mat_fullbright", 0, true); end end
  192. cb_Register('Draw', "Full brightness" ,full_bright);
  193.  
  194. -- scoped fov fix
  195.  
  196.  
  197. -- engine radar
  198.  
  199. local ERadar = gui.Checkbox(visualsgroupbox, "esp_engine_radar", "Engine Radar", false)
  200. function engineradar()
  201. if ERadar:GetValue() then ERval = 1; else ERval = 0; end
  202. for o, radar in pairs(entities_FindByClass("CCSPlayer")) do radar:SetProp("m_bSpotted", ERval); end end
  203. cb_Register("Draw", "engine radar", engineradar);
  204.  
  205. -- sniper crosshairs
  206.  
  207. local ComboCrosshair = gui.Combobox(visualsgroupbox, "vis_sniper_crosshair", "Force Sniper Crosshairs", "Off", "Force Crosshair", "Force Crosshair (+Scoped)", "Aimware Crosshair", "Draw Crosshair")
  208. function ifCrosshair()
  209. if GetLocalPlayer() == nil then return; end
  210. local Weapon = GetLocalPlayer():GetPropEntity("m_hActiveWeapon");
  211. local Scoped = GetLocalPlayer():GetProp("m_bIsScoped") == 1 or GetLocalPlayer():GetProp("m_bIsScoped") == 257
  212. if Weapon == nil then return; end
  213. local cWep = Weapon:GetClass();
  214. if cWep == "CWeaponAWP" or cWep == "CWeaponSSG08" or cWep == "CWeaponSCAR20" or cWep == "CWeaponG3SG1" then drawCrosshair = true;
  215. else drawCrosshair = false; end
  216. local screenCenterX, screenY = draw_GetScreenSize(); local scX, scY = screenCenterX / 2, screenY / 2;
  217. if drawCrosshair == true and ComboCrosshair:GetValue() == 0 then client_SetConVar("weapon_debug_spread_show", 0, true)
  218. 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
  219. elseif drawCrosshair == true and ComboCrosshair:GetValue() == 2 then gui_SetValue('esp_crosshair', false); client_SetConVar("weapon_debug_spread_show", 3, true)
  220. 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
  221. elseif drawCrosshair == false and ComboCrosshair:GetValue() == 3 then gui_SetValue('esp_crosshair', false)
  222. elseif drawCrosshair == true and ComboCrosshair:GetValue() == 4 then client_SetConVar("weapon_debug_spread_show", 0, true); gui_SetValue('esp_crosshair', false); draw.SetFont(ff);
  223. 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
  224. cb_Register("Draw", "sniper crosshairs", ifCrosshair);
  225.  
  226. ---------------------------MISC------------------------
  227.  
  228. -- viewmodel changer
  229.  
  230.  
  231. -- aspect ratio
  232.  
  233. -- knife on left hand
  234.  
  235. -- skeet hitsoud
  236.  
  237. local MSC_PART_REF = gui.Reference( "MISC", "ENHANCEMENT", "Hitmarkers" );
  238. local AWMetallicHitsound = gui.Checkbox( miscgroupbox, "lua_hitsound", "Metallic Hitsound (Skeet)", 0 );
  239. local function MetallicHitsound( Event )
  240.  
  241.     if AWMetallicHitsound:GetValue() then
  242.         if gui.GetValue( "msc_hitmarker_enable" ) then
  243.             gui.SetValue( "msc_hitmarker_enable", 0 );
  244.         end
  245.         if ( Event:GetName() == "player_hurt" ) then
  246.             local ME = client.GetLocalPlayerIndex();
  247.             local INT_UID = Event:GetInt( "userid" );
  248.             local INT_ATTACKER = Event:GetInt( "attacker" );
  249.             local NAME_Victim = client.GetPlayerNameByUserID( INT_UID );
  250.             local INDEX_Victim = client.GetPlayerIndexByUserID( INT_UID );
  251.             local NAME_Attacker = client.GetPlayerNameByUserID( INT_ATTACKER );
  252.             local INDEX_Attacker = client.GetPlayerIndexByUserID( INT_ATTACKER );
  253.             if ( INDEX_Attacker == ME and INDEX_Victim ~= ME ) then
  254.                 volume = gui.GetValue("msc_hitmarker_volume");
  255.                 client.Command("playvol buttons\\arena_switch_press_02.wav "..volume, true);
  256.             end
  257.         end
  258.     end
  259. end
  260. client.AllowListener( "player_hurt" );
  261. callbacks.Register( "FireGameEvent", "Metallic Hitsound", MetallicHitsound );
  262.  
  263. -- hit log
  264.  
  265. local HitLog = gui.Checkbox(miscgroupbox, "msc_hitlog", "Hit Log", false)
  266. 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
  267. local draw_hitsay = {};
  268. function ChatLogger(Event)
  269. if HitLog:GetValue() then
  270. if Event:GetName() == nil then return;
  271. elseif (Event:GetName() == 'player_hurt') then
  272. local ME = LocalPlayerIndex();
  273. local uid = Event:GetInt('userid');
  274. local i_attacker = Event:GetInt('attacker');
  275. local i_dmg = Event:GetString('dmg_health');
  276. local i_health = Event:GetString('health');
  277. local i_hitgroup = Event:GetInt('hitgroup');
  278. local ind_Attacker = PlayerIndexByUserID(i_attacker);
  279. local N_Attacker = PlayerNameByUserID(i_attacker);
  280. local ind_Victim = PlayerIndexByUserID(uid);
  281. local n_Victim = PlayerNameByUserID(uid);
  282. hitPlayerName = ""; hitSpot = ""; hitDmg = ""; hitHealthRemaining = "";
  283. hitPlayerName = n_Victim; hitSpot = i_hitgroup; hitDmg = i_dmg; hitHealthRemaining = i_health;
  284. response = string.format("Hit %s in the %s for %s damage (%s health remaining)\n", hitPlayerName, HitGroup(hitSpot), hitDmg, hitHealthRemaining);
  285. if ( ind_Attacker == ME and ind_Victim ~= ME ) then print(response);
  286. table.insert(draw_hitsay, {globals.RealTime(), response}); end end end end
  287. local On_Screen_Time, pixels_between_each_line, ScreenX, ScreenY = 10, 10, 10, 10
  288. function hitlog()
  289. if HitLog:GetValue() then local things_on_screen = 0;
  290. for k, l in pairs(draw_hitsay) do
  291. if globals.RealTime() > l[1] + On_Screen_Time then table.remove(draw_hitsay, k); else
  292. 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
  293. c_AllowListener('player_hurt'); cb_Register('Draw', 'drawing your hits', hitlog); cb_Register('FireGameEvent', 'ChatLogger', ChatLogger);  
  294.  
  295. --------------------------------AA---------------------------------
  296.  
  297. -- Manual AA
  298.  
  299.  
  300.  
  301. -- menu toggle (DO NOT EDIT)
  302.  
  303.  
  304. local awMenu = gui.Reference("MENU");
  305.  
  306. local function hideMenu()
  307.     if awMenu:IsActive() then
  308.         eActive = 1
  309.     else
  310.         eActive = 0
  311.     end
  312.     if (essentialsmenu:GetValue()) then
  313.         window:SetActive(eActive);
  314.     else
  315.         window:SetActive(0);
  316.     end
  317. end
  318. callbacks.Register("Draw", "hideMenu", hideMenu)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top