Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.82 KB | None | 0 0
  1. -- Essentials Lua By The_Belch
  2.  
  3. -- dependencies
  4.  
  5. print("Successfully Loaded Aimware Essentials Lua")
  6.  
  7. local menuloc = gui.Reference("SETTINGS", "MISCELLANEOUS");
  8.  
  9. 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
  10.  
  11. -- GUI Additions
  12.  
  13. local essentialsmenu = gui.Checkbox(menuloc, "essentialslua", "Show Aimware Essentials", false);
  14.  
  15. -- window
  16.  
  17. local window = gui.Window("essentialswindow", "Aimware Essentials", 1200, 300, 500, 700)
  18. local hvhgroupbox = gui.Groupbox(window, "HvH Essentials", 10, 20, 230, 300)
  19. local visualsgroupbox = gui.Groupbox(window, "Visuals Essentials", 260, 20, 230, 300)
  20. local miscgroupbox = gui. Groupbox(window, "Misc Essentials", 260, 350, 230, 300)
  21.  
  22.  
  23.  
  24. -----------------------------HVH-------------------------
  25.  
  26. -- jumpshot
  27.  
  28.  
  29. -- fakeduck improvements
  30.  
  31. -- fakeduck indicator
  32.  
  33. -- autobuy
  34.  
  35. local Autobuy_Text = gui.Text( hvhgroupbox, "Autobuy" );
  36. local Autobuy_Enable = gui.Checkbox( hvhgroupbox, "lua_autobuy_enable", "Enable", 0 );
  37.  
  38. 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" );
  39. 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" );
  40.  
  41. local Autobuy_Armor = gui.Combobox( hvhgroupbox, "lua_autobuy_armor", "Armor", "Off", "Kevlar", "Kevlar + Helmet" );
  42. local Autobuy_Defuser = gui.Checkbox( hvhgroupbox, "lua_autobuy_defuser", "Defuser", 0 );
  43. local Autobuy_Taser = gui.Checkbox( hvhgroupbox, "lua_autobuy_taser", "Taser", 0 );
  44.  
  45. local Autobuy_HEGrenade = gui.Checkbox( hvhgroupbox, "lua_autobuy_hegrenade", "HE Grenade", 0 );
  46. local Autobuy_Smoke = gui.Checkbox( hvhgroupbox, "lua_autobuy_smoke", "Smoke", 0 );
  47. local Autobuy_Molotov = gui.Checkbox( hvhgroupbox, "lua_autobuy_molotov", "Molotov", 0 );
  48. local Autobuy_Flashbang = gui.Checkbox( hvhgroupbox, "lua_autobuy_flashbang", "Flashbang", 0 );
  49. local Autobuy_Decoy = gui.Checkbox( hvhgroupbox, "lua_autobuy_decoy", "Decoy", 0 );
  50.  
  51. local Money = 0
  52.  
  53. local function LocalPlayerMoney()
  54. if Autobuy_Enable:GetValue() then
  55. if entities.GetLocalPlayer() ~= nil then
  56. Money = entities.GetLocalPlayer():GetProp( "m_iAccount" )
  57. end
  58. end
  59. end
  60.  
  61. local function Autobuy( Event )
  62.  
  63. local PrimaryWeapon = Autobuy_PrimaryWeapon:GetValue()
  64. local SecondaryWeapon = Autobuy_SecondaryWeapon:GetValue()
  65. local Armor = Autobuy_Armor:GetValue()
  66.  
  67. if Autobuy_Enable:GetValue() then
  68.  
  69. if Event:GetName() ~= "player_spawn" then
  70. return;
  71. end
  72.  
  73. local INT_UID = Event:GetInt( "userid" );
  74. local PlayerIndex = client.GetPlayerIndexByUserID( INT_UID );
  75.  
  76. if client.GetLocalPlayerIndex() == PlayerIndex then
  77. ME = true
  78. else
  79. ME = false
  80. end
  81.  
  82. if ME and Money == 0 then
  83. -- Primary Weapon
  84. if PrimaryWeapon == 1 then client.Command( "buy scar20", true ); -- Auto
  85. elseif PrimaryWeapon == 2 then client.Command( "buy ssg08", true ); -- Scout
  86. elseif PrimaryWeapon == 3 then client.Command( "buy awp", true ); -- AWP
  87. elseif PrimaryWeapon == 4 then client.Command( "buy ak47", true ); -- Rifle
  88. elseif PrimaryWeapon == 5 then client.Command( "buy famas", true ); -- Famas : Galil AR
  89. elseif PrimaryWeapon == 6 then client.Command( "buy aug", true ); -- AUG : SG 553
  90. elseif PrimaryWeapon == 7 then client.Command( "buy mac10", true ); -- MP9 : MAC-10
  91. elseif PrimaryWeapon == 8 then client.Command( "buy mp7", true ); -- MP7 : MP5-SD
  92. elseif PrimaryWeapon == 9 then client.Command( "buy ump45", true ); -- UMP-45
  93. elseif PrimaryWeapon == 10 then client.Command( "buy p90", true ); -- P90
  94. elseif PrimaryWeapon == 11 then client.Command( "buy bizon", true ); -- PP-Bizon
  95. elseif PrimaryWeapon == 12 then client.Command( "buy nova", true ); -- Nova
  96. elseif PrimaryWeapon == 13 then client.Command( "buy xm1014", true ); -- XM1014
  97. elseif PrimaryWeapon == 14 then client.Command( "buy mag7", true ); -- MAG-7 : Sawed-Off
  98. elseif PrimaryWeapon == 15 then client.Command( "buy m249", true ); -- M249
  99. elseif PrimaryWeapon == 16 then client.Command( "buy negev", true ); -- Negev
  100. end
  101. -- Secondary Weapon
  102. if SecondaryWeapon == 1 then client.Command( "buy elite", true ); -- Dual Berettas
  103. elseif SecondaryWeapon == 2 then client.Command( "buy p250", true ); -- P250
  104. elseif SecondaryWeapon == 3 then client.Command( "buy tec9", true ); -- Five-Seven : CZ75-Auto : Tec-9
  105. elseif SecondaryWeapon == 4 then client.Command( "buy deagle", true ); -- Desert Eagle : R8 Revolver
  106. end
  107. -- Taser
  108. if Autobuy_Taser:GetValue() then
  109. client.Command( "buy taser", true );
  110. end
  111. elseif ME and Money <= 800 then
  112. -- Secondary Weapon
  113. if SecondaryWeapon == 1 then client.Command( "buy elite", true ); -- Dual Berettas
  114. elseif SecondaryWeapon == 2 then client.Command( "buy p250", true ); -- P250
  115. elseif SecondaryWeapon == 3 then client.Command( "buy tec9", true ); -- Five-Seven : CZ75-Auto : Tec-9
  116. elseif SecondaryWeapon == 4 then client.Command( "buy deagle", true ); -- Desert Eagle : R8 Revolver
  117. end
  118. -- Taser
  119. if Autobuy_Taser:GetValue() then
  120. client.Command( "buy taser", true );
  121. end
  122. elseif ME and Money > 800 then
  123. -- Primary Weapon
  124. if PrimaryWeapon == 1 then client.Command( "buy scar20", true ); -- Auto
  125. elseif PrimaryWeapon == 2 then client.Command( "buy ssg08", true ); -- Scout
  126. elseif PrimaryWeapon == 3 then client.Command( "buy awp", true ); -- AWP
  127. elseif PrimaryWeapon == 4 then client.Command( "buy ak47", true ); -- Rifle
  128. elseif PrimaryWeapon == 5 then client.Command( "buy famas", true ); -- Famas : Galil AR
  129. elseif PrimaryWeapon == 6 then client.Command( "buy aug", true ); -- AUG : SG 553
  130. elseif PrimaryWeapon == 7 then client.Command( "buy mac10", true ); -- MP9 : MAC-10
  131. elseif PrimaryWeapon == 8 then client.Command( "buy mp7", true ); -- MP7 : MP5-SD
  132. elseif PrimaryWeapon == 9 then client.Command( "buy ump45", true ); -- UMP-45
  133. elseif PrimaryWeapon == 10 then client.Command( "buy p90", true ); -- P90
  134. elseif PrimaryWeapon == 11 then client.Command( "buy bizon", true ); -- PP-Bizon
  135. elseif PrimaryWeapon == 12 then client.Command( "buy nova", true ); -- Nova
  136. elseif PrimaryWeapon == 13 then client.Command( "buy xm1014", true ); -- XM1014
  137. elseif PrimaryWeapon == 14 then client.Command( "buy mag7", true ); -- MAG-7 : Sawed-Off
  138. elseif PrimaryWeapon == 15 then client.Command( "buy m249", true ); -- M249
  139. elseif PrimaryWeapon == 16 then client.Command( "buy negev", true ); -- Negev
  140. end
  141. -- Secondary Weapon
  142. if SecondaryWeapon == 1 then client.Command( "buy elite", true ); -- Dual Berettas
  143. elseif SecondaryWeapon == 2 then client.Command( "buy p250", true ); -- P250
  144. elseif SecondaryWeapon == 3 then client.Command( "buy tec9", true ); -- Five-Seven : CZ75-Auto : Tec-9
  145. elseif SecondaryWeapon == 4 then client.Command( "buy deagle", true ); -- Desert Eagle : R8 Revolver
  146. end
  147.  
  148. -- Armor
  149. if Armor == 1 then client.Command( "buy vest", true );
  150. elseif Armor == 2 then client.Command( "buy vesthelm", true );
  151. end
  152. -- Defuser
  153. if Autobuy_Defuser:GetValue() then
  154. client.Command( "buy defuser", true );
  155. end
  156. -- Taser
  157. if Autobuy_Taser:GetValue() then
  158. client.Command( "buy taser", true );
  159. end
  160.  
  161. -- HE Grenade
  162. if Autobuy_HEGrenade:GetValue() then
  163. client.Command( "buy hegrenade", true );
  164. end
  165. -- Smoke
  166. if Autobuy_Smoke:GetValue() then
  167. client.Command( "buy smokegrenade", true );
  168. end
  169. -- Molotov
  170. if Autobuy_Molotov:GetValue() then
  171. client.Command( "buy molotov", true );
  172. end
  173. -- Flashbang
  174. if Autobuy_Flashbang:GetValue() then
  175. client.Command( "buy flashbang", true );
  176. end
  177. -- Decoy
  178. if Autobuy_Decoy:GetValue() then
  179. client.Command( "buy decoy", true );
  180. end
  181. end
  182.  
  183. end
  184.  
  185. end
  186.  
  187. client.AllowListener( "player_spawn" )
  188.  
  189. callbacks.Register( "Draw", "Local Player Money", LocalPlayerMoney )
  190. callbacks.Register( "FireGameEvent", "Autobuy", Autobuy )
  191.  
  192. ----------------------VISUALS-------------------------
  193.  
  194. -- bomb timer
  195.  
  196. local bombtimer = gui.Checkbox(visualsgroupbox, "bombtimer", "Bomb Timer", false)
  197. local ref = gui.Reference("MISC", "GENERAL", "Main");
  198. local mouseX, mouseY, x, y, dx, dy, w, h = 0, 0, 650, 10, 0, 0, 400, 50;
  199. local shouldDrag = false;
  200. local fonticon = draw.CreateFont("icomoon", 25, 25);
  201. local fontinfo = draw.CreateFont("Verdana", 15, 15);
  202. local fonttext = draw.CreateFont("Verdana", 15, 15);
  203. local fontbombtext = draw.CreateFont("skeet Smallest Pixel-7 Modified", 10, 15);
  204.  
  205. local defusing = false;
  206.  
  207. function EventHook(Event)
  208. if gui.GetValue("bombtimer") == true then
  209. if Event:GetName() == "bomb_begindefuse" then
  210. defusing = true;
  211. elseif Event:GetName() == "bomb_abortdefuse" then
  212. defusing = false;
  213. elseif Event:GetName() == "round_officially_ended"
  214. or Event:GetName() == "bomb_defused" or Event:GetName() == "bomb_exploded" then
  215. defusing = false;
  216. end
  217. end
  218.  
  219. local function dragFeature()
  220. if input.IsButtonDown(1) then
  221. mouseX, mouseY = input.GetMousePos();
  222. if shouldDrag then
  223. x = mouseX - dx;
  224. y = mouseY - dy;
  225. end
  226. if mouseX >= x and mouseX <= x + w and mouseY >= y and mouseY <= y + 40 then
  227. shouldDrag = true;
  228. dx = mouseX - x;
  229. dy = mouseY - y;
  230. end
  231. else
  232. shouldDrag = false;
  233. end
  234. end
  235.  
  236. local function drawTimer()
  237.  
  238. if entities.FindByClass("CPlantedC4")[1] ~= nil then
  239. local Bomb = entities.FindByClass("CPlantedC4")[1];
  240.  
  241. if Bomb:GetProp("m_bBombTicking") and Bomb:GetProp("m_bBombDefused") == 0 and globals.CurTime() < Bomb:GetProp("m_flC4Blow") then
  242. local Player = entities.GetLocalPlayer();
  243. if defusing == true then
  244. local BombMath = ((globals.CurTime() - Bomb:GetProp("m_flDefuseCountDown")) * 0.5) / ((Bomb:GetProp("m_flDefuseCountDown") - Bomb:GetProp("m_flDefuseLength")) - Bomb:GetProp("m_flDefuseCountDown")) + 1;
  245.  
  246. draw.Color(8, 8, 8, 30)
  247. draw.FilledRect(x, y, x + w, y + h)
  248. draw.FilledRect(x - 65, y, x + (w - 405), y + h )
  249.  
  250. draw.Color(8, 8, 8, 90)
  251. draw.FilledRect(x + 20, y + 20, x + (w - 20), y + h - 20)
  252.  
  253. draw.Color(0, 150, 255, 240)
  254. draw.FilledRect(x + 20, y + 20, (x + 20) * BombMath, y + h - 20)
  255.  
  256. draw.Color(180, 180, 180, 120)
  257. draw.OutlinedRect(x, y, x + w, y + h)
  258. draw.OutlinedRect(x - 65,y , x + (w - 405), y + h)
  259.  
  260. draw.Color(255, 255, 255, 255)
  261. draw.SetFont(fontbombtext)
  262. draw.Text(x - 48, y + 30, "BOMB")
  263. draw.SetFont(fonticon)
  264. draw.Text(x - 50, y + 10, "y")
  265.  
  266. else
  267.  
  268. local BombMath = ((globals.CurTime() - Bomb:GetProp("m_flC4Blow")) * 0.5) / ((Bomb:GetProp("m_flC4Blow") - Bomb:GetProp("m_flTimerLength")) - Bomb:GetProp("m_flC4Blow")) + 1;
  269.  
  270. draw.Color(8, 8, 8, 30)
  271. draw.FilledRect(x, y, x + w, y + h)
  272. draw.FilledRect(x - 65, y, x + (w - 405), y + h )
  273.  
  274. draw.Color(8, 8, 8, 90)
  275. draw.FilledRect(x + 20, y + 20, x + (w - 20), y + h - 20)
  276.  
  277. draw.Color(130, 255, 0, 240)
  278. draw.FilledRect(x + 20, y + 20, (x + 20) * BombMath, y + h - 20)
  279.  
  280. draw.Color(180, 180, 180, 120)
  281. draw.OutlinedRect(x, y, x + w, y + h)
  282. draw.OutlinedRect(x - 65,y , x + (w - 405), y + h)
  283.  
  284. draw.Color(255, 255, 255, 255)
  285. draw.SetFont(fontbombtext)
  286. draw.Text(x - 48, y + 30, "BOMB")
  287. draw.SetFont(fonticon)
  288. draw.Text(x - 50, y + 10, "y")
  289. end
  290.  
  291. if Player:IsAlive() and globals.CurTime() < Bomb:GetProp("m_flC4Blow") then
  292. if math.floor(0.5 + BombDamage(Bomb, Player)) >= Player:GetHealth() then
  293. draw.Color(255, 0, 0, 255)
  294. draw.SetFont(fontinfo)
  295. draw.Text(5, 0, "LETHAL");
  296. draw.TextShadow(5, 0, "LETHAL");
  297. else
  298. draw.Color(255, 255, 255, 255)
  299. draw.SetFont(fontinfo)
  300. draw.Text(5, 0, math.floor(0.5 + BombDamage(Bomb, Player)) .. " HP");
  301. draw.TextShadow(5, 0, math.floor(0.5 + BombDamage(Bomb, Player)) .. " HP");
  302. end
  303. end
  304. end
  305. end
  306. end
  307.  
  308. function BombDamage(Bomb, Player)
  309. local C4Distance = math.sqrt((select(1,Bomb:GetAbsOrigin()) - select(1,Player:GetAbsOrigin())) ^ 2 +
  310. (select(2,Bomb:GetAbsOrigin()) - select(2,Player:GetAbsOrigin())) ^ 2 +
  311. (select(3,Bomb:GetAbsOrigin()) - select(3,Player:GetAbsOrigin())) ^ 2);
  312.  
  313. local Gauss = (C4Distance - 75.68) / 789.2
  314. local flDamage = 450.7 * math.exp(-Gauss * Gauss);
  315.  
  316. if Player:GetProp("m_ArmorValue") > 0 then
  317.  
  318. local flArmorRatio = 0.5;
  319. local flArmorBonus = 0.5;
  320.  
  321. if Player:GetProp("m_ArmorValue") > 0 then
  322. local flNew = flDamage * flArmorRatio;
  323. local flArmor = (flDamage - flNew) * flArmorBonus;
  324.  
  325. if flArmor > Player:GetProp("m_ArmorValue") then
  326. flArmor = Player:GetProp("m_ArmorValue") * (1 / flArmorBonus);
  327. flNew = flDamage - flArmor;
  328. end
  329.  
  330. flDamage = flNew;
  331.  
  332. end
  333.  
  334. end
  335. return math.max(flDamage, 0);
  336. end
  337.  
  338. callbacks.Register( "Draw", "drag", dragFeature)
  339. callbacks.Register("FireGameEvent", "EventHookB", EventHook);
  340. callbacks.Register( "Draw", "drawTimer", drawTimer );
  341.  
  342. end
  343.  
  344. -- disable post prossesing
  345.  
  346. local disablepost = gui.Checkbox(visualsgroupbox, "vis_disable_post", "Disable Post Processing", false)
  347. function disablepp()
  348. if disablepost:GetValue() then client_SetConVar("mat_postprocess_enable", 0, true); else client_SetConVar("mat_postprocess_enable", 1, true); end end
  349. cb_Register('Draw', "Disable Post Processing" ,disablepp);
  350.  
  351. -- full bright
  352.  
  353. local fullbright = gui.Checkbox(visualsgroupbox, "fulbright", "Full Bright", false)
  354. function full_bright() if fullbright:GetValue() then client_SetConVar("mat_fullbright", 1, true); else client_SetConVar("mat_fullbright", 0, true); end end
  355. cb_Register('Draw', "Full brightness" ,full_bright);
  356.  
  357. -- scoped fov fix
  358.  
  359.  
  360. -- engine radar
  361.  
  362. local ERadar = gui.Checkbox(visualsgroupbox, "esp_engine_radar", "Engine Radar", false)
  363. function engineradar()
  364. if ERadar:GetValue() then ERval = 1; else ERval = 0; end
  365. for o, radar in pairs(entities_FindByClass("CCSPlayer")) do radar:SetProp("m_bSpotted", ERval); end end
  366. cb_Register("Draw", "engine radar", engineradar);
  367.  
  368. -- sniper crosshairs
  369.  
  370. local ComboCrosshair = gui.Combobox(visualsgroupbox, "vis_sniper_crosshair", "Force Sniper Crosshairs", "Off", "Force Crosshair", "Force Crosshair (+Scoped)", "Aimware Crosshair", "Draw Crosshair")
  371. function ifCrosshair()
  372. if GetLocalPlayer() == nil then return; end
  373. local Weapon = GetLocalPlayer():GetPropEntity("m_hActiveWeapon");
  374. local Scoped = GetLocalPlayer():GetProp("m_bIsScoped") == 1 or GetLocalPlayer():GetProp("m_bIsScoped") == 257
  375. if Weapon == nil then return; end
  376. local cWep = Weapon:GetClass();
  377. if cWep == "CWeaponAWP" or cWep == "CWeaponSSG08" or cWep == "CWeaponSCAR20" or cWep == "CWeaponG3SG1" then drawCrosshair = true;
  378. else drawCrosshair = false; end
  379. local screenCenterX, screenY = draw_GetScreenSize(); local scX, scY = screenCenterX / 2, screenY / 2;
  380. if drawCrosshair == true and ComboCrosshair:GetValue() == 0 then client_SetConVar("weapon_debug_spread_show", 0, true)
  381. 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
  382. elseif drawCrosshair == true and ComboCrosshair:GetValue() == 2 then gui_SetValue('esp_crosshair', false); client_SetConVar("weapon_debug_spread_show", 3, true)
  383. 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
  384. elseif drawCrosshair == false and ComboCrosshair:GetValue() == 3 then gui_SetValue('esp_crosshair', false)
  385. elseif drawCrosshair == true and ComboCrosshair:GetValue() == 4 then client_SetConVar("weapon_debug_spread_show", 0, true); gui_SetValue('esp_crosshair', false); draw.SetFont(ff);
  386. 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
  387. cb_Register("Draw", "sniper crosshairs", ifCrosshair);
  388.  
  389. ---------------------------MISC------------------------
  390.  
  391. -- viewmodel changer
  392.  
  393. 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()
  394. local show2, pressed2 = false, true
  395. local ViewModelShown = gui.Checkbox(miscgroupbox, "msc_vme", "Viewmodel Changer", false)
  396. local VM_W = gui.Window("VM_W", "Viewmodel Changer", 200,200,200,300)
  397. local VMStuff = gui.Groupbox(VM_W, "Viewmodel Changer", 15, 14, 170, 240)
  398. local VM_e = gui.Checkbox(VMStuff, "msc_vme", "Enable", false)
  399. local xS = gui.Slider(VMStuff, "VM_X", "X", xO, -20, 20)
  400. local yS = gui.Slider(VMStuff, "VM_Y", "Y", yO, -100, 100)
  401. local zS = gui.Slider(VMStuff, "VM_Z", "Z", zO, -20, 20)
  402. 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
  403. 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
  404. 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);
  405. 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
  406. cb_Register("Draw", "p2", press2); cb_Register("Draw", "s2", shows2); cb_Register("Draw", "vm sets", VM_E);
  407.  
  408. -- aspect ratio
  409.  
  410. local aspect_ratio_table = {};
  411. local aspect_ratio_check = gui.Checkbox(miscgroupbox, "msc_aspect_enable", "Aspect Ratio Changer", false)
  412. local aspect_ratio_reference = gui.Slider(miscgroupbox, "msc_aspect_value", "Force aspect ratio", 100, 1, 199) -- % times your original ratio
  413. local function gcd(m, n) while m ~= 0 do m, n = math.fmod(n, m), m; end return n; end
  414. 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
  415. 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
  416. cb_Register('Draw', "aspect ratio" ,on_aspect_ratio_changed);
  417.  
  418. -- knife on left hand
  419.  
  420. -- skeet hitsoud
  421.  
  422. local MSC_PART_REF = gui.Reference( "MISC", "ENHANCEMENT", "Hitmarkers" );
  423. local AWMetallicHitsound = gui.Checkbox( miscgroupbox, "lua_hitsound", "Metallic Hitsound (Skeet)", 0 );
  424. local function MetallicHitsound( Event )
  425.  
  426. if AWMetallicHitsound:GetValue() then
  427. if gui.GetValue( "msc_hitmarker_enable" ) then
  428. gui.SetValue( "msc_hitmarker_enable", 0 );
  429. end
  430. if ( Event:GetName() == "player_hurt" ) then
  431. local ME = client.GetLocalPlayerIndex();
  432. local INT_UID = Event:GetInt( "userid" );
  433. local INT_ATTACKER = Event:GetInt( "attacker" );
  434. local NAME_Victim = client.GetPlayerNameByUserID( INT_UID );
  435. local INDEX_Victim = client.GetPlayerIndexByUserID( INT_UID );
  436. local NAME_Attacker = client.GetPlayerNameByUserID( INT_ATTACKER );
  437. local INDEX_Attacker = client.GetPlayerIndexByUserID( INT_ATTACKER );
  438. if ( INDEX_Attacker == ME and INDEX_Victim ~= ME ) then
  439. volume = gui.GetValue("msc_hitmarker_volume");
  440. client.Command("playvol buttons\\arena_switch_press_02.wav "..volume, true);
  441. end
  442. end
  443. end
  444. end
  445. client.AllowListener( "player_hurt" );
  446. callbacks.Register( "FireGameEvent", "Metallic Hitsound", MetallicHitsound );
  447.  
  448. -- hit log
  449.  
  450. local HitLog = gui.Checkbox(miscgroupbox, "msc_hitlog", "Hit Log", false)
  451. 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
  452. local draw_hitsay = {};
  453. function ChatLogger(Event)
  454. if HitLog:GetValue() then
  455. if Event:GetName() == nil then return;
  456. elseif (Event:GetName() == 'player_hurt') then
  457. local ME = LocalPlayerIndex();
  458. local uid = Event:GetInt('userid');
  459. local i_attacker = Event:GetInt('attacker');
  460. local i_dmg = Event:GetString('dmg_health');
  461. local i_health = Event:GetString('health');
  462. local i_hitgroup = Event:GetInt('hitgroup');
  463. local ind_Attacker = PlayerIndexByUserID(i_attacker);
  464. local N_Attacker = PlayerNameByUserID(i_attacker);
  465. local ind_Victim = PlayerIndexByUserID(uid);
  466. local n_Victim = PlayerNameByUserID(uid);
  467. hitPlayerName = ""; hitSpot = ""; hitDmg = ""; hitHealthRemaining = "";
  468. hitPlayerName = n_Victim; hitSpot = i_hitgroup; hitDmg = i_dmg; hitHealthRemaining = i_health;
  469. response = string.format("Hit %s in the %s for %s damage (%s health remaining)\n", hitPlayerName, HitGroup(hitSpot), hitDmg, hitHealthRemaining);
  470. if ( ind_Attacker == ME and ind_Victim ~= ME ) then print(response);
  471. table.insert(draw_hitsay, {globals.RealTime(), response}); end end end end
  472. local On_Screen_Time, pixels_between_each_line, ScreenX, ScreenY = 10, 10, 10, 10
  473. function hitlog()
  474. if HitLog:GetValue() then local things_on_screen = 0;
  475. for k, l in pairs(draw_hitsay) do
  476. if globals.RealTime() > l[1] + On_Screen_Time then table.remove(draw_hitsay, k); else
  477. 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
  478. c_AllowListener('player_hurt'); cb_Register('Draw', 'drawing your hits', hitlog); cb_Register('FireGameEvent', 'ChatLogger', ChatLogger);
  479.  
  480. --------------------------------AA---------------------------------
  481.  
  482. -- Manual AA
  483.  
  484.  
  485.  
  486. -- menu toggle (DO NOT EDIT)
  487.  
  488.  
  489. local awMenu = gui.Reference("MENU");
  490.  
  491. local function hideMenu()
  492. if awMenu:IsActive() then
  493. eActive = 1
  494. else
  495. eActive = 0
  496. end
  497. if (essentialsmenu:GetValue()) then
  498. window:SetActive(eActive);
  499. else
  500. window:SetActive(0);
  501. end
  502. end
  503. callbacks.Register("Draw", "hideMenu", hideMenu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement