Advertisement
Guest User

Smeg Hack

a guest
Mar 11th, 2015
61,540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 111.36 KB | None | 0 0
  1. --[[
  2.           _____                    _____                    _____                    _____                            _____                    _____                    _____                    _____          
  3.          /\    \                  /\    \                  /\    \                  /\    \                          /\    \                  /\    \                  /\    \                  /\    \        
  4.         /::\    \                /::\____\                /::\    \                /::\    \                        /::\____\                /::\    \                /::\    \                /::\____\        
  5.        /::::\    \              /::::|   |               /::::\    \              /::::\    \                      /:::/    /               /::::\    \              /::::\    \              /:::/    /        
  6.       /::::::\    \            /:::::|   |              /::::::\    \            /::::::\    \                    /:::/    /               /::::::\    \            /::::::\    \            /:::/    /        
  7.      /:::/\:::\    \          /::::::|   |             /:::/\:::\    \          /:::/\:::\    \                  /:::/    /               /:::/\:::\    \          /:::/\:::\    \          /:::/    /          
  8.     /:::/__\:::\    \        /:::/|::|   |            /:::/__\:::\    \        /:::/  \:::\    \                /:::/____/               /:::/__\:::\    \        /:::/  \:::\    \        /:::/____/          
  9.     \:::\   \:::\    \      /:::/ |::|   |           /::::\   \:::\    \      /:::/    \:::\    \              /::::\    \              /::::\   \:::\    \      /:::/    \:::\    \      /::::\    \          
  10.   ___\:::\   \:::\    \    /:::/  |::|___|______    /::::::\   \:::\    \    /:::/    / \:::\    \            /::::::\    \   _____    /::::::\   \:::\    \    /:::/    / \:::\    \    /::::::\____\________  
  11.  /\   \:::\   \:::\    \  /:::/   |::::::::\    \  /:::/\:::\   \:::\    \  /:::/    /   \:::\ ___\          /:::/\:::\    \ /\    \  /:::/\:::\   \:::\    \  /:::/    /   \:::\    \  /:::/\:::::::::::\    \
  12. /::\   \:::\   \:::\____\/:::/    |:::::::::\____\/:::/__\:::\   \:::\____\/:::/____/  ___\:::|    |        /:::/  \:::\    /::\____\/:::/  \:::\   \:::\____\/:::/____/     \:::\____\/:::/  |:::::::::::\____\
  13. \:::\   \:::\   \::/    /\::/    / ~~~~~/:::/    /\:::\   \:::\   \::/    /\:::\    \ /\  /:::|____|        \::/    \:::\  /:::/    /\::/    \:::\  /:::/    /\:::\    \      \::/    /\::/   |::|~~~|~~~~~    
  14.  \:::\   \:::\   \/____/  \/____/      /:::/    /  \:::\   \:::\   \/____/  \:::\    /::\ \::/    /          \/____/ \:::\/:::/    /  \/____/ \:::\/:::/    /  \:::\    \      \/____/  \/____|::|   |          
  15.   \:::\   \:::\    \                  /:::/    /    \:::\   \:::\    \       \:::\   \:::\ \/____/                    \::::::/    /            \::::::/    /    \:::\    \                    |::|   |          
  16.    \:::\   \:::\____\                /:::/    /      \:::\   \:::\____\       \:::\   \:::\____\                       \::::/    /              \::::/    /      \:::\    \                   |::|   |          
  17.     \:::\  /:::/    /               /:::/    /        \:::\   \::/    /        \:::\  /:::/    /                       /:::/    /               /:::/    /        \:::\    \                  |::|   |          
  18.      \:::\/:::/    /               /:::/    /          \:::\   \/____/          \:::\/:::/    /                       /:::/    /               /:::/    /          \:::\    \                 |::|   |          
  19.       \::::::/    /               /:::/    /            \:::\    \               \::::::/    /                       /:::/    /               /:::/    /            \:::\    \                |::|   |          
  20.        \::::/    /               /:::/    /              \:::\____\               \::::/    /                       /:::/    /               /:::/    /              \:::\____\               \::|   |          
  21.         \::/    /                \::/    /                \::/    /                \::/____/                        \::/    /                \::/    /                \::/    /                \:|   |          
  22.          \/____/                  \/____/                  \/____/                                                   \/____/                  \/____/                  \/____/                  \|___|          
  23.         Made by mmmaaalll1.                                                                                                                                                                                                              
  24. --]]
  25.  
  26. /*
  27.     I don’t claim this to be the best hack in the world, in fact this is my first gLua hack (and my first real cheat). I would consider this cheat to be feature full, however being a relatively new gLua coder I accept that all my coding
  28.     is probably shit, feed back is welcome. As I have progressed with this cheat I have realized that I could have done things differently with much more efficient code etc. but I haven’t been bothered to fix it.
  29.  
  30.     Fyi, due to a update to Garry's Mod the incrementvar exploit (speed hack) no longer works.
  31. */
  32.  
  33.  
  34. //Variables
  35. local SmegHack = {}
  36. SmegHack.FriendsList = {}
  37. SmegHack.TextEntries = {}
  38. SmegHack.Hooks = {}
  39. SmegHack.EntityESP = {}
  40. SmegHack.BoneOrder = {}
  41. SmegHack.Traitors = {}
  42. SmegHack.Murderers = {}
  43.  
  44. SmegHack.Options = {}
  45.  
  46. SmegHack.Options["Aimbot_Toggle"] = false
  47. SmegHack.Options["Aimbot_LOSCheck"] = false
  48. SmegHack.Options["Aimbot_AutoWall"] = true
  49. SmegHack.Options["Aimbot_AimOnKey"] = false
  50. SmegHack.Options["Aimbot_AimOnKey_Key"] = 0
  51. SmegHack.Options["Aimbot_SmoothAim"] = false
  52. SmegHack.Options["Aimbot_SmoothAim_Value"] = 600
  53. SmegHack.Options["Aimbot_AimPriority"] = "Distance"
  54. SmegHack.Options["Aimbot_FOV"] = false
  55. if LocalPlayer():GetFOV() != nil then SmegHack.Options["Aimbot_FOV_Value"] = LocalPlayer():GetFOV() else SmegHack.Options["Aimbot_FOV_Value"] = 75 end
  56. SmegHack.Options["Aimbot_StickToTarget"] = false
  57. SmegHack.Options["Aimbot_BoneAim"] = false
  58. SmegHack.Options["Aimbot_AutoShoot"] = false
  59.  
  60. SmegHack.Options["Aimbot_AimTeam"] = false
  61. SmegHack.Options["Aimbot_AimOpponents"] = true
  62. SmegHack.Options["Aimbot_AimFriends"] = false
  63. SmegHack.Options["Aimbot_AimEnemies"] = false
  64. SmegHack.Options["Aimbot_AimNPCs"] = false
  65. SmegHack.Options["Aimbot_AimSpectators"] = false
  66. SmegHack.Options["Aimbot_AimTeamV"] = "Aim"
  67. SmegHack.Options["Aimbot_AimOpponentsV"] = "Aim"
  68. SmegHack.Options["Aimbot_AimFriendsV"] = "Aim"
  69. SmegHack.Options["Aimbot_AimEnemiesV"] = "Aim"
  70. SmegHack.Options["Aimbot_AimNPCsV"] = "Aim"
  71. SmegHack.Options["Aimbot_AimSpectatorsV"] = "Aim"
  72.  
  73. SmegHack.Options["Aimbot_OffsetX"] = 0
  74. SmegHack.Options["Aimbot_OffsetY"] = 0
  75.  
  76. SmegHack.Options["ESP_Toggle"] = false
  77. SmegHack.Options["ESP_ShowTeam"] = true
  78. SmegHack.Options["ESP_ShowOpponents"] = true
  79. SmegHack.Options["ESP_ShowFriends"] = false
  80. SmegHack.Options["ESP_ShowEnemies"] = false
  81. SmegHack.Options["ESP_ShowNPCs"] = false
  82. SmegHack.Options["ESP_ShowSpectators"] = false
  83.  
  84. SmegHack.Options["ESP_ShowTeamV"] = "Show"
  85. SmegHack.Options["ESP_ShowOpponentsV"] = "Show"
  86. SmegHack.Options["ESP_ShowFriendsV"] = "Show"
  87. SmegHack.Options["ESP_ShowEnemiesV"] = "Show"
  88. SmegHack.Options["ESP_ShowNPCsV"] = "Show"
  89. SmegHack.Options["ESP_ShowSpectatorsV"] = "Show"
  90.  
  91. SmegHack.Options["ESP_Entity_Toggle"] = false
  92. SmegHack.Options["ESP_Entities_NameTags"] = false
  93. SmegHack.Options["ESP_Entities_BoundaryBoxes"] = false
  94. SmegHack.Options["ESP_Entities_BoundaryBoxes_Mode"] = "2D"
  95.  
  96. SmegHack.Options["ESP_BoundaryBoxes"] = false
  97. SmegHack.Options["ESP_BoundaryBoxes_Mode"] = "2D"
  98. SmegHack.Options["ESP_NameTags"] = false
  99. SmegHack.Options["ESP_Weapon"] = false
  100. SmegHack.Options["ESP_Distance"] = false
  101. SmegHack.Options["ESP_Health"] = false
  102. SmegHack.Options["ESP_Skeleton"] = false
  103. SmegHack.Options["ESP_Crosshair"] = false
  104. SmegHack.Options["ESP_Crosshair_Size"] = 50
  105. SmegHack.Options["ESP_Crosshair_Mode"] = "Team"
  106. SmegHack.Options["ESP_Crosshair_Color_R"] = 0
  107. SmegHack.Options["ESP_Crosshair_Color_G"] = 0
  108. SmegHack.Options["ESP_Crosshair_Color_B"] = 255
  109. SmegHack.Options["ESP_Crosshair_Color_A"] = 255
  110.  
  111. SmegHack.Options["Misc_Clock"] = false
  112. SmegHack.Options["Misc_Clock_Mode"] = "Fast"
  113. if GetConVarNumber("host_timescale") != nil then SmegHack.Options["Misc_Clock_Speed"] = GetConVarNumber("host_timescale") else SmegHack.Options["Misc_Clock_Speed"] = 1 end
  114. SmegHack.Options["Misc_AdminBox"] = false
  115. SmegHack.Options["Misc_AdminBox_Mode"] = "Auto"
  116. SmegHack.Options["Misc_AdminBox_PosX"] = 0
  117. SmegHack.Options["Misc_AdminBox_PosY"] = 0
  118. SmegHack.Options["Misc_SpectatorsBox"] = false
  119. SmegHack.Options["Misc_SpectatorsBox_Mode"] = "Auto"
  120. SmegHack.Options["Misc_SpectatorsBox_PosX"] = 150
  121. SmegHack.Options["Misc_SpectatorsBox_PosY"] = 0
  122. SmegHack.Options["Misc_AutoButton"] = false
  123.  
  124. SmegHack.Options["Friends_FriendIsEnemy"] = false
  125. SmegHack.Options["Friends_SteamFriends"] = false
  126. SmegHack.Options["Friends_SteamEnemies"] = false
  127.  
  128. SmegHack.Options["Cams_Toggle"] = false
  129. SmegHack.Options["Cams_CSNoclip"] = false
  130. SmegHack.Options["Cams_CSNoclip_Speed"] = 10
  131. SmegHack.Options["Cams_ThirdPerson"] = false
  132. SmegHack.Options["Cams_ThirdPerson_Zoom"] = 30
  133.  
  134. SmegHack.Options["Bhop_Toggle"] = false
  135. SmegHack.Options["Bhop_FastWalk"] = false
  136. SmegHack.Options["Bhop_AutoHop"] = false
  137. SmegHack.Options["Bhop_AutoStrafe"] = false
  138. SmegHack.Options["Bhop_EdgeJump"] = false
  139. SmegHack.Options["Bhop_EdgeJump_Distance"] = 40
  140. SmegHack.Options["Bhop_Sideways"] = false
  141. SmegHack.Options["Bhop_WOnly"] = false
  142.  
  143. SmegHack.Options["Spam_Toggle"] = false
  144. SmegHack.Options["Spam_Delay"] = false
  145. SmegHack.Options["Spam_Delay_Value"] = 10
  146. SmegHack.Options["Spam_AntiAntiSpam"] = false
  147. SmegHack.Options["Spam_Message_1"] = false
  148. SmegHack.Options["Spam_Message_2"] = false
  149. SmegHack.Options["Spam_Message_3"] = false
  150. SmegHack.Options["Spam_Message_4"] = false
  151. SmegHack.Options["Spam_Message_5"] = false
  152.  
  153.  
  154. local function RandomString() return tostring(math.random(-9999999999, 9999999999)) end
  155. local function RandomShortString() return tostring(math.random(0, 100)) end
  156. local MenuOpen = false
  157. local UpdateBoneThink = false
  158. local UpdateBoneThinkNum = 0
  159. local NormSvCheats, NormHostTimeScale, TimeScaleChange = 0, 1, false
  160. local FPSValue = 0
  161. local DisplayBoxWidths = 0
  162. local AdminsListBool = false
  163. local SpecsListBool = false
  164. local AdminBoxTall, AdminBoxWide, SpecBoxTall, SpecBoxWide = 0, 0, 0, 0
  165. local GMode
  166. local MDone = false
  167. if string.find(string.lower(GAMEMODE.Name), "terror") != nil then
  168.     GMode = 1
  169. elseif string.find(string.lower(GAMEMODE.Name), "murder") != nil then
  170.     GMode = 2
  171. else
  172.     GMode = 3
  173. end
  174.  
  175. //Fonts
  176. surface.CreateFont("Menu_Title",{font = "coolvetica", size = 25})
  177. surface.CreateFont("ESP_Font_Main",{font = "coolvetica", size = 20})
  178. surface.CreateFont("ESP_Font_Entity",{font = "coolvetica", size = 17})
  179. surface.CreateFont("ESP_Font_Health",{font = "coolvetica", size = 12})
  180. surface.CreateFont("Cams",{font = "Arial", size = 25})
  181.  
  182. //Hack Management
  183. function AddHook( NormID, Event, ID, Function )
  184.     table.insert( SmegHack.Hooks, NormID.."|"..Event.."|"..ID )
  185.     hook.Add( Event, ID, Function )
  186. end
  187.  
  188. function RemoveHook( NormID )
  189.     for k, v in pairs( SmegHack.Hooks ) do
  190.         local SubTable = string.Explode( "|", v )
  191.         if SubTable[1] == NormID then
  192.             hook.Remove( SubTable[2], SubTable[3] )
  193.             table.remove( SmegHack.Hooks, k )
  194.         end
  195.     end
  196. end
  197.  
  198. function GetTeam( Ply )
  199.     local Team = Ply:Team()
  200.     local t, c
  201.     if GMode == 1 then
  202.         if Team == TEAM_SPECTATOR then
  203.             t = Team
  204.             c = team.GetColor(Team)
  205.         else
  206.             if table.HasValue(SmegHack.Traitors, Ply:SteamID()) then
  207.                 t = 1
  208.                 c = Color(255,0,0)
  209.             elseif Ply:GetRole() == 2 then
  210.                 t = 0
  211.                 c = Color(0,0,255)
  212.             else
  213.                 t = 0
  214.                 c = Color(0,255,0)
  215.             end
  216.         end
  217.     elseif GMode == 2 then
  218.         if Team == TEAM_SPECTATOR then
  219.             t = Team
  220.             c = team.GetColor(Team)
  221.         else
  222.             if table.HasValue(SmegHack.Murderers, Ply:SteamID()) then
  223.                 t = 2
  224.                 c = Color(255,0,0)
  225.             else
  226.                 t = 1
  227.                 local Moo = false
  228.                 for k, v in pairs(Ply:GetWeapons()) do
  229.                     if v:GetClass() == "weapon_mu_magnum" then
  230.                         Moo = true
  231.                         break
  232.                     end
  233.                 end
  234.                 if Moo == true then
  235.                     c = Color(0,0,255)
  236.                 else
  237.                     c = Color(0,255,0)
  238.                 end
  239.             end
  240.         end
  241.     else
  242.         t = Team
  243.         c = team.GetColor(Team)
  244.     end
  245.     return t, c
  246. end
  247.  
  248. function UnloadSmegHack( Display )
  249.     //Menu
  250.     concommand.Remove("SmegHack_Menu")
  251.  
  252.     //Hooks
  253.     SmegHack.Options["Misc_AdminBox"] = false
  254.     SmegHack.Options["Misc_SpectatorsBox"] = false //These remove the admin/spectator boxes
  255.  
  256.     timer.Simple( 0.5, function()
  257.         for k, v in pairs( SmegHack.Hooks ) do
  258.             local SubTable = string.Explode( "|", v )
  259.             hook.Remove( SubTable[2], SubTable[3] )
  260.         end
  261.         table.Empty( SmegHack.Hooks )
  262.  
  263.         //Clock Speed Manipulator
  264.         if GetConVarNumber("sv_cheats") != NormSvCheats then LocalPlayer():ConCommand("incrementvar sv_cheats "..NormSvCheats.." "..NormSvCheats.." "..NormSvCheats) end
  265.         if GetConVarNumber("host_timescale") != NormHostTimeScale then LocalPlayer():ConCommand("incrementvar host_timescale "..NormHostTimeScale.." "..NormHostTimeScale.." "..NormHostTimeScale) end
  266.         if Display then
  267.             AddHook( "Unloaded", "HUDPaint", RandomString(), function()
  268.                 draw.SimpleTextOutlined( "Smeg Hack Unloaded Successfully!", "Menu_Title", ScrW()/2, 50, Color(0,150,150), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  269.                 timer.Simple( 3, function()
  270.                     RemoveHook("Unloaded")
  271.                 end)
  272.             end)
  273.         end
  274.     end)
  275. end
  276.  
  277. function ReloadSmegHack( Display )
  278.     local Admin = SmegHack.Options["Misc_AdminBox"]
  279.     local Spec = SmegHack.Options["Misc_SpectatorsBox"]
  280.     UnloadSmegHack()
  281.     timer.Simple( 0.5, function()
  282.         LoadSmegHack()
  283.         if Admin then
  284.             SmegHack.Options["Misc_AdminBox"] = true
  285.             AddDisplayBox( "Admins", 1 )
  286.         end
  287.         if Spec then
  288.             SmegHack.Options["Misc_SpectatorsBox"] = true
  289.             AddDisplayBox( "Spectators", 2 )
  290.         end
  291.         LocalPlayer():ConCommand("SmegHack_Menu")
  292.         if Display then
  293.             AddHook( "Reloaded", "HUDPaint", RandomString(), function()
  294.                 draw.SimpleTextOutlined( "Smeg Hack Reloaded Successfully!", "Menu_Title", ScrW()/2, 50, Color(0,150,150), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  295.                 timer.Simple( 3, function()
  296.                     RemoveHook("Reloaded")
  297.                 end)
  298.             end)
  299.         end
  300.     end)
  301. end
  302.  
  303. function LoadSmegHack( Display )
  304.     //Commands
  305.     CreateClientConVar("SmegHack_Panic", 0, false, false)
  306.     concommand.Add("SmegHack_Menu", SmegHackMenu)
  307.  
  308.     local EntTable = ents.GetAll()
  309.     local FastWalk = false
  310.     local MenuDelay, FPSDelay = false, false
  311.     local ForwardMove = 0
  312.     local SideMove = 0
  313.     local TapS = false
  314.     local WLeft, WRight, WForward, WBack, WActive = false, false, true, false, false
  315.     local NoclipPos, NoclipAngles, NoclipOn, NoclipX, NoclipY, NoclipDuck, NoclipJump = LocalPlayer():EyePos(), LocalPlayer():GetAngles(), false, 0, 0, false, false
  316.     local ScaleActive, ScaleNum = false, 1
  317.     local SpamWait, Spam1, Spam2, Spam3, Spam4, Spam5 = false, false, false, false, false, false
  318.    
  319.     //Hooks
  320.     AddHook( "Menu", "Think", RandomString(), function()
  321.         if input.IsKeyDown(KEY_INSERT) && !MenuDelay then
  322.             MenuDelay = true
  323.             SmegHackMenu()
  324.             timer.Simple( 0.5, function() MenuDelay = false end )
  325.         end
  326.  
  327.         //For FPS
  328.         if FPSDelay == false then
  329.             FPSDelay = true
  330.             timer.Simple( 0.5, function() FPSValue = math.Round(1/RealFrameTime()) FPSDelay = false end )
  331.         end
  332.  
  333.         //For Time Scale
  334.         if SmegHack.Options["Misc_Clock"] && GetConVarNumber("SmegHack_Panic") == 0 then
  335.             if GetConVarNumber("sv_cheats") != 1 then LocalPlayer():ConCommand("incrementvar sv_cheats 1 1 1") end
  336.             if SmegHack.Options["Misc_Clock_Speed"] != ScaleNum || !ScaleActive || TimeScaleChange then
  337.                 local k
  338.                 if SmegHack.Options["Misc_Clock_Mode"] == "Slow" then k = 1-(SmegHack.Options["Misc_Clock_Speed"]/10) else k = SmegHack.Options["Misc_Clock_Speed"] end
  339.                 LocalPlayer():ConCommand("incrementvar host_timescale "..k.." "..k.." "..k) //Sozz, but I had to add kkk in somewhere :P
  340.                 ScaleNum = k
  341.                 if !ScaleActive then ScaleActive = true end
  342.             end
  343.         elseif SmegHack.Options["Misc_Clock"] && GetConVarNumber("SmegHack_Panic") == 1 then
  344.             if ScaleActive then
  345.                 LocalPlayer():ConCommand("incrementvar sv_cheats "..NormSvCheats.." "..NormSvCheats.." "..NormSvCheats)
  346.                 LocalPlayer():ConCommand("incrementvar host_timescale "..NormHostTimeScale.." "..NormHostTimeScale.." "..NormHostTimeScale)
  347.                 ScaleActive = false
  348.             end
  349.         end
  350.         //Reset T Round
  351.         if GMode == 1 then
  352.             if GetRoundState() != 3 then
  353.                 table.Empty(SmegHack.Traitors)
  354.             else
  355.                 for k, v in pairs(player.GetAll()) do
  356.                     local Ply = v
  357.                     local Team = Ply:GetRole()
  358.                     if Team == 2 then return end
  359.                     if LocalPlayer():GetRole() != 1 then
  360.                         for k, v in pairs(Ply:GetWeapons()) do
  361.                             if table.HasValue(v.CanBuy, 1) && !table.HasValue(SmegHack.Traitors, Ply:SteamID()) then
  362.                                 table.insert(SmegHack.Traitors, Ply:SteamID())
  363.                             end
  364.                         end
  365.                     else
  366.                         if Team == 1 && !table.HasValue(SmegHack.Traitors, Ply:SteamID()) then
  367.                             table.insert(SmegHack.Traitors, Ply:SteamID())
  368.                         end
  369.                     end
  370.                 end
  371.             end
  372.         elseif GMode == 2 then
  373.             if !MDone then
  374.                 for k, v in pairs(ents.GetAll()) do
  375.                     if v:GetClass() == "weapon_mu_knife" then
  376.                         table.insert(SmegHack.Murderers, v:GetOwner():SteamID())
  377.                     end
  378.                 end
  379.                 MDone = true
  380.             else
  381.                 for k, v in pairs(ents.GetAll()) do
  382.                     if v:GetClass() == "weapon_mu_knife" then
  383.                         if !table.HasValue(SmegHack.Murderers, v:GetOwner():SteamID()) then
  384.                             table.Empty(SmegHack.Murderers)
  385.                             MDone = false
  386.                         end
  387.                     end
  388.                 end
  389.             end
  390.         end
  391.     end)
  392.  
  393.     AddHook( "Aimbot", "Think", RandomString(), function()
  394.         if GetConVarNumber("SmegHack_Panic") == 0 && SmegHack.Options["Aimbot_Toggle"] && !MenuOpen && !(SmegHack.Options["Cams_Toggle"] && SmegHack.Options["Cams_CSNoclip"]) then
  395.             if !SmegHack.Options["Aimbot_AimOnKey"] || ( ( ( SmegHack.Options["Aimbot_AimOnKey_Key"] >= 107 && SmegHack.Options["Aimbot_AimOnKey_Key"] <= 113 ) && input.IsMouseDown(SmegHack.Options["Aimbot_AimOnKey_Key"]) ) || input.IsKeyDown(SmegHack.Options["Aimbot_AimOnKey_Key"]) ) then
  396.                 local FinAngleP
  397.                 local AimSpotT = {}
  398.                 local PlayerDistance, NewPlayerDistance, MousePos, NewMousePos = math.huge, math.huge, math.huge, math.huge
  399.                 if !SmegHack.Options["Aimbot_StickToTarget"] then EntTable = ents.GetAll() end
  400.                 for k, v in pairs(EntTable) do
  401.                     if v != LocalPlayer() && v:IsValid() && v:Health() > 0 && ( v:IsNPC() || v:IsPlayer() ) then
  402.                         local Ent = v
  403.                         local AimTeam, AimOpponents, AimFriends, AimEnemies, AimSpectators, AimNPCs = false, false, false, false, false, false
  404.                         local AimTeamV, AimOpponentsV, AimFriendsV, AimEnemiesV, AimSpectatorsV, AimNPCsV = true, true, true, true, true, true
  405.                         if !Ent:IsNPC() then
  406.                             local Team, _ = GetTeam(Ent)
  407.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimTeam"] && Team == GetTeam(LocalPlayer()) then
  408.                                 if SmegHack.Options["Aimbot_AimTeamV"] == "Aim" then
  409.                                     AimTeam = true
  410.                                 else
  411.                                     AimTeamV = false
  412.                                 end
  413.                             end
  414.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimOpponents"] && Team != GetTeam(LocalPlayer()) then
  415.                                 if SmegHack.Options["Aimbot_AimOpponentsV"] == "Aim" then
  416.                                     AimOpponents = true
  417.                                 else
  418.                                     AimOpponentsV = false
  419.                                 end
  420.                             end
  421.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimFriends"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  422.                                 if SmegHack.Options["Aimbot_AimFriendsV"] == "Aim" then
  423.                                     AimFriends = true
  424.                                 else
  425.                                     AimFriendsV = false
  426.                                 end
  427.                             end
  428.                             if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["Aimbot_AimEnemies"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  429.                                 if SmegHack.Options["Aimbot_AimEnemiesV"] == "Aim" then
  430.                                     AimEnemies = true
  431.                                 else
  432.                                     AimEnemiesV = false
  433.                                 end
  434.                             end
  435.                             if SmegHack.Options["Aimbot_AimSpectators"] && Ent:Team() == TEAM_SPECTATOR then
  436.                                 if SmegHack.Options["AimSpectatorsV"] == "Aim" then
  437.                                     AimSpectators = true
  438.                                 else
  439.                                     AimSpectatorsV = false
  440.                                 end
  441.                             end
  442.                         else
  443.                             if SmegHack.Options["Aimbot_AimNPCs"] && SmegHack.Options["Aimbot_AimNPCsV"] == "Aim" then
  444.                                 if SmegHack.Options["Aimbot_AimNPCsV"] == "Aim" then
  445.                                     AimNPCs = true
  446.                                 else
  447.                                     AimNPCsV = false
  448.                                 end
  449.                             end
  450.                         end
  451.                         if (AimTeam || AimOpponents || AimFriends || AimEnemies || AimSpectators || AimNPCs) && (AimTeamV && AimOpponentsV && AimFriendsV && AimEnemiesV && AimSpectatorsV && AimNPCsV) then
  452.                             local LOS, AimP, AimF = false, false, false
  453.                             local AimSpot
  454.  
  455.                             if SmegHack.Options["Aimbot_BoneAim"] && SmegHack.BoneOrder[1] != nil then
  456.                                 table.Empty( AimSpotT )
  457.                                 for k, v in pairs(SmegHack.BoneOrder) do
  458.                                     if Ent:GetBonePosition(Ent:LookupBone(v)) != nil && AimSpot == nil then
  459.                                         AimSpot = Ent:GetBonePosition(Ent:LookupBone(v))
  460.                                     end
  461.                                     if Ent:GetBonePosition(Ent:LookupBone(v)) != nil then
  462.                                         local BonePos = Ent:GetBonePosition(Ent:LookupBone(v))
  463.                                         if v == "ValveBiped.Bip01_Head1" then BonePos = BonePos+Vector(0,0,1) end
  464.                                         table.insert( AimSpotT, BonePos )
  465.                                     end
  466.                                 end
  467.                                 if AimSpot == nil then AimSpot = Ent:LocalToWorld(Ent:OBBCenter()) end
  468.                                 if AimSpotT == nil then AimSpotT = {Ent:LocalToWorld(Ent:OBBCenter())} end
  469.                             else
  470.                                 AimSpot = Ent:LocalToWorld(Ent:OBBCenter())
  471.                                 AimSpotT = {Ent:LocalToWorld(Ent:OBBCenter())}
  472.                             end
  473.  
  474.                             local CurAngle = LocalPlayer():EyeAngles()
  475.                             local CurPos = LocalPlayer():GetShootPos()
  476.  
  477.                             AimSpot = AimSpot+(CurAngle:Right()*SmegHack.Options["Aimbot_OffsetX"]) //This is screw up when close to your target
  478.                             AimSpot.z = AimSpot.z + SmegHack.Options["Aimbot_OffsetY"]
  479.  
  480.                             local FinAngle = ( AimSpot - CurPos ):Angle()
  481.                             if FinAngle.y > 180 then
  482.                                 FinAngle.y = FinAngle.y-360
  483.                             end
  484.  
  485.                             if SmegHack.Options["Aimbot_AimPriority"] == "Distance" then
  486.                                 if LocalPlayer():GetShootPos():Distance(AimSpot) < PlayerDistance then NewPlayerDistance = LocalPlayer():GetShootPos():Distance(AimSpot) AimP = true end
  487.                             elseif SmegHack.Options["Aimbot_AimPriority"] == "Crosshair" then
  488.                                 local FirstCalc = math.Distance( CurAngle.x, CurAngle.y, FinAngle.x, FinAngle.y )
  489.                                 local Calc
  490.                                 if FirstCalc > 180 && ( ( CurAngle.y >= 0 && FinAngle.y < 0 ) || ( CurAngle.y < 0 && FinAngle.y >= 0 ) ) then
  491.                                     Calc = 360 - math.Distance( CurAngle.x, CurAngle.y, FinAngle.x, FinAngle.y )
  492.                                 else
  493.                                     Calc = math.Distance( CurAngle.x, CurAngle.y, FinAngle.x, FinAngle.y )
  494.                                 end
  495.                                 if Calc < MousePos then NewMousePos = Calc AimP = true end
  496.                             end
  497.  
  498.                             if SmegHack.Options["Aimbot_FOV"] then
  499.                                 local CalcX = FinAngle.y - CurAngle.y
  500.                                 local CalcY = FinAngle.x - CurAngle.x
  501.                                 if CalcY < 0 then CalcY = CalcY * -1 end
  502.                                 if CalcX < 0 then CalcX = CalcX * -1 end
  503.                                 if CalcY > 180 then CalcY = 360 - CalcY end
  504.                                 if CalcX > 180 then CalcX = 360 - CalcX end
  505.                                 if CalcX <= SmegHack.Options["Aimbot_FOV_Value"]/2 && CalcY <= SmegHack.Options["Aimbot_FOV_Value"]*0.4 then AimF = true end
  506.                             else
  507.                                 AimF = true
  508.                             end
  509.  
  510.                             if SmegHack.Options["Aimbot_LOSCheck"] || SmegHack.Options["Aimbot_AutoWall"] then
  511.                                 for k, v in pairs(AimSpotT) do
  512.                                     local TrLOS = {}
  513.                                     TrLOS.start = LocalPlayer():GetShootPos()
  514.                                     TrLOS.endpos = v
  515.                                     TrLOS.filter = {}
  516.                                     if SmegHack.Options["Aimbot_StickToTarget"] then
  517.                                         for k, v in pairs(ents.GetAll()) do
  518.                                             if v:IsValid() && ( v:IsPlayer() || v:IsNPC() ) then
  519.                                                 table.insert( TrLOS.filter, v )
  520.                                             end
  521.                                         end
  522.                                     else TrLOS.filter = {LocalPlayer(), Ent} end
  523.                                     if SmegHack.Options["Aimbot_AutoWall"] then TrLOS.mask = MASK_SHOT else TrLOS.mask = MASK_VISIBLE_AND_NPCS end
  524.                                     if util.TraceLine(TrLOS).Fraction == 1 then
  525.                                         LOS = true
  526.                                         AimSpot = v
  527.                                         break
  528.                                     end
  529.                                 end
  530.                             else
  531.                                 LOS = true
  532.                             end
  533.                             if LOS && AimP && AimF then
  534.                                 EntTable = {Ent}
  535.                                 FinAngleP = FinAngle
  536.                                 PlayerDistance = NewPlayerDistance
  537.                                 MousePos = NewMousePos
  538.                             elseif SmegHack.Options["Aimbot_StickToTarget"] && EntTable[2] != nil then
  539.                                 EntTable = ents.GetAll()
  540.                             end
  541.                         end
  542.                     end
  543.                 end
  544.                 if EntTable != nil && FinAngleP != nil then
  545.                     if SmegHack.Options["Aimbot_SmoothAim"] then
  546.                         SmoothAngles( FinAngleP, SmegHack.Options["Aimbot_SmoothAim_Value"] )
  547.                     else
  548.                         if SmegHack.Options["Aimbot_AutoShoot"] then
  549.                             LocalPlayer():SetEyeAngles(FinAngleP)
  550.                             LocalPlayer():ConCommand("+attack")
  551.                             timer.Simple( 0.1, function() LocalPlayer():ConCommand("-attack") end )
  552.                         else
  553.                             LocalPlayer():SetEyeAngles(FinAngleP)
  554.                         end
  555.                     end
  556.                 elseif EntTable[2] == nil then
  557.                     EntTable = ents.GetAll()
  558.                 end
  559.             else
  560.                 if EntTable[2] == nil then
  561.                     EntTable = ents.GetAll()
  562.                 end
  563.             end
  564.         end
  565.     end)
  566.     AddHook( "ChatSpam", "Think", RandomString(), function()
  567.         if GetConVarNumber("SmegHack_Panic") == 0 then
  568.             if !SpamWait then
  569.                 if SmegHack.Options["Spam_Toggle"] then
  570.                     if SmegHack.Options["Spam_Delay"] then
  571.                         SpamWait = true
  572.                         Spam1, Spam2, Spam3, Spam4, Spam5 = false, false, false, false, false
  573.                         local Timer = SmegHack.Options["Spam_Delay_Value"]
  574.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam1"] != nil then
  575.                             local String = SmegHack.TextEntries["Spam1"]
  576.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  577.                             timer.Simple( Timer, function()
  578.                                 LocalPlayer():ConCommand("say "..String)
  579.                                 Spam1 = true
  580.                             end)
  581.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  582.                         else Spam1 = true end
  583.  
  584.                         if SmegHack.Options["Spam_Message_2"] && SmegHack.TextEntries["Spam2"] != nil then
  585.                             local String = SmegHack.TextEntries["Spam2"]
  586.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  587.                             timer.Simple( Timer, function()
  588.                                 LocalPlayer():ConCommand("say "..String)
  589.                                 Spam2 = true
  590.                             end)
  591.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  592.                         else Spam2 = true end
  593.  
  594.                         if SmegHack.Options["Spam_Message_3"] && SmegHack.TextEntries["Spam3"] != nil then
  595.                             local String = SmegHack.TextEntries["Spam3"]
  596.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  597.                             timer.Simple( Timer, function()
  598.                                 LocalPlayer():ConCommand("say "..String)
  599.                                 Spam3 = true
  600.                             end)
  601.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  602.                         else Spam3 = true end
  603.  
  604.                         if SmegHack.Options["Spam_Message_4"] && SmegHack.TextEntries["Spam4"] != nil then
  605.                             local String = SmegHack.TextEntries["Spam4"]
  606.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  607.                             timer.Simple( Timer, function()
  608.                                 LocalPlayer():ConCommand("say "..String)
  609.                                 Spam4 = true
  610.                             end)
  611.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  612.                         else Spam4 = true end
  613.  
  614.                         if SmegHack.Options["Spam_Message_5"] && SmegHack.TextEntries["Spam5"] != nil then
  615.                             local String = SmegHack.TextEntries["Spam5"]
  616.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  617.                             timer.Simple( Timer, function()
  618.                                 LocalPlayer():ConCommand("say "..String)
  619.                                 Spam5 = true
  620.                             end)
  621.                             Timer = Timer + SmegHack.Options["Spam_Delay_Value"]
  622.                         else Spam5 = true end
  623.                     else
  624.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam1"] != nil then
  625.                             local String = SmegHack.TextEntries["Spam1"]
  626.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  627.                             LocalPlayer():ConCommand("say "..String)
  628.                         end
  629.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam2"] != nil then
  630.                             local String = SmegHack.TextEntries["Spam2"]
  631.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  632.                             LocalPlayer():ConCommand("say "..String)
  633.                         end
  634.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam3"] != nil then
  635.                             local String = SmegHack.TextEntries["Spam3"]
  636.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  637.                             LocalPlayer():ConCommand("say "..String)
  638.                         end
  639.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam4"] != nil then
  640.                             local String = SmegHack.TextEntries["Spam4"]
  641.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  642.                             LocalPlayer():ConCommand("say "..String)
  643.                         end
  644.                         if SmegHack.Options["Spam_Message_1"] && SmegHack.TextEntries["Spam5"] != nil then
  645.                             local String = SmegHack.TextEntries["Spam5"]
  646.                             if SmegHack.Options["Spam_AntiAntiSpam"] then String = String.." ("..RandomShortString()..")" end
  647.                             LocalPlayer():ConCommand("say "..String)
  648.                         end
  649.                     end
  650.                 end
  651.             else
  652.                 if Spam1 && Spam2 && Spam3 && Spam4 && Spam5 then SpamWait = false end
  653.             end
  654.         end
  655.     end)
  656.     AddHook( "ESP", "HUDPaint", RandomString(), function()
  657.         if GetConVarNumber("SmegHack_Panic") == 0 then
  658.             if SmegHack.Options["Cams_Toggle"] && SmegHack.Options["Cams_CSNoclip"] then
  659.                 local MaxX, MaxY, MinX, MinY = ESPGetPos( LocalPlayer() )
  660.                 local Dist = math.floor(LocalPlayer():GetPos():Distance(NoclipPos)/40)
  661.                 draw.SimpleTextOutlined( "You are here ".."["..Dist.."]", "Cams", ((MaxX-MinX)/2)+MinX, MinY-5, Color(0,150,250), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0) )
  662.                 surface.SetDrawColor( Color(0,0,255) )
  663.                 surface.DrawLine( MaxX, MaxY, MinX, MaxY )
  664.                 surface.DrawLine( MaxX, MaxY, MaxX, MinY )
  665.                 surface.DrawLine( MinX, MinY, MaxX, MinY )
  666.                 surface.DrawLine( MinX, MinY, MinX, MaxY )
  667.             end
  668.             if SmegHack.Options["ESP_Toggle"] || SmegHack.Options["ESP_Entity_Toggle"] then
  669.                 for k, v in pairs( ents.GetAll() ) do
  670.                     if v:IsValid() && v != LocalPlayer() && !v:IsDormant() then
  671.                         local Ent = v
  672.                         if SmegHack.Options["ESP_Entity_Toggle"] then
  673.                             for k, v in pairs( SmegHack.EntityESP ) do
  674.                                 if v == Ent:GetClass() && Ent:GetOwner() != LocalPlayer()  then
  675.                                     local MaxX, MaxY, MinX, MinY, V1, V2, V3, V4, V5, V6, V7, V8 = ESPGetPos( Ent )
  676.                                     if SmegHack.Options["ESP_Entities_NameTags"] == true then
  677.                                         local Name = Ent:GetClass()
  678.                                         local Dist = math.floor(Ent:GetPos():Distance(LocalPlayer():GetShootPos())/40)
  679.                                         draw.SimpleTextOutlined( Name.." ["..Dist.."]", "ESP_Font_Entity", ((MaxX-MinX)/2)+MinX, MinY-5, Color(0,160,240), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0,0,0) )
  680.                                     end
  681.                                     if SmegHack.Options["ESP_Entities_BoundaryBoxes"] == true then
  682.                                         surface.SetDrawColor( Color(0,160,240) )
  683.                                         if SmegHack.Options["ESP_Entities_BoundaryBoxes_Mode"] == "2D" then
  684.                                             surface.DrawLine( MaxX, MaxY, MinX, MaxY )
  685.                                             surface.DrawLine( MaxX, MaxY, MaxX, MinY )
  686.                                             surface.DrawLine( MinX, MinY, MaxX, MinY )
  687.                                             surface.DrawLine( MinX, MinY, MinX, MaxY )
  688.                                         else
  689.                                             //Top Box
  690.                                             surface.DrawLine( V4.x, V4.y, V6.x, V6.y )
  691.                                             surface.DrawLine( V1.x, V1.y, V8.x, V8.y )
  692.                                             surface.DrawLine( V6.x, V6.y, V8.x, V8.y )
  693.                                             surface.DrawLine( V4.x, V4.y, V1.x, V1.y )
  694.  
  695.                                             //Bottom Box
  696.                                             surface.DrawLine( V3.x, V3.y, V5.x, V5.y )
  697.                                             surface.DrawLine( V2.x, V2.y, V7.x, V7.y )
  698.                                             surface.DrawLine( V3.x, V3.y, V2.x, V2.y )
  699.                                             surface.DrawLine( V5.x, V5.y, V7.x, V7.y )
  700.  
  701.                                             //Verticals
  702.                                             surface.DrawLine( V3.x, V3.y, V4.x, V4.y )
  703.                                             surface.DrawLine( V2.x, V2.y, V1.x, V1.y )
  704.                                             surface.DrawLine( V7.x, V7.y, V8.x, V8.y )
  705.                                             surface.DrawLine( V5.x, V5.y, V6.x, V6.y )
  706.                                         end
  707.                                     end
  708.                                 end
  709.                             end
  710.                         end
  711.                         if SmegHack.Options["ESP_Toggle"] then
  712.                             if SmegHack.Options["ESP_Crosshair"] == true then
  713.                                 local _, TeamColor = GetTeam(LocalPlayer())
  714.                                 if SmegHack.Options["ESP_Crosshair_Mode"] == "Team" && Color(SmegHack.Options["ESP_Crosshair_Color_R"], SmegHack.Options["ESP_Crosshair_Color_G"], SmegHack.Options["ESP_Crosshair_Color_B"]) != TeamColor then
  715.                                     SmegHack.Options["ESP_Crosshair_Color_R"] = TeamColor.r
  716.                                     SmegHack.Options["ESP_Crosshair_Color_G"] = TeamColor.g
  717.                                     SmegHack.Options["ESP_Crosshair_Color_B"] = TeamColor.b
  718.                                 end
  719.                                 surface.SetDrawColor(Color(SmegHack.Options["ESP_Crosshair_Color_R"], SmegHack.Options["ESP_Crosshair_Color_G"], SmegHack.Options["ESP_Crosshair_Color_B"], SmegHack.Options["ESP_Crosshair_Color_A"]))
  720.                                 surface.DrawLine((ScrW()/2)-SmegHack.Options["ESP_Crosshair_Size"], ScrH()/2, (ScrW()/2)+SmegHack.Options["ESP_Crosshair_Size"], ScrH()/2)
  721.                                 surface.DrawLine(ScrW()/2, (ScrH()/2)-SmegHack.Options["ESP_Crosshair_Size"], ScrW()/2, (ScrH()/2)+SmegHack.Options["ESP_Crosshair_Size"])
  722.                             end
  723.                             if Ent:IsNPC() || Ent:IsPlayer() then
  724.                                 local Name
  725.                                 local ShowTeam, ShowOpponents, ShowFriends, ShowEnemies, ShowNPCs, ShowSpectators = false, false, false, false, false, false
  726.                                 local ShowTeamV, ShowOpponentsV, ShowFriendsV, ShowEnemiesV, ShowNPCsV, ShowSpectatorsV = true, true, true, true, true, true
  727.  
  728.                                 if !Ent:IsNPC() && Ent:Health() > 0 then
  729.                                     local Team, _ = GetTeam(Ent)
  730.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowTeam"] && Team == GetTeam(LocalPlayer()) then
  731.                                         if SmegHack.Options["ESP_ShowTeamV"] == "Show" then
  732.                                             ShowTeam = true
  733.                                         else
  734.                                             ShowTeamV = false
  735.                                         end
  736.                                     end
  737.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowOpponents"] && Team != GetTeam(LocalPlayer()) then
  738.                                         if SmegHack.Options["ESP_ShowOpponentsV"] == "Show" then
  739.                                             ShowOpponents = true
  740.                                         else
  741.                                             ShowOpponentsV = false
  742.                                         end
  743.                                     end
  744.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowFriends"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  745.                                         if SmegHack.Options["ESP_ShowFriendsV"] == "Show" then
  746.                                             ShowFriends = true
  747.                                         else
  748.                                             ShowFriendsV = false
  749.                                         end
  750.                                     end
  751.                                     if Ent:Team() != TEAM_SPECTATOR && SmegHack.Options["ESP_ShowEnemies"] && ( (!SmegHack.Options["Friends_FriendIsEnemy"] && !table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) || (SmegHack.Options["Friends_FriendIsEnemy"] && table.HasValue( SmegHack.FriendsList, Ent:SteamID() ) ) ) then
  752.                                         if SmegHack.Options["ESP_ShowEnemiesV"] =="Show" then
  753.                                             ShowEnemies = true
  754.                                         else
  755.                                             ShowEnemiesV = false
  756.                                         end
  757.                                     end
  758.                                     if SmegHack.Options["ESP_ShowSpectators"] && Ent:Team() == TEAM_SPECTATOR then
  759.                                         if SmegHack.Options["ESP_ShowSpectatorsV"] == "Show" then
  760.                                             ShowSpectators = true
  761.                                         else
  762.                                             ShowSpectatorsV = false
  763.                                         end
  764.                                     end
  765.                                     Name = Ent:Nick()
  766.                                 else
  767.                                     if SmegHack.Options["ESP_ShowNPCs"] && Ent:IsNPC() then
  768.                                         if SmegHack.Options["ESP_ShowNPCsV"] == "Show" then
  769.                                             ShowNPCs = true
  770.                                         else
  771.                                             ShowNPCsV = false
  772.                                         end
  773.                                     end
  774.                                     Name = Ent:GetClass()
  775.                                 end
  776.                                 if (ShowTeam || ShowOpponents || ShowFriends || ShowEnemies || ShowNPCs || ShowSpectators) && (ShowTeamV && ShowOpponentsV && ShowFriendsV && ShowEnemiesV && ShowNPCsV && ShowSpectatorsV) then
  777.                                     local MaxX, MaxY, MinX, MinY, V1, V2, V3, V4, V5, V6, V7, V8 = ESPGetPos( Ent )
  778.                                     local DrawColor
  779.                                     local ESPPos = MinY
  780.                                     if Ent:IsNPC() then DrawColor = Color(170,220,120) else _, DrawColor = GetTeam(Ent) end
  781.                                     if SmegHack.Options["ESP_BoundaryBoxes"] then
  782.                                         surface.SetDrawColor( DrawColor )
  783.                                         if SmegHack.Options["ESP_BoundaryBoxes_Mode"] == "2D" then
  784.                                             surface.DrawLine( MaxX, MaxY, MinX, MaxY )
  785.                                             surface.DrawLine( MaxX, MaxY, MaxX, MinY )
  786.                                             surface.DrawLine( MinX, MinY, MaxX, MinY )
  787.                                             surface.DrawLine( MinX, MinY, MinX, MaxY )
  788.                                         else
  789.                                             //Top Box
  790.                                             surface.DrawLine( V4.x, V4.y, V6.x, V6.y )
  791.                                             surface.DrawLine( V1.x, V1.y, V8.x, V8.y )
  792.                                             surface.DrawLine( V6.x, V6.y, V8.x, V8.y )
  793.                                             surface.DrawLine( V4.x, V4.y, V1.x, V1.y )
  794.  
  795.                                             //Bottom Box
  796.                                             surface.DrawLine( V3.x, V3.y, V5.x, V5.y )
  797.                                             surface.DrawLine( V2.x, V2.y, V7.x, V7.y )
  798.                                             surface.DrawLine( V3.x, V3.y, V2.x, V2.y )
  799.                                             surface.DrawLine( V5.x, V5.y, V7.x, V7.y )
  800.  
  801.                                             //Verticals
  802.                                             surface.DrawLine( V3.x, V3.y, V4.x, V4.y )
  803.                                             surface.DrawLine( V2.x, V2.y, V1.x, V1.y )
  804.                                             surface.DrawLine( V7.x, V7.y, V8.x, V8.y )
  805.                                             surface.DrawLine( V5.x, V5.y, V6.x, V6.y )
  806.                                         end
  807.                                     end
  808.                                     if SmegHack.Options["ESP_Health"] then                 
  809.                                         local HealthColor = Color( (1-(Ent:Health()/Ent:GetMaxHealth()))*255, (Ent:Health()/Ent:GetMaxHealth())*255, 0 )
  810.                                         local HealthString = tostring(Ent:Health())
  811.  
  812.                                         if MaxY-MinY <= 45 then
  813.                                             local TopHealthFar = ((1-(Ent:Health()/Ent:GetMaxHealth()))*43)+MinY+1
  814.                                             local BottomHealthFar = 43-((1-(Ent:Health()/Ent:GetMaxHealth()))*43)
  815.                                             draw.RoundedBox( 0, MinX-15, MinY, 10, 45, Color(0,0,0) )
  816.                                             draw.RoundedBox( 0, MinX-14, TopHealthFar, 8, BottomHealthFar, HealthColor )
  817.                                             draw.SimpleTextOutlined( HealthString.."%", "ESP_Font_Entity", MinX-17, MinY+22.5, HealthColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  818.                                         else
  819.                                             local TopHealthClose = (MinY+((1-(Ent:Health()/Ent:GetMaxHealth()))*(MaxY-MinY)))+1
  820.                                             local BottomHealthClose = ((Ent:Health()/Ent:GetMaxHealth())*(MaxY-MinY))-2
  821.                                             draw.RoundedBox( 0, MinX-15, MinY, 10, MaxY-MinY, Color(0,0,0) )
  822.                                             draw.RoundedBox( 0, MinX-14, TopHealthClose, 8, BottomHealthClose, HealthColor )
  823.                                             draw.SimpleTextOutlined( HealthString.."%", "ESP_Font_Entity", MinX-17, ((MinY-MaxY)/2)+MaxY, HealthColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  824.                                         end
  825.  
  826.                                     end
  827.                                     if SmegHack.Options["ESP_NameTags"] then
  828.                                         if GMode == 2 && Ent:GetBystanderName() != nil then
  829.  
  830.                                             draw.SimpleTextOutlined( "N: "..Name.." ("..Ent:GetBystanderName()..")", "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  831.                                         else
  832.                                             draw.SimpleTextOutlined( "N: "..Name, "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  833.                                         end
  834.                                         ESPPos = ESPPos + 15
  835.                                     end
  836.                                     if SmegHack.Options["ESP_Weapon"] then
  837.                                         if Ent:GetActiveWeapon():IsValid() then
  838.                                             local WName = Ent:GetActiveWeapon():GetPrintName()
  839.                                             draw.SimpleTextOutlined( "W: "..WName, "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  840.                                             ESPPos = ESPPos + 15
  841.                                         end
  842.                                     end
  843.                                     if SmegHack.Options["ESP_Distance"] then
  844.                                         local Dist = math.floor(Ent:GetPos():Distance(LocalPlayer():GetShootPos())/40)
  845.                                         draw.SimpleTextOutlined( "D: "..Dist, "ESP_Font_Main", MaxX+5, ESPPos, DrawColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0,0,0) )
  846.                                         ESPPos = ESPPos + 15
  847.                                     end
  848.                                     if SmegHack.Options["ESP_Skeleton"] then
  849.                                         local Bones = {}
  850.                                         local Success = true
  851.                                         for k, v in pairs(SmegHack.Bones) do
  852.                                             if Ent:LookupBone(v) != nil && Ent:GetBonePosition(Ent:LookupBone(v)) != nil then
  853.                                                 table.insert( Bones, Ent:GetBonePosition(Ent:LookupBone(v)):ToScreen() )
  854.                                             else
  855.                                                 Success = false //Just incase entities have some bones but not others (I have no idea if that happens, but I figgured better safe then sorry)
  856.                                                 return
  857.                                             end
  858.                                         end
  859.                                         if Success then
  860.                                             surface.SetDrawColor( DrawColor )
  861.                                             //Spine
  862.                                             surface.DrawLine( Bones[1].x, Bones[1].y, Bones[2].x, Bones[2].y )
  863.                                             surface.DrawLine( Bones[2].x, Bones[2].y, Bones[3].x, Bones[3].y )
  864.                                             surface.DrawLine( Bones[3].x, Bones[3].y, Bones[4].x, Bones[4].y )
  865.                                             surface.DrawLine( Bones[4].x, Bones[4].y, Bones[5].x, Bones[5].y )
  866.                                             surface.DrawLine( Bones[5].x, Bones[5].y, Bones[6].x, Bones[6].y )
  867.                                             surface.DrawLine( Bones[6].x, Bones[6].y, Bones[7].x, Bones[7].y )
  868.  
  869.                                             //Legs
  870.                                             surface.DrawLine( Bones[7].x, Bones[7].y, Bones[14].x, Bones[14].y )
  871.                                             surface.DrawLine( Bones[14].x, Bones[14].y, Bones[15].x, Bones[15].y )
  872.                                             surface.DrawLine( Bones[15].x, Bones[15].y, Bones[16].x, Bones[16].y )
  873.                                             surface.DrawLine( Bones[16].x, Bones[16].y, Bones[17].x, Bones[17].y )
  874.  
  875.                                             surface.DrawLine( Bones[7].x, Bones[7].y, Bones[18].x, Bones[18].y )
  876.                                             surface.DrawLine( Bones[18].x, Bones[18].y, Bones[19].x, Bones[19].y )
  877.                                             surface.DrawLine( Bones[19].x, Bones[19].y, Bones[20].x, Bones[20].y )
  878.                                             surface.DrawLine( Bones[20].x, Bones[20].y, Bones[21].x, Bones[21].y )
  879.  
  880.                                             //Arms
  881.                                             surface.DrawLine( Bones[3].x, Bones[3].y, Bones[8].x, Bones[8].y )
  882.                                             surface.DrawLine( Bones[8].x, Bones[8].y, Bones[9].x, Bones[9].y )
  883.                                             surface.DrawLine( Bones[9].x, Bones[9].y, Bones[10].x, Bones[10].y )
  884.  
  885.                                             surface.DrawLine( Bones[3].x, Bones[3].y, Bones[11].x, Bones[11].y )
  886.                                             surface.DrawLine( Bones[11].x, Bones[11].y, Bones[12].x, Bones[12].y )
  887.                                             surface.DrawLine( Bones[12].x, Bones[12].y, Bones[13].x, Bones[13].y )
  888.  
  889.                                         end
  890.                                     end
  891.                                 end
  892.                             end
  893.                         end
  894.                     end
  895.                 end
  896.             end
  897.         end
  898.     end)
  899.  
  900.     AddHook( "BhopCalcView", "CalcView", RandomString(), function( ply, pos, angles, fov )
  901.         if GetConVarNumber("SmegHack_Panic") == 0 && SmegHack.Options["Bhop_Toggle"] then
  902.             if SmegHack.Options["Bhop_Sideways"] then
  903.                 local CamData = {}
  904.                 if TapS then CamData.angles = LocalPlayer():EyeAngles()+Angle(0,180,0) else CamData.angles = LocalPlayer():EyeAngles()+Angle(0,90,0) end
  905.                 CamData.origin = LocalPlayer():GetShootPos()
  906.                 CamData.fov = fov
  907.  
  908.                 return CamData
  909.             elseif SmegHack.Options["Bhop_WOnly"] then
  910.                 local CamData = {}
  911.                 if WLeft then
  912.                     CamData.angles = LocalPlayer():EyeAngles()-Angle(0,90,0)
  913.                 elseif WRight then
  914.                     CamData.angles = LocalPlayer():EyeAngles()+Angle(0,90,0)
  915.                 elseif WBack then
  916.                     CamData.angles = LocalPlayer():EyeAngles()+Angle(0,180,0)
  917.                 end
  918.                 CamData.origin = LocalPlayer():GetShootPos()
  919.                 CamData.fov = fov
  920.  
  921.                 return CamData
  922.             end
  923.         end
  924.     end)
  925.     AddHook( "Bhop", "CreateMove", RandomString(), function(ucmd)
  926.         if SmegHack.Options["Bhop_Toggle"] && GetConVarNumber("SmegHack_Panic") == 0 then
  927.             if SmegHack.Options["Bhop_FastWalk"] then
  928.                 if LocalPlayer():IsOnGround() && ( ucmd:KeyDown(IN_FORWARD) || ucmd:KeyDown(IN_BACK) ) then
  929.                     if FastWalk == false then
  930.                         ucmd:SetSideMove(ucmd:GetSideMove()-5000)
  931.                     else
  932.                         ucmd:SetSideMove(ucmd:GetSideMove()+5000)
  933.                     end
  934.                     FastWalk = !FastWalk
  935.                 end
  936.             end
  937.             if SmegHack.Options["Bhop_AutoHop"] then
  938.                 if ucmd:KeyDown(IN_JUMP) then
  939.                     if LocalPlayer():WaterLevel() <= 1 && LocalPlayer():GetMoveType() != MOVETYPE_LADDER && !LocalPlayer():IsOnGround() then
  940.                         ucmd:RemoveKey(IN_JUMP)
  941.                     end
  942.                 end
  943.             end
  944.             if SmegHack.Options["Bhop_AutoStrafe"] && !LocalPlayer():IsOnGround() && LocalPlayer():WaterLevel() <= 1 && LocalPlayer():GetMoveType() != MOVETYPE_LADDER && !( LocalPlayer():KeyDown(IN_FORWARD) || LocalPlayer():KeyDown(IN_BACK) || LocalPlayer():KeyDown(IN_MOVELEFT) || LocalPlayer():KeyDown(IN_MOVERIGHT) ) then
  945.                 if SmegHack.Options["Bhop_Sideways"] && !TapS then
  946.                     if ucmd:GetMouseX() < 0 then
  947.                         ucmd:SetForwardMove(-1000000)
  948.                     end
  949.                     if ucmd:GetMouseX() > 0 then
  950.                         ucmd:SetForwardMove(1000000)
  951.                     end
  952.                 elseif SmegHack.Options["Bhop_WOnly"] then
  953.                     if ucmd:GetMouseX() < 0 then
  954.                         ucmd:SetForwardMove(1000000)
  955.                         if !WLeft then
  956.                             if WRight then
  957.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  958.                             elseif WForward then
  959.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  960.                             elseif WBack then
  961.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  962.                             end
  963.                             WLeft = true
  964.                             WRight, WForward, WBack = false, false, false
  965.                         end
  966.                     elseif ucmd:GetMouseX() > 0 then
  967.                         ucmd:SetForwardMove(1000000)
  968.                         if !WRight then
  969.                             if WLeft then
  970.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  971.                             elseif WForward then
  972.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  973.                             elseif WBack then
  974.                                 ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  975.                             end
  976.                             WRight = true
  977.                             WLeft, WForward, WBack = false, false, false
  978.                         end
  979.                     end
  980.                 else
  981.                     if ucmd:GetMouseX() < 0 then
  982.                         ucmd:SetSideMove(-1000000)
  983.                     end
  984.                     if ucmd:GetMouseX() > 0 then
  985.                         ucmd:SetSideMove(1000000)
  986.                     end
  987.                 end
  988.             end
  989.             if SmegHack.Options["Bhop_EdgeJump"] then
  990.                 if LocalPlayer():IsOnGround() then
  991.                     local WalkAngle
  992.                     if LocalPlayer():GetVelocity():Length() != 0 then
  993.                         WalkAngle = Angle( 0, LocalPlayer():GetVelocity():Angle().y, 0 )
  994.                     else
  995.                         WalkAngle = Angle( 0, LocalPlayer():EyeAngles().y, 0 )
  996.                     end
  997.                     local FinPos = LocalPlayer():EyePos() + (WalkAngle:Forward()*(SmegHack.Options["Bhop_EdgeJump_Distance"]-50))
  998.                     FinPos.z = LocalPlayer():GetPos().z-5
  999.                     local GroundDetect = {
  1000.                             start = LocalPlayer():GetShootPos(),
  1001.                             endpos = FinPos,
  1002.                             filter = LocalPlayer(),
  1003.                             mask = MASK_PLAYERSOLID
  1004.                         }
  1005.                     if util.TraceLine(GroundDetect).Fraction == 1 then
  1006.                         ucmd:SetButtons( ucmd:GetButtons() + IN_JUMP )
  1007.                     end
  1008.                 end
  1009.                 //LocalPlayer():SetEyeAngles(Angle( 0,LocalPlayer():GetVelocity():Angle().y,LocalPlayer():GetVelocity():Angle().z )) <-Just for safe keeping
  1010.             end
  1011.             if SmegHack.Options["Bhop_Sideways"] then
  1012.                 if ucmd:KeyDown(IN_MOVELEFT) && !TapS then
  1013.                     if ucmd:KeyDown(IN_MOVERIGHT) then ForwardMove = 0 elseif ForwardMove == 0 then ForwardMove = -1000000 end
  1014.                     ucmd:SetSideMove(SideMove)
  1015.                     ucmd:SetForwardMove(ForwardMove)
  1016.                 end
  1017.                 if ucmd:KeyDown(IN_MOVERIGHT) && !TapS then
  1018.                     if ucmd:KeyDown(IN_MOVELEFT) then ForwardMove = 0 elseif ForwardMove == 0 then ForwardMove = 1000000 end
  1019.                     ucmd:SetSideMove(SideMove)
  1020.                     ucmd:SetForwardMove(ForwardMove)
  1021.                 end
  1022.                 if !ucmd:KeyDown(IN_MOVELEFT) && !ucmd:KeyDown(IN_MOVERIGHT) && !TapS then ForwardMove = 0 end
  1023.  
  1024.                 if ucmd:KeyDown(IN_FORWARD) && !TapS then
  1025.                     if ucmd:KeyDown(IN_BACK) then SideMove = 0 elseif SideMove == 0 then SideMove = -1000000 end
  1026.                     ucmd:SetSideMove(SideMove)
  1027.                     ucmd:SetForwardMove(ForwardMove)
  1028.                 end
  1029.                 if ucmd:KeyDown(IN_BACK) && LocalPlayer():IsOnGround() && !TapS then
  1030.                     if ucmd:KeyDown(IN_FORWARD) then SideMove = 0 elseif SideMove == 0 then SideMove = 1000000 end
  1031.                     ucmd:SetSideMove(SideMove)
  1032.                     ucmd:SetForwardMove(ForwardMove)
  1033.                 elseif ucmd:KeyDown(IN_BACK) && !LocalPlayer():IsOnGround() && !TapS then
  1034.                     ForwardMove = 1000000
  1035.                     ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1036.                     ucmd:SetForwardMove(ForwardMove)
  1037.                     TapS = true
  1038.                 end
  1039.                 if !ucmd:KeyDown(IN_FORWARD) && !ucmd:KeyDown(IN_BACK) && !TapS then SideMove = 0 end
  1040.                 if !LocalPlayer():IsOnGround() && ucmd:KeyDown(IN_BACK) && TapS then
  1041.                     ucmd:SetForwardMove(1000000)
  1042.                 elseif ( !ucmd:KeyDown(IN_BACK) || LocalPlayer():IsOnGround() ) && TapS then
  1043.                     ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1044.                     TapS = false
  1045.                 end
  1046.             elseif SmegHack.Options["Bhop_WOnly"] then
  1047.                 if ucmd:KeyDown(IN_MOVELEFT) && !WLeft then
  1048.                     if WRight then
  1049.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1050.                     elseif WForward then
  1051.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1052.                     elseif WBack then
  1053.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1054.                     end
  1055.                     WLeft = true
  1056.                     WRight, WForward, WBack = false, false, false
  1057.                 elseif ucmd:KeyDown(IN_MOVERIGHT) && !WRight then
  1058.                     if WLeft then
  1059.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1060.                     elseif WForward then
  1061.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1062.                     elseif WBack then
  1063.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1064.                     end
  1065.                     WRight = true
  1066.                     WLeft, WForward, WBack = false, false, false
  1067.                 elseif ucmd:KeyDown(IN_FORWARD) && !WForward then
  1068.                     if WRight then
  1069.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1070.                     elseif WLeft then
  1071.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1072.                     elseif WBack then
  1073.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1074.                     end
  1075.                     WForward = true
  1076.                     WLeft, WRight, WBack = false, false, false
  1077.                 elseif ucmd:KeyDown(IN_BACK) && !WBack then
  1078.                     if WRight then
  1079.                         ucmd:SetViewAngles(ucmd:GetViewAngles()-Angle(0,90,0))
  1080.                     elseif WForward then
  1081.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,180,0))
  1082.                     elseif WLeft then
  1083.                         ucmd:SetViewAngles(ucmd:GetViewAngles()+Angle(0,90,0))
  1084.                     end
  1085.                     WBack = true
  1086.                     WLeft, WRight, WForward = false, false, false
  1087.                 end
  1088.                 if !ucmd:KeyDown(IN_MOVELEFT) && !ucmd:KeyDown(IN_MOVERIGHT) && !ucmd:KeyDown(IN_FORWARD) && !ucmd:KeyDown(IN_BACK) then WActive = false else WActive = true end
  1089.                 if WActive then
  1090.                     ucmd:SetForwardMove(1000000)
  1091.                     ucmd:SetSideMove(0)
  1092.                 end
  1093.             end
  1094.         end
  1095.     end)
  1096.  
  1097.     AddHook( "Cams", "CalcView", RandomString(), function( ply, Pos, Ang, FOV )
  1098.         if SmegHack.Options["Cams_Toggle"] && GetConVarNumber("SmegHack_Panic") == 0 then
  1099.             local CamData = {}
  1100.             if SmegHack.Options["Cams_CSNoclip"] then
  1101.                 local Speed = SmegHack.Options["Cams_CSNoclip_Speed"]/5
  1102.                 local MouseAngs = Angle( NoclipY, NoclipX, 0 )
  1103.                 if LocalPlayer():KeyDown(IN_SPEED) then
  1104.                     Speed = Speed * 5
  1105.                 end
  1106.                 if LocalPlayer():KeyDown(IN_FORWARD) then
  1107.                     NoclipPos = NoclipPos+(MouseAngs:Forward()*Speed)
  1108.                 end
  1109.                 if LocalPlayer():KeyDown(IN_BACK) then
  1110.                     NoclipPos = NoclipPos-(MouseAngs:Forward()*Speed)
  1111.                 end
  1112.                 if LocalPlayer():KeyDown(IN_MOVELEFT) then
  1113.                     NoclipPos = NoclipPos-(MouseAngs:Right()*Speed)
  1114.                 end
  1115.                 if LocalPlayer():KeyDown(IN_MOVERIGHT) then
  1116.                     NoclipPos = NoclipPos+(MouseAngs:Right()*Speed)
  1117.                 end
  1118.                 if NoclipJump then
  1119.                     NoclipPos = NoclipPos+Vector(0,0,Speed)
  1120.                 end
  1121.                 if NoclipDuck then
  1122.                     NoclipPos = NoclipPos-Vector(0,0,Speed)
  1123.                 end
  1124.                 CamData.origin = NoclipPos
  1125.                 CamData.angles = MouseAngs
  1126.                 CamData.fov = FOV
  1127.                 CamData.drawviewer = true
  1128.             elseif SmegHack.Options["Cams_ThirdPerson"] then
  1129.                 CamData.origin = Pos-(Ang:Forward()*(SmegHack.Options["Cams_ThirdPerson_Zoom"]*10))
  1130.                 CamData.angles = Ang
  1131.                 CamData.fov = FOV
  1132.                 CamData.drawviewer = true
  1133.             end
  1134.             return CamData
  1135.         end
  1136.     end)
  1137.     AddHook( "Bhop", "CreateMove", RandomString(), function(ucmd)
  1138.         if SmegHack.Options["Cams_Toggle"] && SmegHack.Options["Cams_CSNoclip"] && GetConVarNumber("SmegHack_Panic") == 0 then
  1139.             if NoclipOn == false then
  1140.                 NoclipPos, NoclipAngles = LocalPlayer():EyePos(), ucmd:GetViewAngles()
  1141.                 NoclipY, NoclipX = ucmd:GetViewAngles().x, ucmd:GetViewAngles().y
  1142.                 NoclipOn = true
  1143.             end
  1144.             ucmd:ClearMovement()
  1145.             if ucmd:KeyDown(IN_JUMP) then
  1146.                 ucmd:RemoveKey(IN_JUMP)
  1147.                 NoclipJump = true
  1148.             elseif NoclipJump then
  1149.                 NoclipJump = false
  1150.             end
  1151.             if ucmd:KeyDown(IN_DUCK) then
  1152.                 ucmd:RemoveKey(IN_DUCK)
  1153.                 NoclipDuck = true
  1154.             elseif NoclipDuck then
  1155.                 NoclipDuck = false
  1156.             end
  1157.             NoclipX = NoclipX-(ucmd:GetMouseX()/50)
  1158.             if NoclipY+(ucmd:GetMouseY()/50) > 89 then NoclipY = 89 elseif NoclipY+(ucmd:GetMouseY()/50) < -89 then NoclipY = -89 else NoclipY = NoclipY+(ucmd:GetMouseY()/50) end
  1159.             ucmd:SetViewAngles(NoclipAngles)
  1160.         elseif NoclipOn == true then
  1161.             NoclipOn = false
  1162.         end
  1163.     end)
  1164.     if Display then
  1165.         AddHook( "Loaded", "HUDPaint", RandomString(), function()
  1166.             draw.SimpleTextOutlined( "Smeg Hack Loaded Successfully!", "Menu_Title", ScrW()/2, 50, Color(0,150,150), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0) )
  1167.             timer.Simple( 3, function()
  1168.                 RemoveHook("Loaded")
  1169.             end)
  1170.         end)
  1171.     end
  1172. end
  1173.  
  1174. //Bones
  1175. SmegHack.Bones = {
  1176. "ValveBiped.Bip01_Head1",
  1177. "ValveBiped.Bip01_Neck1",
  1178. "ValveBiped.Bip01_Spine4",
  1179. "ValveBiped.Bip01_Spine2",
  1180. "ValveBiped.Bip01_Spine1",
  1181. "ValveBiped.Bip01_Spine",
  1182. "ValveBiped.Bip01_Pelvis",
  1183. "ValveBiped.Bip01_R_UpperArm",
  1184. "ValveBiped.Bip01_R_Forearm",
  1185. "ValveBiped.Bip01_R_Hand",
  1186. "ValveBiped.Bip01_L_UpperArm",
  1187. "ValveBiped.Bip01_L_Forearm",
  1188. "ValveBiped.Bip01_L_Hand",
  1189. "ValveBiped.Bip01_R_Thigh",
  1190. "ValveBiped.Bip01_R_Calf",
  1191. "ValveBiped.Bip01_R_Foot",
  1192. "ValveBiped.Bip01_R_Toe0",
  1193. "ValveBiped.Bip01_L_Thigh",
  1194. "ValveBiped.Bip01_L_Calf",
  1195. "ValveBiped.Bip01_L_Foot",
  1196. "ValveBiped.Bip01_L_Toe0"
  1197. }
  1198.  
  1199. //Key Binds
  1200. SmegHack.KeyBinds = {
  1201. [0] = "NONE",
  1202. [1] = "0",
  1203. [2] = "1",
  1204. [3] = "2",
  1205. [4] = "3",
  1206. [5] = "4",
  1207. [6] = "5",
  1208. [7] = "6",
  1209. [8] = "7",
  1210. [9] = "8",
  1211. [10] = "9",
  1212. [11] = "A",
  1213. [12] = "B",
  1214. [13] = "C",
  1215. [14] = "D",
  1216. [15] = "E",
  1217. [16] = "F",
  1218. [17] = "G",
  1219. [18] = "H",
  1220. [19] = "I",
  1221. [20] = "J",
  1222. [21] = "K",
  1223. [22] = "L",
  1224. [23] = "M",
  1225. [24] = "N",
  1226. [25] = "O",
  1227. [26] = "P",
  1228. [27] = "Q",
  1229. [28] = "R",
  1230. [29] = "S",
  1231. [30] = "T",
  1232. [31] = "U",
  1233. [32] = "V",
  1234. [33] = "W",
  1235. [34] = "X",
  1236. [35] = "Y",
  1237. [36] = "Z",
  1238. [37] = "PAD_0",
  1239. [38] = "PAD_1",
  1240. [39] = "PAD_2",
  1241. [40] = "PAD_3",
  1242. [41] = "PAD_4",
  1243. [42] = "PAD_5",
  1244. [43] = "PAD_6",
  1245. [44] = "PAD_7",
  1246. [45] = "PAD_8",
  1247. [46] = "PAD_9",
  1248. [47] = "PAD_DIVIDE",
  1249. [48] = "PAD_MULTIPLY",
  1250. [49] = "PAD_MINUS",
  1251. [50] = "PAD_PLUS",
  1252. [51] = "PAD_ENTER",
  1253. [52] = "PAD_DECIMAL",
  1254. [53] = "LBRACKET",
  1255. [54] = "RBRACKET",
  1256. [55] = "SEMICOLON",
  1257. [56] = "APOSTROPHE",
  1258. [57] = "BACKQUOTE",
  1259. [58] = "COMMA",
  1260. [59] = "PERIOD",
  1261. [60] = "SLASH",
  1262. [61] = "BACKSLASH",
  1263. [62] = "MINUS",
  1264. [63] = "EQUAL",
  1265. [64] = "ENTER",
  1266. [65] = "SPACE",
  1267. [66] = "BACKSPACE",
  1268. [67] = "TAB",
  1269. [68] = "CAPSLOCK",
  1270. [69] = "NUMLOCK",
  1271. [70] = "ESCAPE",
  1272. [71] = "SCROLLLOCK",
  1273. [72] = "INSERT",
  1274. [73] = "DELETE",
  1275. [74] = "HOME",
  1276. [75] = "END",
  1277. [76] = "PAGEUP",
  1278. [77] = "PAGEDOWN",
  1279. [78] = "BREAK",
  1280. [79] = "LSHIFT",
  1281. [80] = "RSHIFT",
  1282. [81] = "LALT",
  1283. [82] = "RALT",
  1284. [83] = "LCONTROL",
  1285. [84] = "RCONTROL",
  1286. [85] = "LWIN",
  1287. [86] = "RWIN",
  1288. [87] = "APP",
  1289. [88] = "UP",
  1290. [89] = "LEFT",
  1291. [90] = "DOWN",
  1292. [91] = "RIGHT",
  1293. [92] = "F1",
  1294. [93] = "F2",
  1295. [94] = "F3",
  1296. [95] = "F4",
  1297. [96] = "F5",
  1298. [97] = "F6",
  1299. [98] = "F7",
  1300. [99] = "F8",
  1301. [100] = "F9",
  1302. [101] = "F10",
  1303. [102] = "F11",
  1304. [103] = "F12",
  1305. //[104] = "CAPSLOCKTOGGLE",   These three screw up the binding process, probably wont bother working out how to fix it
  1306. //[105] = "NUMLOCKTOGGLE",
  1307. //[106] = "SCROLLLOCKTOGGLE",
  1308.  
  1309. //Xbox Controller Binds - These are untested as I don't own an xbox controller, so they might not work
  1310. [114] = "XBUTTON_A",
  1311. [115] = "XBUTTON_B",
  1312. [116] = "XBUTTON_X",
  1313. [117] = "XBUTTON_Y",
  1314. [118] = "XBUTTON_LEFT_SHOULDER",
  1315. [119] = "XBUTTON_RIGHT_SHOULDER",
  1316. [120] = "XBUTTON_BACK",
  1317. [121] = "XBUTTON_START",
  1318. [122] = "XBUTTON_STICK1",
  1319. [123] = "XBUTTON_STICK2",
  1320. [146] = "XBUTTON_UP",
  1321. [147] = "XBUTTON_RIGHT",
  1322. [148] = "XBUTTON_DOWN",
  1323. [149] = "XBUTTON_LEFT",
  1324. [150] = "XSTICK1_RIGHT",
  1325. [151] = "XSTICK1_LEFT",
  1326. [152] = "XSTICK1_DOWN",
  1327. [153] = "XSTICK1_UP",
  1328. [154] = "XBUTTON_LTRIGGER",
  1329. [155] = "XBUTTON_RTRIGGER",
  1330. [156] = "XSTICK2_RIGHT",
  1331. [157] = "XSTICK2_LEFT",
  1332. [158] = "XSTICK2_DOWN",
  1333. [159] = "XSTICK2_UP"
  1334. }
  1335.  
  1336. //Mouse Binds (Needs to be separate otherwise it doesn't work)
  1337. SmegHack.MouseBinds = {
  1338. [107] = "MOUSE_LEFT",
  1339. [108] = "MOUSE_RIGHT",
  1340. [109] = "MOUSE_MIDDLE",
  1341. [110] = "MOUSE_4",
  1342. [111] = "MOUSE_5",
  1343. [112] = "MOUSE_WHEEL_UP",
  1344. [113] = "MOUSE_WHEEL_DOWN"
  1345. }
  1346.  
  1347. //Aimbot
  1348. function Aimbot( FinAngle )
  1349.     if SmegHack.Options["Aimbot_SmoothAim"] then
  1350.         SmoothAngles( FinAngle, SmegHack.Options["Aimbot_SmoothAim_Value"] )
  1351.     else
  1352.         LocalPlayer():SetEyeAngles(FinAngle)
  1353.     end
  1354. end
  1355.  
  1356. function SmoothAngles( FinAngle, SmoothValue )
  1357.     local SmoothValue = 10-(10*(SmoothValue/1000))
  1358.     local CloseToAngle = false
  1359.     local SmoothDirectionX = 1
  1360.     local SmoothDirectionY = 1
  1361.     local CurAngle = LocalPlayer():EyeAngles()
  1362.     if FinAngle.x > 89 then FinAngle.x = FinAngle.x - 360 end
  1363.     if CurAngle == FinAngle then
  1364.         SmoothDirectionX = 1
  1365.     elseif CurAngle.y < 0 && FinAngle.y < 0 then
  1366.         CloseToAngle = true
  1367.         if CurAngle.y > FinAngle.y then
  1368.             SmoothDirectionX = 2
  1369.         elseif CurAngle.y < FinAngle.y then
  1370.             SmoothDirectionX = 3
  1371.         end
  1372.     elseif CurAngle.y >= 0 && FinAngle.y >= 0 then
  1373.         CloseToAngle = true
  1374.         if CurAngle.y > FinAngle.y then
  1375.             SmoothDirectionX = 2
  1376.         elseif CurAngle.y < FinAngle.y then
  1377.             SmoothDirectionX = 3
  1378.         end
  1379.     elseif CurAngle.y >= 0 && FinAngle.y < 0 then
  1380.         local FlipAngle = CurAngle-(Angle(0,180,0))
  1381.         if FlipAngle.y > FinAngle.y then
  1382.             SmoothDirectionX = 3
  1383.         elseif FlipAngle.y < FinAngle.y then
  1384.             SmoothDirectionX = 2
  1385.         end
  1386.     elseif CurAngle.y < 0 && FinAngle.y >= 0 then
  1387.         local FlipAngle = CurAngle+(Angle(0,180,0))
  1388.         if FlipAngle.y < FinAngle.y then
  1389.             SmoothDirectionX = 2   
  1390.         elseif FlipAngle.y > FinAngle.y then
  1391.             SmoothDirectionX = 3
  1392.         end
  1393.     end
  1394.     if FinAngle.x < CurAngle.x then
  1395.         SmoothDirectionY = 2
  1396.     elseif FinAngle.x > CurAngle.x then
  1397.         SmoothDirectionY = 3
  1398.     end
  1399.     local X, Y = false, false
  1400.     if SmoothDirectionX == 2 then
  1401.         if CurAngle.y-SmoothValue < FinAngle.y && CloseToAngle then
  1402.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,FinAngle.y,CurAngle.z))
  1403.             Y = true
  1404.         else
  1405.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,CurAngle.y-SmoothValue,CurAngle.z))
  1406.         end
  1407.     elseif SmoothDirectionX == 3 then
  1408.         if CurAngle.y+SmoothValue > FinAngle.y && CloseToAngle then
  1409.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,FinAngle.y,CurAngle.z))
  1410.             Y = true
  1411.         else
  1412.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x,CurAngle.y+SmoothValue,CurAngle.z))
  1413.         end
  1414.     end
  1415.     if SmoothDirectionY == 2 then
  1416.         //up
  1417.         if CurAngle.x-SmoothValue < FinAngle.x then
  1418.             LocalPlayer():SetEyeAngles(Angle(FinAngle.x,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1419.             X = true
  1420.         else
  1421.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x-SmoothValue,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1422.         end
  1423.     elseif SmoothDirectionY == 3 then
  1424.         //down
  1425.         if CurAngle.x+SmoothValue > FinAngle.x then
  1426.             LocalPlayer():SetEyeAngles(Angle(FinAngle.x,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1427.             X = true
  1428.         else
  1429.             LocalPlayer():SetEyeAngles(Angle(CurAngle.x+SmoothValue,LocalPlayer():EyeAngles().y,LocalPlayer():EyeAngles().z))
  1430.         end
  1431.     end
  1432.     if SmegHack.Options["Aimbot_AutoShoot"] && X && Y then
  1433.         LocalPlayer():ConCommand("+attack")
  1434.         timer.Simple( 0.1, function() LocalPlayer():ConCommand("-attack") end )
  1435.     end
  1436. end
  1437.  
  1438. //ESP Functions
  1439. function ESPGetPos( Ent )
  1440.     if Ent:IsValid() then
  1441.         local Points = {
  1442.             Vector( Ent:OBBMaxs().x, Ent:OBBMaxs().y, Ent:OBBMaxs().z ),
  1443.             Vector( Ent:OBBMaxs().x, Ent:OBBMaxs().y, Ent:OBBMins().z ),
  1444.             Vector( Ent:OBBMaxs().x, Ent:OBBMins().y, Ent:OBBMins().z ),
  1445.             Vector( Ent:OBBMaxs().x, Ent:OBBMins().y, Ent:OBBMaxs().z ),
  1446.             Vector( Ent:OBBMins().x, Ent:OBBMins().y, Ent:OBBMins().z ),
  1447.             Vector( Ent:OBBMins().x, Ent:OBBMins().y, Ent:OBBMaxs().z ),
  1448.             Vector( Ent:OBBMins().x, Ent:OBBMaxs().y, Ent:OBBMins().z ),
  1449.             Vector( Ent:OBBMins().x, Ent:OBBMaxs().y, Ent:OBBMaxs().z )
  1450.         }
  1451.         local MaxX, MaxY, MinX, MinY
  1452.         local V1, V2, V3, V4, V5, V6, V7, V8
  1453.         for k, v in pairs( Points ) do
  1454.             local ScreenPos = Ent:LocalToWorld( v ):ToScreen()
  1455.             if MaxX != nil then
  1456.                 MaxX, MaxY, MinX, MinY = math.max( MaxX, ScreenPos.x ), math.max( MaxY, ScreenPos.y), math.min( MinX, ScreenPos.x ), math.min( MinY, ScreenPos.y)
  1457.             else
  1458.                 MaxX, MaxY, MinX, MinY = ScreenPos.x, ScreenPos.y, ScreenPos.x, ScreenPos.y
  1459.             end
  1460.  
  1461.             if V1 == nil then
  1462.                 V1 = ScreenPos
  1463.             elseif V2 == nil then
  1464.                 V2 = ScreenPos
  1465.             elseif V3 == nil then
  1466.                 V3 = ScreenPos
  1467.             elseif V4 == nil then
  1468.                 V4 = ScreenPos
  1469.             elseif V5 == nil then
  1470.                 V5 = ScreenPos
  1471.             elseif V6 == nil then
  1472.                 V6 = ScreenPos
  1473.             elseif V7 == nil then
  1474.                 V7 = ScreenPos
  1475.             elseif V8 == nil then
  1476.                 V8 = ScreenPos
  1477.             end
  1478.         end
  1479.         return MaxX, MaxY, MinX, MinY, V1, V2, V3, V4, V5, V6, V7, V8
  1480.     end
  1481. end
  1482.  
  1483. //Menu Items
  1484. function AddMenuTab( Parent, Text, Tab, PosX, PosY, TabID )
  1485.     local AddMenuTab = vgui.Create( "DButton", Parent )
  1486.     AddMenuTab:SetText( Text )
  1487.     AddMenuTab:SetTextColor( Color(255,255,255) )
  1488.     AddMenuTab:SetPos( PosX, PosY )
  1489.     function AddMenuTab:Paint() end
  1490.     AddMenuTab.DoClick = function()
  1491.         ChangeTab( Tab, TabID )
  1492.     end
  1493.     if TabID == 12 then
  1494.         AddMenuTab:SetSize( 48, 30 )
  1495.     else
  1496.         AddMenuTab:SetSize( 49, 30 )
  1497.     end
  1498. end
  1499.  
  1500. function AddLabel( Parent, Text, PosX, PosY, CloseOn )
  1501.     local AddLabel = vgui.Create("DLabel", Parent)
  1502.     AddLabel:SetText( Text )
  1503.     AddLabel:SetPos( PosX, PosY )
  1504.     AddLabel:SetColor(Color(255,255,255,255))
  1505.     AddLabel:SizeToContents()
  1506.     if CloseOn != nil then
  1507.         AddLabel.Think = function()
  1508.             if CloseOn == "Admins" then
  1509.                 if AdminsListBool then
  1510.                     AddLabel:Remove()
  1511.                 end
  1512.             elseif CloseOn == "Spectators" then
  1513.                 if SpecsListBool then
  1514.                     AddLabel:Remove()
  1515.                 end
  1516.             end
  1517.         end
  1518.     end
  1519.     return AddLabel:GetSize()
  1520. end
  1521.  
  1522. function AddMainMenuButton( Parent, Text, PosX, PosY, DoClick )
  1523.     local AddMainMenuButton = vgui.Create( "DButton", Parent )
  1524.     AddMainMenuButton:SetText( Text )
  1525.     AddMainMenuButton:SetTextColor( Color(255,255,255) )
  1526.     AddMainMenuButton:SetSize( 100, 30 )
  1527.     AddMainMenuButton:SetPos( PosX, PosY )
  1528.     function AddMainMenuButton:Paint( w, h )
  1529.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  1530.        
  1531.         surface.SetDrawColor( Color(0,0,0,255) )
  1532.         surface.DrawOutlinedRect( 0, 0, w, h )
  1533.     end
  1534.     AddMainMenuButton.DoClick = DoClick
  1535. end
  1536.  
  1537. function AddGenericButton( Parent, Text, SizeX, SizeY, PosX, PosY, DoClick )
  1538.     local AddGenericButton = vgui.Create( "DButton", Parent )
  1539.     AddGenericButton:SetText( Text )
  1540.     AddGenericButton:SetTextColor( Color(255,255,255) )
  1541.     AddGenericButton:SetSize( SizeX, SizeY )
  1542.     AddGenericButton:SetPos( PosX, PosY )
  1543.     function AddGenericButton:Paint( w, h )
  1544.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  1545.        
  1546.         surface.SetDrawColor( Color(0,0,0,255) )
  1547.         surface.DrawOutlinedRect( 0, 0, w, h )
  1548.     end
  1549.     AddGenericButton.DoClick = DoClick
  1550. end
  1551.  
  1552. function AddKeyBind( Parent, PosX, PosY, Var )
  1553.     local KeyBind = vgui.Create( "DButton", Parent )
  1554.     if SmegHack.Options["Aimbot_AimOnKey_Key"] >= 107 && SmegHack.Options["Aimbot_AimOnKey_Key"] <= 113 then
  1555.         KeyBind:SetText( SmegHack.MouseBinds[SmegHack.Options["Aimbot_AimOnKey_Key"]])
  1556.     else
  1557.         KeyBind:SetText( SmegHack.KeyBinds[SmegHack.Options["Aimbot_AimOnKey_Key"]])
  1558.     end
  1559.     KeyBind:SetTextColor( Color(255,255,255,255) )
  1560.     KeyBind:SetSize( 100, 15 )
  1561.     KeyBind:SetPos( PosX, PosY )
  1562.     KeyBind:SetTooltip( "Click button then press any key to change bind" )
  1563.     KeyBind.Paint = function()
  1564.         draw.RoundedBox( 0, 1, 1, 99, 14, Color(150,150,150,255) )
  1565.         surface.SetDrawColor( Color(0,0,0) )
  1566.         surface.DrawOutlinedRect( 0, 0, 100, 15 )
  1567.     end
  1568.     KeyBind.DoClick = function()
  1569.         KeyBind:SetText("...")
  1570.         local NoClickMenu = vgui.Create( "DFrame" )
  1571.         NoClickMenu:SetTitle("")
  1572.         NoClickMenu:ShowCloseButton(false)
  1573.         NoClickMenu:SetDraggable(false)
  1574.         NoClickMenu:SetSize(ScrW(), ScrH())
  1575.         NoClickMenu:Center()
  1576.         NoClickMenu:MakePopup()
  1577.         function NoClickMenu:Paint( w, h )
  1578.             draw.RoundedBox( 0, 0, 0, w, h, Color(0,0,0,150) )
  1579.             draw.SimpleTextOutlined( "Press Any Key", "Menu_Title", w/2, h/2, Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0))
  1580.             draw.SimpleTextOutlined( "Press ESC to cancel", "Menu_Title", w/2, h/2+30, Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0))
  1581.             draw.SimpleTextOutlined( "Hold ESC to clear bind", "Menu_Title", w/2, h/2+60, Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,1,Color(0,0,0))
  1582.         end
  1583.         local ESCStuff, ESCNum = false, 0
  1584.         KeyBind.Think = function()
  1585.             if !ESCStuff then
  1586.                 for i = 107, 113 do
  1587.                     if input.IsMouseDown(i) then
  1588.                         SmegHack.Options[Var] = i
  1589.                         KeyBind:SetText(SmegHack.MouseBinds[i])
  1590.                         NoClickMenu:Close()
  1591.                         KeyBind.Think = nil
  1592.                     end
  1593.                 end
  1594.                 for i = 0, 159 do
  1595.                     if input.IsKeyDown(i) then
  1596.                         if i == 70 then
  1597.                             LocalPlayer():ConCommand("cancelselect")
  1598.                             ESCStuff = true
  1599.                         else
  1600.                             SmegHack.Options[Var] = i
  1601.                             KeyBind:SetText(SmegHack.KeyBinds[i])
  1602.                             NoClickMenu:Close()
  1603.                             KeyBind.Think = nil
  1604.                         end
  1605.                     end
  1606.                 end
  1607.             else
  1608.                 if input.IsKeyDown(70) then
  1609.                     if ESCNum >= 200 then
  1610.                         SmegHack.Options[Var] = 0
  1611.                         KeyBind:SetText(SmegHack.KeyBinds[0])
  1612.                         NoClickMenu:Close()
  1613.                         KeyBind.Think = nil
  1614.                     else ESCNum = ESCNum + 1 end
  1615.                 else
  1616.                     KeyBind:SetText(SmegHack.KeyBinds[SmegHack.Options[Var]])
  1617.                     NoClickMenu:Close()
  1618.                     KeyBind.Think = nil
  1619.                 end
  1620.             end
  1621.         end
  1622.     end
  1623. end
  1624.  
  1625. function AddCheckBox( Parent, Text, PosX, PosY, ToolTip, Var, ExtraFunc )
  1626.     local AddCheckBox = vgui.Create( "DCheckBoxLabel", Parent )
  1627.     AddCheckBox:SetText( Text )
  1628.     AddCheckBox:SetPos( PosX, PosY )
  1629.     AddCheckBox:SetTooltip( ToolTip )
  1630.     AddCheckBox:SetTextColor( Color(255,255,255,255) )
  1631.     AddCheckBox:SizeToContents()
  1632.     AddCheckBox:SetChecked( SmegHack.Options[Var] )
  1633.     AddCheckBox.OnChange = function()
  1634.         SmegHack.Options[Var] = AddCheckBox:GetChecked()
  1635.         if ExtraFunc != nil then
  1636.             local IsChecked = AddCheckBox:GetChecked()
  1637.             ExtraFunc()
  1638.         end
  1639.     end
  1640. end
  1641.  
  1642. function AddBoneButton( Parent, PosX, PosY, Bone )
  1643.     local AddBoneButton = vgui.Create( "DButton", Parent )
  1644.     if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1645.         for k, v in pairs(SmegHack.BoneOrder) do
  1646.             if v == Bone then
  1647.                 AddBoneButton:SetText(tostring(k))
  1648.             end
  1649.         end
  1650.     else
  1651.         AddBoneButton:SetText("-")
  1652.     end
  1653.     AddBoneButton:SetTextColor( Color(255,255,255,255) )
  1654.     AddBoneButton:SetSize( 16, 16 )
  1655.     AddBoneButton:SetPos( PosX-8, PosY-8 )
  1656.     AddBoneButton:SetTooltip( "Select bones in the order you want to aim at them" )
  1657.     function AddBoneButton:Paint( w, h )
  1658.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  1659.        
  1660.         surface.SetDrawColor( Color(0,0,0,255) )
  1661.         surface.DrawOutlinedRect( 0, 0, w, h )
  1662.     end
  1663.     AddBoneButton.DoRightClick = function()
  1664.         local BoneNum
  1665.         if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1666.             for k, v in pairs( SmegHack.BoneOrder ) do
  1667.                 if v == Bone then BoneNum = k end
  1668.             end
  1669.         else BoneNum = 0 end
  1670.  
  1671.         if BoneNum == 0 then
  1672.             table.insert( SmegHack.BoneOrder, Bone )
  1673.         elseif BoneNum == 1 then
  1674.             table.remove( SmegHack.BoneOrder, BoneNum )
  1675.         else
  1676.             table.remove( SmegHack.BoneOrder, BoneNum )
  1677.             table.insert( SmegHack.BoneOrder, BoneNum-1, Bone )
  1678.         end
  1679.         UpdateBoneThink = true
  1680.     end
  1681.     AddBoneButton.DoClick = function()
  1682.         local BoneNum
  1683.         if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1684.             for k, v in pairs( SmegHack.BoneOrder ) do
  1685.                 if v == Bone then BoneNum = k end
  1686.             end
  1687.         else BoneNum = 0 end
  1688.  
  1689.         if BoneNum == 0 then
  1690.             table.insert( SmegHack.BoneOrder, 1, Bone )
  1691.         elseif BoneNum == 21 then
  1692.             table.remove( SmegHack.BoneOrder, BoneNum )
  1693.         else
  1694.             if BoneNum != table.Count( SmegHack.BoneOrder ) then
  1695.                 table.remove( SmegHack.BoneOrder, BoneNum )
  1696.                 table.insert( SmegHack.BoneOrder, BoneNum+1, Bone )
  1697.             else
  1698.                 table.remove( SmegHack.BoneOrder, BoneNum )
  1699.             end
  1700.         end
  1701.         UpdateBoneThink = true
  1702.     end
  1703.     AddBoneButton.Think = function()
  1704.         if UpdateBoneThink then
  1705.             if UpdateBoneThinkNum != 21 then
  1706.                 local BoneNum
  1707.                 if table.HasValue( SmegHack.BoneOrder, Bone ) then
  1708.                     for k, v in pairs( SmegHack.BoneOrder ) do
  1709.                         if v == Bone then BoneNum = k end
  1710.                     end
  1711.                 else BoneNum = 0 end
  1712.                 if BoneNum != 0 then
  1713.                     AddBoneButton:SetText(tostring(BoneNum))
  1714.                 else
  1715.                     AddBoneButton:SetText("-")
  1716.                 end
  1717.                 UpdateBoneThinkNum = UpdateBoneThinkNum+1
  1718.             end
  1719.             if UpdateBoneThinkNum == 21 then
  1720.                 UpdateBoneThinkNum = 0
  1721.                 UpdateBoneThink = false
  1722.             end
  1723.         end
  1724.     end
  1725. end
  1726.  
  1727. function AddComboBox( Parent, PosX, PosY, SizeX, SizeY, Var, ChoiceTable, ExtraFunc )
  1728.     local AddComboBox = vgui.Create( "DComboBox", Parent )
  1729.     AddComboBox:SetPos( PosX, PosY )
  1730.     AddComboBox:SetSize( SizeX, SizeY )
  1731.     AddComboBox:SetValue(SmegHack.Options[Var])
  1732.     for k, v in pairs( ChoiceTable ) do
  1733.         AddComboBox:AddChoice(v)
  1734.     end
  1735.     AddComboBox.OnSelect = function(Selected)
  1736.         SmegHack.Options[Var] = Selected:GetValue()
  1737.         if ExtraFunc != nil then
  1738.             ExtraFunc()
  1739.         end
  1740.     end
  1741. end
  1742.  
  1743. function AddSlider( Parent, Var, PosX, PosY, Min, Max, Decimals )
  1744.     local AddSlider = vgui.Create( "Slider", Parent )
  1745.     AddSlider:SetSize( 150, 15 )
  1746.     AddSlider:SetPos( PosX, PosY )
  1747.     AddSlider:SetMin( Min )
  1748.     AddSlider:SetMax( Max )
  1749.     AddSlider:SetDecimals( Decimals )
  1750.     AddSlider:SetValue( SmegHack.Options[Var] )
  1751.     AddSlider.OnValueChanged = function( Panel, Value )
  1752.         SmegHack.Options[Var] = math.Round( Value, Decimals )
  1753.     end
  1754.     AddSlider.Paint = function()
  1755.         draw.RoundedBox( 0, 0, 0, 135, 15, Color(255,255,255,255) )
  1756.         surface.SetDrawColor(Color(0,0,0,255))
  1757.         surface.DrawOutlinedRect( 0, 0, 135, 15 )
  1758.         surface.DrawLine( 105, 0, 105, 15 )
  1759.     end
  1760. end
  1761.  
  1762. function AddTextEntry( Parent, Width, PosX, PosY, DefaultText, Var, Save )
  1763.     local AddTextEntry = vgui.Create("DTextEntry", Parent)
  1764.     AddTextEntry:SetWide(Width)
  1765.     AddTextEntry:SetPos(PosX,PosY)
  1766.     if Save != nil && SmegHack.TextEntries[Var] != nil then
  1767.         AddTextEntry:SetText(SmegHack.TextEntries[Var])
  1768.     else
  1769.         AddTextEntry:SetText(DefaultText)
  1770.     end
  1771.     AddTextEntry.OnGetFocus = function()
  1772.         if AddTextEntry:GetText() == DefaultText then
  1773.             AddTextEntry:SetText("")
  1774.         end
  1775.     end
  1776.     AddTextEntry.OnLoseFocus = function()
  1777.         if AddTextEntry:GetText() == "" then
  1778.             AddTextEntry:SetText(DefaultText)
  1779.             SmegHack.TextEntries[Var] = nil
  1780.         else
  1781.             SmegHack.TextEntries[Var] = AddTextEntry:GetText()
  1782.         end
  1783.     end
  1784. end
  1785.  
  1786. function AddDisplayBox( Title, Mode )
  1787.     local DisplayBox = vgui.Create( "DFrame" )
  1788.     DisplayBox:SetTitle("")
  1789.     DisplayBox:ShowCloseButton(false)
  1790.     DisplayBox:SetDraggable(true)
  1791.     DisplayBox:SetSize( 150, 50 )
  1792.     function DisplayBox:Paint( w, h )
  1793.         draw.RoundedBox( 0, 0, 0, w, 24, Color(0,0,0,255) )
  1794.         draw.RoundedBox( 0, 0, 0, w, h, Color(0,10,20,245) )
  1795.         draw.SimpleText( Title, "Menu_Title", w/2, 13, Color(0,100,200), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  1796.     end
  1797.  
  1798.     if Mode == 1 then
  1799.         DisplayBox:SetPos( SmegHack.Options["Misc_AdminBox_PosX"], SmegHack.Options["Misc_AdminBox_PosY"] )
  1800.         local AdminTable = {"Moo"}
  1801.         local Wait = false
  1802.         AddHook( "AdminDisplayBox", "Think", RandomString(), function()
  1803.             if !SmegHack.Options["Misc_AdminBox"] then
  1804.                 DisplayBox:Close()
  1805.                 RemoveHook("AdminDisplayBox")
  1806.             end
  1807.             local PoX, PoY = DisplayBox:GetPos()
  1808.             if  SmegHack.Options["Misc_AdminBox_PosX"] != PoX ||  SmegHack.Options["Misc_AdminBox_PosY"] != PoY then
  1809.                 SmegHack.Options["Misc_AdminBox_PosX"], SmegHack.Options["Misc_AdminBox_PosY"] = PoX, PoY
  1810.             end
  1811.             local TempAdminTable = {}
  1812.             for k, v in pairs(player.GetAll()) do
  1813.                 if v:IsAdmin() || v:IsSuperAdmin() then
  1814.                     table.insert( TempAdminTable, v:Nick() )
  1815.                 end
  1816.             end
  1817.             if table.concat(TempAdminTable) != table.concat(AdminTable) then
  1818.                 if !AdminsListBool && !Wait then
  1819.                     AdminsListBool = true
  1820.                     timer.Simple( 0.1, function() AdminsListBool = false Wait = true end )
  1821.                 elseif Wait then
  1822.                     AdminTable = table.Copy(TempAdminTable)
  1823.                     local TextWidth, Tall = 140, 30
  1824.                     local OldWidth, OldTall = DisplayBox:GetSize()
  1825.                     if AdminTable[1] != nil then
  1826.                         for k, v in pairs(AdminTable) do
  1827.                             local TempTextWidth = AddLabel( DisplayBox, v, 5, Tall, "Admins" )
  1828.                             if TempTextWidth > TextWidth then TextWidth = TempTextWidth end
  1829.                             Tall = Tall + 15
  1830.                         end
  1831.                         DisplayBox:SetSize( TextWidth + 10, Tall+5 )
  1832.                     else
  1833.                         AddLabel( DisplayBox, "No Admins Online", 5, Tall, "Admins" )
  1834.                         DisplayBox:SetSize( 150, 50 )
  1835.                     end
  1836.                     local DifferenceX, DifferenceY = OldWidth - TextWidth+10, OldTall - Tall+5
  1837.                     local Var = "AdminBox" //This used to be a function but it screwed up, so I just added it to the hook and I couldn't be bothered making it look normal incase you are wondering what the point of this is
  1838.                     if DifferenceX < 0 then
  1839.                         DifferenceX = DifferenceX * -1
  1840.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] - DifferenceX
  1841.                     else
  1842.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] + DifferenceX
  1843.                     end
  1844.                     if DifferenceY < 0 then
  1845.                         DifferenceY = DifferenceY * -1
  1846.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] - DifferenceY
  1847.                     else
  1848.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] + DifferenceY
  1849.                     end
  1850.  
  1851.                     if SmegHack.Options["Misc_"..Var.."_Mode"] == "Auto" then
  1852.                         local PosX, PosY
  1853.                         if SmegHack.Options["Misc_"..Var.."_PosX"] > ScrW()/2 then PosX = RightPos else PosX = SmegHack.Options["Misc_"..Var.."_PosX"] end
  1854.                         if SmegHack.Options["Misc_"..Var.."_PosY"] > ScrH()/2 then PosY = BottomPos else PosY = SmegHack.Options["Misc_"..Var.."_PosY"] end
  1855.                         DisplayBox:SetPos( PosX, PosY )
  1856.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Top Right" then
  1857.                         DisplayBox:SetPos( RightPos, SmegHack.Options["Misc_"..Var.."_PosY"] )
  1858.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Left" then
  1859.                         DisplayBox:SetPos( SmegHack.Options["Misc_"..Var.."_PosX"], BottomPos )
  1860.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Right" then
  1861.                         DisplayBox:SetPos( RightPos, BottomPos )
  1862.                     end
  1863.                     Wait = false
  1864.                 end
  1865.             end
  1866.         end)
  1867.     elseif Mode == 2 then
  1868.         DisplayBox:SetPos( SmegHack.Options["Misc_SpectatorsBox_PosX"], SmegHack.Options["Misc_SpectatorsBox_PosY"] )
  1869.         local SpecsTable = {"Moo"}
  1870.         local Wait = false
  1871.         AddHook( "SpecDisplayBox", "Think", RandomString(), function()
  1872.             if !SmegHack.Options["Misc_SpectatorsBox"] then
  1873.                 DisplayBox:Close()
  1874.                 RemoveHook("SpecDisplayBox")
  1875.             end
  1876.             local PoX, PoY = DisplayBox:GetPos()
  1877.             if  SmegHack.Options["Misc_SpectatorsBox_PosX"] != PoX ||  SmegHack.Options["Misc_SpectatorsBox_PosY"] != PoY then
  1878.                 SmegHack.Options["Misc_SpectatorsBox_PosX"], SmegHack.Options["Misc_SpectatorsBox_PosY"] = PoX, PoY
  1879.             end
  1880.             local TempSpecsTable = {}
  1881.             for k, v in pairs(player.GetAll()) do
  1882.                 if v:GetObserverTarget() == LocalPlayer() then
  1883.                     table.insert( TempSpecsTable, v:Nick() )
  1884.                 end
  1885.             end
  1886.             if table.concat(TempSpecsTable) != table.concat(SpecsTable) then
  1887.                 if !SpecsListBool && !Wait then
  1888.                     SpecsListBool = true
  1889.                     timer.Simple( 0.1, function() SpecsListBool = false Wait = true end )
  1890.                 elseif Wait then
  1891.                     SpecsTable = table.Copy(TempSpecsTable)
  1892.                     local TextWidth, Tall = 140, 30
  1893.                     local OldWidth, OldTall = DisplayBox:GetSize()
  1894.                     if SpecsTable[1] != nil then
  1895.                         for k, v in pairs(SpecsTable) do
  1896.                             local TempTextWidth = AddLabel( DisplayBox, v, 5, Tall, "Spectators" )
  1897.                             if TempTextWidth > TextWidth then TextWidth = TempTextWidth end
  1898.                             Tall = Tall + 15
  1899.                         end
  1900.                         DisplayBox:SetSize( TextWidth + 10, Tall+5 )
  1901.                     else
  1902.                         AddLabel( DisplayBox, "No Spectators", 5, Tall, "Spectators" )
  1903.                         DisplayBox:SetSize( 150, 50 )
  1904.                     end
  1905.                     local DifferenceX, DifferenceY = OldWidth - TextWidth+10, OldTall - Tall+5
  1906.                     local Var = "SpectatorsBox"
  1907.                     if DifferenceX < 0 then
  1908.                         DifferenceX = DifferenceX * -1
  1909.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] - DifferenceX
  1910.                     else
  1911.                         RightPos = SmegHack.Options["Misc_"..Var.."_PosX"] + DifferenceX
  1912.                     end
  1913.                     if DifferenceY < 0 then
  1914.                         DifferenceY = DifferenceY * -1
  1915.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] - DifferenceY
  1916.                     else
  1917.                         BottomPos = SmegHack.Options["Misc_"..Var.."_PosY"] + DifferenceY
  1918.                     end
  1919.  
  1920.                     if SmegHack.Options["Misc_"..Var.."_Mode"] == "Auto" then
  1921.                         local PosX, PosY
  1922.                         if SmegHack.Options["Misc_"..Var.."_PosX"] > ScrW()/2 then PosX = RightPos else PosX = SmegHack.Options["Misc_"..Var.."_PosX"] end
  1923.                         if SmegHack.Options["Misc_"..Var.."_PosY"] > ScrH()/2 then PosY = BottomPos else PosY = SmegHack.Options["Misc_"..Var.."_PosY"] end
  1924.                         DisplayBox:SetPos( PosX, PosY )
  1925.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Top Right" then
  1926.                         DisplayBox:SetPos( RightPos, SmegHack.Options["Misc_"..Var.."_PosY"] )
  1927.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Left" then
  1928.                         DisplayBox:SetPos( SmegHack.Options["Misc_"..Var.."_PosX"], BottomPos )
  1929.                     elseif SmegHack.Options["Misc_"..Var.."_Mode"] == "Bottom Right" then
  1930.                         DisplayBox:SetPos( RightPos, BottomPos )
  1931.                     end
  1932.                     Wait = false
  1933.                 end
  1934.             end
  1935.         end)
  1936.     end
  1937. end
  1938.  
  1939. function AddSavePage( Parent, Mode )
  1940.     local ManageSaves = vgui.Create("DListView", Parent)
  1941.     ManageSaves:SetPos( 25, 55 )
  1942.     ManageSaves:SetSize( 550, 200 )
  1943.     ManageSaves:SetMultiSelect(false)
  1944.     ManageSaves:AddColumn("Title")
  1945.     ManageSaves:AddColumn("Date Created")
  1946.     function RefreshSaveList(Location, Parent)
  1947.         Parent:Clear()
  1948.         if !file.Exists( "sh/"..Location, "DATA" ) then file.CreateDir( "sh/"..Location ) end
  1949.         if file.Exists( "sh/"..Location, "DATA" ) then
  1950.             local Files, Dirs = file.Find( "sh/"..Location.."/*", "DATA" )
  1951.             for k, v in pairs( Files ) do
  1952.                 local Title = string.StripExtension(v)
  1953.                 local SaveTable = string.Explode( "|", file.Read( "sh/"..Location.."/"..v, "DATA" ) )
  1954.                 local Date = SaveTable[1]
  1955.                 local Time = SaveTable[2]
  1956.                 if Time != nil && Date != nil then
  1957.                     Parent:AddLine(Title, Date.."|"..Time)
  1958.                 else
  1959.                     Parent:AddLine(Title, "This save has been corrupted")
  1960.                 end
  1961.             end
  1962.         end
  1963.     end
  1964.     RefreshSaveList(Mode, ManageSaves)
  1965.    
  1966.     AddTextEntry( Parent, 275, 25, 275, "Input Save Title", Mode )
  1967.     AddGenericButton( Parent, "Refresh Listings", 100, 20, 475, 275, function () RefreshSaveList(Mode, ManageSaves) end )
  1968.     AddGenericButton( Parent, "Delete", 51, 20, 419, 275, function()
  1969.         if ManageSaves:GetSelectedLine() != nil then
  1970.             local SaveTitle = ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(1)
  1971.             if file.Exists( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" ) then file.Delete( "sh/"..Mode.."/"..SaveTitle..".txt" ) end
  1972.             RefreshSaveList(Mode, ManageSaves)
  1973.         end
  1974.     end)
  1975.     AddGenericButton( Parent, "Load", 52, 20, 362, 275, function()
  1976.         if ManageSaves:GetSelectedLine() != nil then
  1977.             local SaveTitle = ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(1)
  1978.             if file.Exists( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" ) then
  1979.                 local SaveFile = file.Read( "sh/"..Mode.."/"..SaveTitle..".txt" )
  1980.                 local SaveFileTable = string.Explode( "|", SaveFile )
  1981.                 for k, v in pairs( SaveFileTable ) do
  1982.                     if k != 1 && k != 2 then
  1983.                         if ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(2) != "This save has been corrupted" then
  1984.                             if Mode == "Friends" then
  1985.                                 table.insert( SmegHack.FriendsList, v )
  1986.                             elseif Mode == "Configs" then
  1987.                                 if string.Left( v, 1 ) == "{" then
  1988.                                     SmegHack.BoneOrder = util.JSONToTable( v )
  1989.                                 else
  1990.                                     local CommandTable = string.Explode( " ", v )
  1991.                                     if CommandTable[3] == "true" || CommandTable[3] == "false" then
  1992.                                         SmegHack.Options[CommandTable[1]] = tobool(CommandTable[3])
  1993.                                     elseif isnumber(tonumber(CommandTable[3])) then
  1994.                                         SmegHack.Options[CommandTable[1]] = tonumber(CommandTable[3])
  1995.                                     else
  1996.                                         SmegHack.Options[CommandTable[1]] = tostring(CommandTable[3])
  1997.                                     end
  1998.                                 end
  1999.                             elseif Mode == "Entities" then
  2000.                                 table.insert( SmegHack.EntityESP, v )
  2001.                             end
  2002.                         end
  2003.                     end
  2004.                 end
  2005.                 if ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(2) != "This save has been corrupted" then
  2006.                     if Mode == "Friends" then
  2007.                         RefreshFriendsList()
  2008.                     elseif Mode == "Configs" then
  2009.                         //RefreshSaveList( Mode, ManageSaves )
  2010.                         CloseMenu()
  2011.                         ReloadSmegHack(false)
  2012.                     elseif Mode == "Entities" then
  2013.                         RefreshEntsList()
  2014.                     end
  2015.                 end
  2016.             end
  2017.         end
  2018.     end)
  2019.     AddGenericButton( Parent, "Save", 52, 20, 305, 275, function()
  2020.         if SmegHack.TextEntries[Mode] != nil then
  2021.             local Files, Dirs = file.Find( "sh/"..Mode.."/*", "DATA" )
  2022.             for k, v in pairs( Files ) do
  2023.                 local Title = string.StripExtension(v)
  2024.                 if Title == SmegHack.TextEntries[Mode] then return end
  2025.             end
  2026.             if !file.Exists( "sh/"..Mode, "DATA" ) then file.CreateDir( "sh/"..Mode ) end
  2027.             if file.Exists( "sh/"..Mode, "DATA" ) then
  2028.                 if tonumber( os.date("%H"), 10 ) < 12 then
  2029.                     local SaveText = os.date("%d/%m/%y | %I:%M AM")
  2030.                     if Mode == "Friends" then
  2031.                         for k, v in pairs( SmegHack.FriendsList ) do
  2032.                             SaveText = SaveText.."|"..v
  2033.                         end
  2034.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2035.                     elseif Mode == "Configs" then
  2036.                         for k, v in pairs( SmegHack.Options ) do
  2037.                             SaveText = SaveText.."|"..k.." = "..tostring(v)
  2038.                         end
  2039.                         SaveText = SaveText.."|"..util.TableToJSON( SmegHack.BoneOrder )
  2040.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2041.                     elseif Mode == "Entities" then
  2042.                         for k, v in pairs( SmegHack.EntityESP ) do
  2043.                             SaveText = SaveText.."|"..v
  2044.                         end
  2045.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2046.                     end
  2047.                 else
  2048.                     local SaveText = os.date("%d/%m/%y | %I:%M PM")
  2049.                     if Mode == "Friends" then
  2050.                         for k, v in pairs( SmegHack.FriendsList ) do
  2051.                             SaveText = SaveText.."|"..v
  2052.                         end
  2053.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2054.                     elseif Mode == "Configs" then
  2055.                         for k, v in pairs( SmegHack.Options ) do
  2056.                             SaveText = SaveText.."|"..k.." = "..tostring(v)
  2057.                         end
  2058.                         SaveText = SaveText.."|"..util.TableToJSON( SmegHack.BoneOrder )
  2059.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2060.                     elseif Mode == "Entities" then
  2061.                         for k, v in pairs( SmegHack.EntityESP ) do
  2062.                             SaveText = SaveText.."|"..v
  2063.                         end
  2064.                         file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveText)
  2065.                     end
  2066.                 end
  2067.             end
  2068.             RefreshSaveList(Mode, ManageSaves)
  2069.         end
  2070.     end)
  2071.     AddGenericButton( Parent, "Rename", 52, 20, 305, 300, function()
  2072.         if ManageSaves:GetSelectedLine() != nil && SmegHack.TextEntries[Mode] != nil then
  2073.             local SaveTitle = ManageSaves:GetLine(ManageSaves:GetSelectedLine()):GetValue(1)
  2074.             if file.Exists( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" ) then
  2075.                 local Files, Dirs = file.Find( "sh/"..Mode.."/*", "DATA" )
  2076.                 for k, v in pairs( Files ) do
  2077.                     local Title = string.StripExtension(v)
  2078.                     if Title == SmegHack.TextEntries[Mode] then return end
  2079.                 end
  2080.                 local SaveFileText = file.Read( "sh/"..Mode.."/"..SaveTitle..".txt", "DATA" )
  2081.                 file.Delete( "sh/"..Mode.."/"..SaveTitle..".txt" )
  2082.                 file.Write( "sh/"..Mode.."/"..SmegHack.TextEntries[Mode]..".txt", SaveFileText )
  2083.                 RefreshSaveList(Mode, ManageSaves)
  2084.             end
  2085.         end
  2086.     end)
  2087. end
  2088.  
  2089. function SmegHackMenu()
  2090.     if MenuOpen then
  2091.         CloseMenu()
  2092.         return
  2093.     end
  2094.     MenuOpen = true
  2095.     //Menu Frame
  2096.     local Menu = vgui.Create("DFrame")
  2097.     Menu:SetTitle("")
  2098.     Menu:ShowCloseButton(false)
  2099.     Menu:SetDraggable(true)
  2100.     Menu:SetSize(600, 400)
  2101.     Menu:Center()
  2102.     Menu:MakePopup()
  2103.     function Menu:Paint( w, h )
  2104.         //Title Bar
  2105.         draw.RoundedBox( 0, 0, 0, w, 24, Color(0,0,0,255) )
  2106.         draw.RoundedBox( 0, 0, 0, w, h, Color(0,10,20,245) )
  2107.        
  2108.         draw.SimpleText( "Smeg Hack", "Menu_Title", w/2, 11, Color(0,100,200), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2109.         draw.SimpleText( "FPS: "..FPSValue, "ESP_Font_Main", 5, 2, Color(0,255,0),TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
  2110.         draw.SimpleText( "Ping: "..LocalPlayer():Ping(), "ESP_Font_Main", 65, 2, Color(0,255,0), TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
  2111.        
  2112.         //Menu Tabs
  2113.         draw.RoundedBox( 0, 0, 25, w, 30, Color(128,128,128,255) )
  2114.         surface.SetDrawColor( Color(0,0,0) )
  2115.         surface.DrawLine( 0, 24, w, 24 )
  2116.         surface.DrawLine( 0, 55, w, 55 )
  2117.         surface.DrawLine( 0, 24, 0, 55 )
  2118.         surface.DrawLine( 50, 24, 50, 55 )
  2119.         surface.DrawLine( 100, 24, 100, 55 )
  2120.         surface.DrawLine( 150, 24, 150, 55 )
  2121.         surface.DrawLine( 200, 24, 200, 55 )
  2122.         surface.DrawLine( 250, 24, 250, 55 )
  2123.         surface.DrawLine( 300, 24, 300, 55 )
  2124.         surface.DrawLine( 350, 24, 350, 55 )
  2125.         surface.DrawLine( 400, 24, 400, 55 )
  2126.         surface.DrawLine( 450, 24, 450, 55 )
  2127.         surface.DrawLine( 500, 24, 500, 55 )
  2128.         surface.DrawLine( 550, 24, 550, 55 )
  2129.         surface.DrawLine( 599, 24, 599, 55 )
  2130.     end
  2131.    
  2132.     //Tab Frames
  2133.     local Main = vgui.Create("DPanel", Menu)
  2134.     Main:SetPos( 0 , 25 )
  2135.     Main:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2136.     Main:SetVisible( false )
  2137.     function Main:Paint()
  2138.         draw.RoundedBox( 0, 1, 0, 49, 30, Color(0,0,255,255) )
  2139.     end
  2140.    
  2141.     local Aimbot = vgui.Create("DPanel", Menu)
  2142.     Aimbot:SetPos( 0 , 25 )
  2143.     Aimbot:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2144.     Aimbot:SetVisible( false )
  2145.     function Aimbot:Paint()
  2146.         draw.RoundedBox( 0, 51, 0, 49, 30, Color(0,0,255,255) )
  2147.  
  2148.         surface.SetDrawColor( Color(255,255,255,255) )
  2149.  
  2150.         //Head
  2151.         surface.DrawCircle( 490, 75, 30, {255,255,255,255} )
  2152.  
  2153.         //Spine
  2154.         surface.DrawLine( 490, 105, 490, 255 )
  2155.  
  2156.         //Arms
  2157.         surface.DrawLine( 490, 180, 440, 130 )
  2158.         surface.DrawLine( 490, 180, 540, 130 )
  2159.         //Hands
  2160.         surface.DrawLine( 440, 130, 420, 130 )
  2161.         surface.DrawLine( 540, 130, 560, 130 )
  2162.  
  2163.         //Legs
  2164.         surface.DrawLine( 490, 255, 440, 305 )
  2165.         surface.DrawLine( 490, 255, 540, 305 )
  2166.         //Feet
  2167.         surface.DrawLine( 440, 305, 400, 305 )
  2168.         surface.DrawLine( 540, 305, 580, 305 )
  2169.     end
  2170.    
  2171.     local ESP = vgui.Create("DPanel", Menu)
  2172.     ESP:SetPos( 0 , 25 )
  2173.     ESP:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2174.     ESP:SetVisible( false )
  2175.     function ESP:Paint()
  2176.         draw.RoundedBox( 0, 101, 0, 49, 30, Color(0,0,255,255) )
  2177.     end
  2178.    
  2179.     local Ents = vgui.Create("DPanel", Menu)
  2180.     Ents:SetPos( 0 , 25 )
  2181.     Ents:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2182.     Ents:SetVisible( false )
  2183.     function Ents:Paint()
  2184.         draw.RoundedBox( 0, 151, 0, 49, 30, Color(0,0,255,255) )
  2185.     end
  2186.    
  2187.     local Misc = vgui.Create("DPanel", Menu)
  2188.     Misc:SetPos( 0 , 25 )
  2189.     Misc:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2190.     Misc:SetVisible( false )
  2191.     function Misc:Paint()
  2192.         draw.RoundedBox( 0, 201, 0, 49, 30, Color(0,0,255,255) )
  2193.     end
  2194.    
  2195.     local Friends = vgui.Create("DPanel", Menu)
  2196.     Friends:SetPos( 0 , 25 )
  2197.     Friends:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2198.     Friends:SetVisible( false )
  2199.     function Friends:Paint()
  2200.         draw.RoundedBox( 0, 251, 0, 49, 30, Color(0,0,255,255) )
  2201.         draw.SimpleText( "Friends                                                       Enemies", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2202.     end
  2203.    
  2204.     local Cams = vgui.Create("DPanel", Menu)
  2205.     Cams:SetPos( 0 , 25 )
  2206.     Cams:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2207.     Cams:SetVisible( false )
  2208.     function Cams:Paint()
  2209.         draw.RoundedBox( 0, 301, 0, 49, 30, Color(0,0,255,255) )
  2210.     end
  2211.    
  2212.     local Bhop = vgui.Create("DPanel", Menu)
  2213.     Bhop:SetPos( 0 , 25 )
  2214.     Bhop:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2215.     Bhop:SetVisible( false )
  2216.     function Bhop:Paint()
  2217.         draw.RoundedBox( 0, 351, 0, 49, 30, Color(0,0,255,255) )
  2218.     end
  2219.    
  2220.     local Spam = vgui.Create("DPanel", Menu)
  2221.     Spam:SetPos( 0 , 25 )
  2222.     Spam:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2223.     Spam:SetVisible( false )
  2224.     function Spam:Paint()
  2225.         draw.RoundedBox( 0, 401, 0, 49, 30, Color(0,0,255,255) )
  2226.     end
  2227.    
  2228.     local Test10 = vgui.Create("DPanel", Menu)
  2229.     Test10:SetPos( 0 , 25 )
  2230.     Test10:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2231.     Test10:SetVisible( false )
  2232.     function Test10:Paint()
  2233.         draw.RoundedBox( 0, 451, 0, 49, 30, Color(0,0,255,255) )
  2234.     end
  2235.    
  2236.     local Test11 = vgui.Create("DPanel", Menu)
  2237.     Test11:SetPos( 0 , 25 )
  2238.     Test11:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2239.     Test11:SetVisible( false )
  2240.     function Test11:Paint()
  2241.         draw.RoundedBox( 0, 501, 0, 49, 30, Color(0,0,255,255) )
  2242.     end
  2243.    
  2244.     local Config = vgui.Create("DPanel", Menu)
  2245.     Config:SetPos( 0 , 25 )
  2246.     Config:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2247.     Config:SetVisible( false )
  2248.     function Config:Paint()
  2249.         draw.RoundedBox( 0, 551, 0, 48, 30, Color(0,0,255,255) )
  2250.         draw.SimpleText( "Configuration save manager", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2251.     end
  2252.    
  2253.     local FriendSaves = vgui.Create("DPanel", Menu)
  2254.     FriendSaves:SetPos( 0 , 25 )
  2255.     FriendSaves:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2256.     FriendSaves:SetVisible( false )
  2257.     function FriendSaves:Paint()
  2258.         draw.RoundedBox( 0, 251, 0, 49, 30, Color(0,0,255,255) )
  2259.         draw.SimpleText( "Friends list save manager", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2260.     end
  2261.    
  2262.     local EntitySaves = vgui.Create("DPanel", Menu)
  2263.     EntitySaves:SetPos( 0 , 25 )
  2264.     EntitySaves:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2265.     EntitySaves:SetVisible( false )
  2266.     function EntitySaves:Paint()
  2267.         draw.RoundedBox( 0, 151, 0, 49, 30, Color(0,0,255,255) )
  2268.         draw.SimpleText( "Entity ESP save manager", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2269.     end
  2270.  
  2271.     local CustomCrosshair = vgui.Create("DPanel", Menu)
  2272.     CustomCrosshair:SetPos( 0 , 25 )
  2273.     CustomCrosshair:SetSize( Menu:GetWide(), Menu:GetTall()-25 )
  2274.     CustomCrosshair:SetVisible( false )
  2275.     function CustomCrosshair:Paint()
  2276.         draw.RoundedBox( 0, 101, 0, 49, 30, Color(0,0,255,255) )
  2277.         draw.SimpleText( "Custom Crosshair", "ESP_Font_Main", 300, 43, Color(0,255,0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  2278.     end
  2279.    
  2280.     //Close Button     
  2281.     local CloseButton = vgui.Create("DButton", Menu)
  2282.     CloseButton:SetSize(24, 24)
  2283.     CloseButton:SetPos(Menu:GetWide()-24, 0)
  2284.     CloseButton:SetText("X")
  2285.     CloseButton:SetColor(Color(255,255,255))
  2286.     function CloseButton:Paint( w, h )
  2287.         draw.RoundedBox( 0, 0, 0, w, h, Color(0,30,100,200) )
  2288.     end
  2289.     CloseButton.DoClick = function() CloseMenu() end
  2290.    
  2291.     //Panic Button
  2292.     local PanicButton = vgui.Create("DButton", Menu)
  2293.     PanicButton:SetSize(40, 24)
  2294.     PanicButton:SetPos(Menu:GetWide()-64, 0)
  2295.     if GetConVarNumber("SmegHack_Panic") == 1 then
  2296.         PanicButton:SetText("Enable")
  2297.         PanicButton:SetColor(Color(50,200,0,255))
  2298.     else
  2299.         PanicButton:SetText("Disable")
  2300.         PanicButton:SetColor(Color(255,0,0,255))
  2301.     end
  2302.     function PanicButton:Paint( w, h )
  2303.         draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
  2304.     end
  2305.     PanicButton.DoClick = function()
  2306.         if GetConVarNumber("SmegHack_Panic") == 1 then
  2307.             RunConsoleCommand("SmegHack_Panic", 0)
  2308.             PanicButton:SetText("Disable")
  2309.             PanicButton:SetColor(Color(255,0,0,255))
  2310.         else
  2311.             RunConsoleCommand("SmegHack_Panic", 1)
  2312.             PanicButton:SetText("Enable")
  2313.             PanicButton:SetColor(Color(50,200,0,255))
  2314.         end
  2315.     end
  2316.        
  2317.     //Menu Tabs
  2318.     AddMenuTab( Menu, "Main", Main, 1, 25, 1 )
  2319.     AddMenuTab( Menu, "Aimbot", Aimbot, 51, 25, 2 )
  2320.     AddMenuTab( Menu, "ESP", ESP, 101, 25, 3 )
  2321.     AddMenuTab( Menu, "Ents", Ents, 151, 25, 4 )
  2322.     AddMenuTab( Menu, "Misc", Misc, 201, 25, 5 )
  2323.     AddMenuTab( Menu, "Friends", Friends, 251, 25, 6 )
  2324.     AddMenuTab( Menu, "Cams", Cams, 301, 25, 7 )
  2325.     AddMenuTab( Menu, "Bhop", Bhop, 351, 25, 8 )
  2326.     AddMenuTab( Menu, "Spam", Spam, 401, 25, 9 )
  2327.     AddMenuTab( Menu, "Test10", Test10, 451, 25, 10 )
  2328.     AddMenuTab( Menu, "Test11", Test11, 501, 25, 11 )
  2329.     AddMenuTab( Menu, "Config", Config, 551, 25, 12 )
  2330.    
  2331.     function ChangeTab ( Tab, TabID )
  2332.         Main:SetVisible(false)
  2333.         Aimbot:SetVisible(false)
  2334.         ESP:SetVisible(false)
  2335.         Ents:SetVisible(false)
  2336.         Misc:SetVisible(false)
  2337.         Friends:SetVisible(false)
  2338.         Cams:SetVisible(false)
  2339.         Bhop:SetVisible(false)
  2340.         Spam:SetVisible(false)
  2341.         Test10:SetVisible(false)
  2342.         Test11:SetVisible(false)
  2343.         Config:SetVisible(false)
  2344.         FriendSaves:SetVisible(false)
  2345.         EntitySaves:SetVisible(false)
  2346.         CustomCrosshair:SetVisible(false)
  2347.        
  2348.         Tab:SetVisible(true)
  2349.         SmegHack.ActiveTab = TabID
  2350.     end
  2351.    
  2352.     //Main Tab
  2353.     AddMainMenuButton( Main, "Unload Hack", 100, 60, function()
  2354.         CloseMenu()
  2355.         UnloadSmegHack(true)
  2356.     end)
  2357.     AddMainMenuButton( Main, "Reload Hack", 250, 60, function()
  2358.         CloseMenu()
  2359.         ReloadSmegHack(true)
  2360.     end)
  2361.     AddMainMenuButton( Main, "Clear Saved Files", 400, 60, function()
  2362.         if file.Exists( "sh", "DATA" ) then
  2363.             local Files, Dirs = file.Find( "sh/*", "DATA" )
  2364.             for k, v in pairs( Files ) do
  2365.                 file.Delete( "sh/"..v )
  2366.             end
  2367.             for k, v in pairs( Dirs ) do
  2368.                 local Files, Dirs = file.Find( "sh/"..v.."/*", "DATA" )
  2369.                 local Dir = v
  2370.                 for k, v in pairs( Files ) do
  2371.                     file.Delete( "sh/"..Dir.."/"..v )
  2372.                 end
  2373.             end
  2374.         end
  2375.     end)
  2376.    
  2377.     //Aimbot Tab
  2378.     AddCheckBox( Aimbot, "Aimbot", 15, 45, "Enables/Disables Aimbot", "Aimbot_Toggle" )
  2379.     AddCheckBox( Aimbot, "LOS Check", 15, 65, "Only aims at visible players (players within your line of sight)", "Aimbot_LOSCheck" )
  2380.     AddCheckBox( Aimbot, "Auto Wall", 15, 85, "Aim at people behind walls that can be shot through", "Aimbot_AutoWall")
  2381.     AddCheckBox( Aimbot, "Auto Shoot", 100, 85, "Automatically shoot when the aimbot is locked onto someone", "Aimbot_AutoShoot")
  2382.  
  2383.     AddCheckBox( Aimbot, "Aim On Key", 15, 105, "Aimbot only active when selected key is held down", "Aimbot_AimOnKey" )
  2384.     AddKeyBind( Aimbot, 100, 105, "Aimbot_AimOnKey_Key" )
  2385.     AddLabel( Aimbot, "Aim Priority:", 40, 125 )
  2386.     AddComboBox( Aimbot, 100, 125, 100, 15, "Aimbot_AimPriority", {"Distance", "Crosshair"} )
  2387.     AddCheckBox( Aimbot, "Smooth Aim", 15, 145, "Aims at other players slowly (looks more legit)", "Aimbot_SmoothAim")
  2388.     AddSlider( Aimbot, "Aimbot_SmoothAim_Value", 100, 145, 0, 1000, 0 )
  2389.     AddCheckBox( Aimbot, "FOV", 15, 165, "Only aim at players within the selected field of view", "Aimbot_FOV")
  2390.     AddSlider( Aimbot, "Aimbot_FOV_Value", 100, 165, 0, 360, 0 )
  2391.     AddCheckBox( Aimbot, "Stick To Target", 15, 185, "Will stay aiming at the one target as long as they fall within the selected criteria above", "Aimbot_StickToTarget" )
  2392.     AddCheckBox( Aimbot, "Bone Aim", 15, 205, "Aims only at selected bone", "Aimbot_BoneAim" )
  2393.  
  2394.     AddCheckBox( Aimbot, "Team", 15, 245, "Aim at/ignore players on your team", "Aimbot_AimTeam" )
  2395.     AddCheckBox( Aimbot, "Opponents", 15, 265, "Aim at/ignore players on the other team", "Aimbot_AimOpponents" )
  2396.     AddCheckBox( Aimbot, "Friends", 15, 285, "Aim at/ignore players on your friends list", "Aimbot_AimFriends" )
  2397.     AddCheckBox( Aimbot, "Enemies", 15, 305, "Aim at/ignore players on your enemies list", "Aimbot_AimEnemies" )
  2398.     AddCheckBox( Aimbot, "NPCs", 15, 325, "Aim at/ignore NPCs", "Aimbot_AimNPCs" )
  2399.     AddCheckBox( Aimbot, "Spectators", 15, 345, "Aim at/ignore players who are in spectator mode", "Aimbot_AimSpectators" )
  2400.  
  2401.     AddComboBox( Aimbot, 100, 245, 70, 15, "Aimbot_AimTeamV", {"Aim", "Ignore"} )
  2402.     AddComboBox( Aimbot, 100, 265, 70, 15, "Aimbot_AimOpponentsV", {"Aim", "Ignore"} )
  2403.     AddComboBox( Aimbot, 100, 285, 70, 15, "Aimbot_AimFriendsV", {"Aim", "Ignore"} )
  2404.     AddComboBox( Aimbot, 100, 305, 70, 15, "Aimbot_AimEnemiesV", {"Aim", "Ignore"} )
  2405.     AddComboBox( Aimbot, 100, 325, 70, 15, "Aimbot_AimNPCsV", {"Aim", "Ignore"} )
  2406.     AddComboBox( Aimbot, 100, 345, 70, 15, "Aimbot_AimSpectatorsV", {"Aim", "Ignore"} )
  2407.  
  2408.     //AddLabel( Parent, Text, PosX, PosY, CloseOn )
  2409.     AddLabel( Aimbot, "Offset X:", 200, 325 )
  2410.     AddLabel( Aimbot, "Offset Y:", 200, 345 )
  2411.     AddSlider( Aimbot, "Aimbot_OffsetX", 250, 320, -100, 100, 0 )
  2412.     AddSlider( Aimbot, "Aimbot_OffsetY", 250, 340, -100, 100, 0 )
  2413.    
  2414.     AddBoneButton( Aimbot, 490, 75, "ValveBiped.Bip01_Head1" )
  2415.     AddBoneButton( Aimbot, 490, 120, "ValveBiped.Bip01_Neck1" )
  2416.     AddBoneButton( Aimbot, 490, 150, "ValveBiped.Bip01_Spine4" )
  2417.     AddBoneButton( Aimbot, 490, 175, "ValveBiped.Bip01_Spine2" )
  2418.     AddBoneButton( Aimbot, 490, 200, "ValveBiped.Bip01_Spine1" )
  2419.     AddBoneButton( Aimbot, 490, 225, "ValveBiped.Bip01_Spine" )
  2420.     AddBoneButton( Aimbot, 490, 255, "ValveBiped.Bip01_Pelvis" )
  2421.     AddBoneButton( Aimbot, 470, 160, "ValveBiped.Bip01_R_UpperArm" )
  2422.     AddBoneButton( Aimbot, 450, 140, "ValveBiped.Bip01_R_Forearm" )
  2423.     AddBoneButton( Aimbot, 430, 130, "ValveBiped.Bip01_R_Hand" )
  2424.     AddBoneButton( Aimbot, 510, 165, "ValveBiped.Bip01_L_UpperArm" )
  2425.     AddBoneButton( Aimbot, 530, 140, "ValveBiped.Bip01_L_Forearm" )
  2426.     AddBoneButton( Aimbot, 550, 130, "ValveBiped.Bip01_L_Hand" )
  2427.     AddBoneButton( Aimbot, 470, 275, "ValveBiped.Bip01_R_Thigh" )
  2428.     AddBoneButton( Aimbot, 450, 295, "ValveBiped.Bip01_R_Calf" )
  2429.     AddBoneButton( Aimbot, 430, 305, "ValveBiped.Bip01_R_Foot" )
  2430.     AddBoneButton( Aimbot, 410, 305, "ValveBiped.Bip01_R_Toe0" )
  2431.     AddBoneButton( Aimbot, 510, 275, "ValveBiped.Bip01_L_Thigh" )
  2432.     AddBoneButton( Aimbot, 530, 295, "ValveBiped.Bip01_L_Calf" )
  2433.     AddBoneButton( Aimbot, 550, 305, "ValveBiped.Bip01_L_Foot" )
  2434.     AddBoneButton( Aimbot, 570, 305, "ValveBiped.Bip01_L_Toe0" )
  2435.  
  2436.     AddGenericButton( Aimbot, "Fill", 85, 30, 400, 325, function()
  2437.         for k, v in pairs(SmegHack.Bones) do
  2438.             if !table.HasValue( SmegHack.BoneOrder, v ) then
  2439.                 table.insert( SmegHack.BoneOrder, v )
  2440.             end
  2441.         end
  2442.         UpdateBoneThink = true
  2443.     end)
  2444.     AddGenericButton( Aimbot, "Clear", 85, 30, 495, 325, function()
  2445.         table.Empty( SmegHack.BoneOrder )
  2446.         UpdateBoneThink = true
  2447.     end)
  2448.    
  2449.  
  2450.     //ESP Tab
  2451.     AddCheckBox( ESP, "ESP", 15, 45, "Enables/Disables ESP", "ESP_Toggle" )
  2452.     AddCheckBox( ESP, "Team", 15, 65, "Draw/Ignore ESP for players on your team", "ESP_ShowTeam" )
  2453.     AddCheckBox( ESP, "Opponents", 15, 85, "Draw/Ignore ESP for players not on your team", "ESP_ShowOpponents" )
  2454.     AddCheckBox( ESP, "Friends", 15, 105, "Draw/Ignore ESP for players on your friends list", "ESP_ShowFriends" )
  2455.     AddCheckBox( ESP, "Enemies", 15, 125, "Draw/Ignore ESP for players on your enemies list", "ESP_ShowEnemies" )
  2456.     AddCheckBox( ESP, "NPCs", 15, 145, "Draw/Ignore ESP for NPCs", "ESP_ShowNPCs" )
  2457.     AddCheckBox( ESP, "Spectators", 15, 165, "Draw/Ignore ESP for spectators", "ESP_ShowSpectators" )
  2458.  
  2459.     AddComboBox( ESP, 100, 65, 70, 15, "ESP_ShowTeamV", {"Show", "Ignore"} )
  2460.     AddComboBox( ESP, 100, 85, 70, 15, "ESP_ShowOpponentsV", {"Show", "Ignore"} )
  2461.     AddComboBox( ESP, 100, 105, 70, 15, "ESP_ShowFriendsV", {"Show", "Ignore"} )
  2462.     AddComboBox( ESP, 100, 125, 70, 15, "ESP_ShowEnemiesV", {"Show", "Ignore"} )
  2463.     AddComboBox( ESP, 100, 145, 70, 15, "ESP_ShowNPCsV", {"Show", "Ignore"} )
  2464.     AddComboBox( ESP, 100, 165, 70, 15, "ESP_ShowSpectatorsV", {"Show", "Ignore"} )
  2465.  
  2466.     AddCheckBox( ESP, "Boundary Boxes", 15, 190, "Display a box around players", "ESP_BoundaryBoxes" )
  2467.     AddComboBox( ESP, 120, 190, 35, 15, "ESP_BoundaryBoxes_Mode", { "2D", "3D" } )
  2468.     AddCheckBox( ESP, "Name Tags", 15, 210, "Display player names", "ESP_NameTags" )
  2469.     AddCheckBox( ESP, "Weapon", 15, 230, "Display equipped weapon of players", "ESP_Weapon" )
  2470.     AddCheckBox( ESP, "Distance", 15, 250, "Display distance between you and other players", "ESP_Distance" )
  2471.     AddCheckBox( ESP, "Health", 15, 270, "Display health of players", "ESP_Health" )
  2472.     AddCheckBox( ESP, "Skeleton", 15, 290, "Draws the skeleton of players", "ESP_Skeleton" )
  2473.     AddCheckBox( ESP, "Crosshair", 15, 310, "Draws crosshair on screen", "ESP_Crosshair" )
  2474.     AddGenericButton( ESP, "Customize", 80, 15, 90, 310, function() ChangeTab(CustomCrosshair,15) end )
  2475.  
  2476.     AddCheckBox( ESP, "Entity ESP", 185, 65, "Draw ESP for selected entities", "ESP_Entity_Toggle" )
  2477.     AddCheckBox( ESP, "Name Tags", 185, 85, "Draw ESP for selected entities", "ESP_Entities_NameTags" )
  2478.     AddCheckBox( ESP, "Boundary Boxes", 185, 105, "Draw ESP for selected entities", "ESP_Entities_BoundaryBoxes" )
  2479.     AddComboBox( ESP, 290, 105, 40, 15, "ESP_Entities_BoundaryBoxes_Mode", { "2D", "3D" } )
  2480.  
  2481.     //Crosshair Custimization
  2482.     AddGenericButton( CustomCrosshair, "<-- Finished   ", 100, 20, 25, 335, function () ChangeTab( ESP, 3 ) end )
  2483.     AddLabel( CustomCrosshair, "Size:", 15, 60 )
  2484.     AddLabel( CustomCrosshair, "Mode:", 15, 80)
  2485.     AddSlider( CustomCrosshair, "ESP_Crosshair_Size", 50, 60, 1, ScrW()/2, 0 )
  2486.     AddComboBox( CustomCrosshair, 50, 80, 105, 15, "ESP_Crosshair_Mode", { "Team", "Custom" } )
  2487.  
  2488.     local Mixer = vgui.Create( "DColorMixer", CustomCrosshair )
  2489.     Mixer:SetSize( 250, 160 )
  2490.     Mixer:SetPos( 335, 60 )
  2491.     Mixer:SetPalette( false )
  2492.     Mixer:SetAlphaBar( true )
  2493.     Mixer:SetWangs( true )
  2494.     if SmegHack.Options["ESP_Crosshair_Mode"] == "Team" then
  2495.         Mixer:SetColor( team.GetColor(LocalPlayer():Team()) )
  2496.     else
  2497.         Mixer:SetColor( Color(SmegHack.Options["ESP_Crosshair_Color_R"], SmegHack.Options["ESP_Crosshair_Color_G"], SmegHack.Options["ESP_Crosshair_Color_B"], SmegHack.Options["ESP_Crosshair_Color_A"]) )
  2498.     end
  2499.     Mixer.Think = function()
  2500.         if SmegHack.Options["ESP_Crosshair_Mode"] == "Custom" then
  2501.             SmegHack.Options["ESP_Crosshair_Color_R"] = Mixer:GetColor().r
  2502.             SmegHack.Options["ESP_Crosshair_Color_G"] = Mixer:GetColor().g
  2503.             SmegHack.Options["ESP_Crosshair_Color_B"] = Mixer:GetColor().b
  2504.         end
  2505.         SmegHack.Options["ESP_Crosshair_Color_A"] = Mixer:GetColor().a
  2506.     end
  2507.  
  2508.     //Ents Tab
  2509.     local ESPOffEntsList = vgui.Create("DListView", Ents)
  2510.     ESPOffEntsList:SetPos( 25, 55 )
  2511.     ESPOffEntsList:SetSize( 225, 295 )
  2512.     ESPOffEntsList:SetMultiSelect(false)
  2513.     ESPOffEntsList:AddColumn("Off ESP")
  2514.    
  2515.     local ESPOnEntsList = vgui.Create("DListView", Ents)
  2516.     ESPOnEntsList:SetPos( 350, 55 )
  2517.     ESPOnEntsList:SetSize( 225, 295 )
  2518.     ESPOnEntsList:SetMultiSelect(false)
  2519.     ESPOnEntsList:AddColumn("On ESP")
  2520.    
  2521.     function RefreshEntsList()
  2522.         ESPOnEntsList:Clear()
  2523.         ESPOffEntsList:Clear()
  2524.         for k, v in pairs( SmegHack.EntityESP ) do
  2525.             ESPOnEntsList:AddLine(v)
  2526.         end
  2527.         for k, v in pairs( ents.GetAll() ) do
  2528.             local Name = v:GetClass()
  2529.             local Copy = false
  2530.             if Name != "player" then
  2531.                 if !table.HasValue( SmegHack.EntityESP, Name ) then
  2532.                     for k, v in pairs (ESPOffEntsList:GetLines() ) do
  2533.                         if v:GetValue(1) == Name then Copy = true end
  2534.                     end
  2535.                     if Copy == false then ESPOffEntsList:AddLine(Name) end
  2536.                 end
  2537.             end
  2538.         end
  2539.     end
  2540.     RefreshEntsList()
  2541.    
  2542.     AddGenericButton( Ents, "Refresh", 80, 30, 260, 55, function() RefreshEntsList() end )
  2543.     AddGenericButton( Ents, "------->", 80, 30, 260, 167.5, function()
  2544.         if ESPOffEntsList:GetSelectedLine() != nil then
  2545.             table.insert( SmegHack.EntityESP, ESPOffEntsList:GetLine(ESPOffEntsList:GetSelectedLine()):GetValue(1) )
  2546.         end
  2547.         RefreshEntsList()
  2548.     end)
  2549.     AddGenericButton( Ents, "<-------", 80, 30, 260, 207.5, function()
  2550.         if ESPOnEntsList:GetSelectedLine() != nil then
  2551.             for k, v in pairs( SmegHack.EntityESP ) do
  2552.                 if v == ESPOnEntsList:GetLine(ESPOnEntsList:GetSelectedLine()):GetValue(1) then
  2553.                     table.remove( SmegHack.EntityESP, k )
  2554.                 end
  2555.             end
  2556.         end
  2557.         RefreshEntsList()
  2558.     end)
  2559.     AddGenericButton( Ents, "Add All", 80, 30, 260, 95, function()
  2560.         for k, v in pairs( ESPOffEntsList:GetLines() ) do
  2561.             table.insert( SmegHack.EntityESP, v:GetValue(1) )
  2562.         end
  2563.         RefreshEntsList()
  2564.     end)
  2565.     AddGenericButton( Ents, "Clear Ents", 80, 30, 260, 280, function() table.Empty( SmegHack.EntityESP ) RefreshEntsList() end )
  2566.     AddGenericButton( Ents, "Manage Saves", 80, 30, 260, 320, function() ChangeTab(EntitySaves, 14) end )
  2567.    
  2568.     //Entity Saves Manager
  2569.     AddSavePage( EntitySaves, "Entities" )
  2570.     AddGenericButton( EntitySaves, "<-- Finished   ", 100, 20, 25, 335, function () ChangeTab( Ents, 4 ) end )
  2571.  
  2572.     //Misc Tab
  2573.     AddCheckBox( Misc, "Clock Speed Manipulator", 15, 45, "Speed hack", "Misc_Clock", function()
  2574.         if SmegHack.Options["Misc_Clock"] then
  2575.             TimeScaleChange = true
  2576.         else
  2577.             LocalPlayer():ConCommand("incrementvar sv_cheats "..NormSvCheats.." "..NormSvCheats.." "..NormSvCheats)
  2578.             LocalPlayer():ConCommand("incrementvar host_timescale "..NormHostTimeScale.." "..NormHostTimeScale.." "..NormHostTimeScale)
  2579.         end
  2580.     end)
  2581.     AddSlider( Misc, "Misc_Clock_Speed", 160, 45, 0, 10, 0 )
  2582.     AddComboBox( Misc, 300, 45, 50, 15, "Misc_Clock_Mode", {"Fast", "Slow"}, function() TimeScaleChange = true end )
  2583.  
  2584.     AddCheckBox( Misc, "Admin Box", 15, 65, "Display all admins in a box", "Misc_AdminBox", function()
  2585.         if SmegHack.Options["Misc_AdminBox"] then
  2586.             AddDisplayBox( "Admins", 1 )
  2587.         end
  2588.     end)
  2589.     AddComboBox( Misc, 120, 65, 90, 15, "Misc_AdminBox_Mode", {"Auto", "Top Left", "Top Right", "Bottom Left", "Bottom Right"} )
  2590.     AddCheckBox( Misc, "Spectators Box", 15, 85, "Display all people spectating you in a box", "Misc_SpectatorsBox", function()
  2591.         if SmegHack.Options["Misc_SpectatorsBox"] then
  2592.             AddDisplayBox( "Spectators", 2 )
  2593.         end
  2594.     end)
  2595.     AddComboBox( Misc, 120, 85, 90, 15, "Misc_SpectatorsBox_Mode", {"Auto", "Top Left", "Top Right", "Bottom Left", "Bottom Right"} )
  2596.    
  2597.     //Friends Tab
  2598.     local FriendsList = vgui.Create("DListView", Friends)
  2599.     FriendsList:SetPos( 25, 55 )
  2600.     FriendsList:SetSize( 275, 200 )
  2601.     FriendsList:SetMultiSelect(false)
  2602.     FriendsList:AddColumn("Player Name")
  2603.     FriendsList:AddColumn("Steam ID")
  2604.    
  2605.     local EnemiesList = vgui.Create("DListView", Friends)
  2606.     EnemiesList:SetPos( 300, 55 )
  2607.     EnemiesList:SetSize( 275, 200 )
  2608.     EnemiesList:SetMultiSelect(false)
  2609.     EnemiesList:AddColumn("Player Name")
  2610.     EnemiesList:AddColumn("Steam ID")
  2611.    
  2612.     function RefreshFriendsList()
  2613.         FriendsList:Clear()
  2614.         EnemiesList:Clear()
  2615.         for k, v in pairs(player.GetAll()) do
  2616.             if v != LocalPlayer() then
  2617.                 if SmegHack.Options["Friends_SteamFriends"] && v:GetFriendStatus() == "friend" then
  2618.                     if !table.HasValue(SmegHack.FriendsList, v:SteamID()) then table.insert(SmegHack.FriendsList, v:SteamID()) end
  2619.                 end
  2620.                 if SmegHack.Options["Friends_SteamEnemies"] && v:GetFriendStatus() == "friend" then
  2621.                     local PlayerSteamID = v:SteamID()
  2622.                     for k, v in pairs(SmegHack.FriendsList) do
  2623.                         if v == PlayerSteamID then
  2624.                             table.remove(SmegHack.FriendsList, k)
  2625.                         end
  2626.                     end
  2627.                     if table.HasValue(SmegHack.FriendsList, v:SteamID()) then table.remove(SmegHack.FriendsList, v:SteamID()) end
  2628.                 end
  2629.                 if SmegHack.Options["Friends_FriendIsEnemy"] then
  2630.                     if table.HasValue(SmegHack.FriendsList, v:SteamID()) then
  2631.                         EnemiesList:AddLine(v:Nick(), v:SteamID())
  2632.                     else
  2633.                         FriendsList:AddLine(v:Nick(), v:SteamID())
  2634.                     end
  2635.                 else
  2636.                     if table.HasValue(SmegHack.FriendsList, v:SteamID()) then
  2637.                         FriendsList:AddLine(v:Nick(), v:SteamID())
  2638.                     else
  2639.                         EnemiesList:AddLine(v:Nick(), v:SteamID())
  2640.                     end
  2641.                 end
  2642.             end
  2643.         end
  2644.     end
  2645.     RefreshFriendsList()
  2646.    
  2647.     AddMainMenuButton( Friends, "Remove Friend", 112.5, 260, function()
  2648.         local SelectedLine = FriendsList:GetSelectedLine()
  2649.         if SelectedLine != nil then
  2650.             local PlayerNick = FriendsList:GetLine(SelectedLine):GetValue(1)
  2651.             local PlayerSteamID = FriendsList:GetLine(SelectedLine):GetValue(2)
  2652.             if SmegHack.Options["Friends_FriendIsEnemy"] then
  2653.                 table.insert(SmegHack.FriendsList, PlayerSteamID)
  2654.             else
  2655.                 for k, v in pairs(SmegHack.FriendsList) do
  2656.                     if v == PlayerSteamID then
  2657.                         table.remove(SmegHack.FriendsList, k)
  2658.                         break
  2659.                     end
  2660.                 end
  2661.             end
  2662.             RefreshFriendsList()
  2663.         end
  2664.     end)
  2665.    
  2666.     AddMainMenuButton( Friends, "Add Friend", 387.5, 260, function()
  2667.         local SelectedLine = EnemiesList:GetSelectedLine()
  2668.         if SelectedLine != nil then
  2669.             local PlayerNick = EnemiesList:GetLine(SelectedLine):GetValue(1)
  2670.             local PlayerSteamID = EnemiesList:GetLine(SelectedLine):GetValue(2)
  2671.             if SmegHack.Options["Friends_FriendIsEnemy"] then
  2672.                 for k, v in pairs(SmegHack.FriendsList) do
  2673.                     if v == PlayerSteamID then
  2674.                         table.remove(SmegHack.FriendsList, k)
  2675.                         break
  2676.                     end
  2677.                 end
  2678.             else
  2679.                 table.insert(SmegHack.FriendsList, PlayerSteamID)
  2680.             end
  2681.             RefreshFriendsList()
  2682.         end
  2683.     end)
  2684.    
  2685.     AddMainMenuButton( Friends, "Refresh List", (Friends:GetWide()/2)-50, 260, function() RefreshFriendsList() end )
  2686.     AddMainMenuButton( Friends, "Manage Saves", (Friends:GetWide()/2)-50, 300, function() ChangeTab( FriendSaves, 13 ) end )
  2687.     AddMainMenuButton( Friends, "Clear Friends", 387.5, 300, function() table.Empty( SmegHack.FriendsList ) RefreshFriendsList() end )
  2688.     AddCheckBox( Friends, "Friend Is Enemy", 5, 265, "Turns the friends list into the enemies list", "Friends_FriendIsEnemy", function() RefreshFriendsList() end )
  2689.     AddCheckBox( Friends, "Steam Friends", 5, 285, "Make your friends on steam automatically appear on the friends list", "Friends_SteamFriends", function() RefreshFriendsList() end )
  2690.     AddCheckBox( Friends, "Steam Enemies", 5, 305, "Make your friends on steam automatically appear on the enemies list", "Friends_SteamEnemies", function() RefreshFriendsList() end )
  2691.    
  2692.     //Manage Friend Saves
  2693.     AddSavePage( FriendSaves, "Friends" )
  2694.     AddGenericButton( FriendSaves, "<-- Finished   ", 100, 20, 25, 335, function () ChangeTab( Friends, 6 ) end )
  2695.  
  2696.     //Cams Tab
  2697.     AddCheckBox( Cams, "Cams", 15, 45, "Enables/Disables cams hacks", "Cams_Toggle" )
  2698.     AddCheckBox( Cams, "Client Side Noclip", 15, 65, "Fly around the map freely (everyone else on the server wont see you flying)", "Cams_CSNoclip" )
  2699.     AddSlider( Cams, "Cams_CSNoclip_Speed", 125, 65, 0, 100, 0 )
  2700.     AddCheckBox( Cams, "Thirdperson", 15, 85, "An over shoulder view", "Cams_ThirdPerson" )
  2701.     AddSlider( Cams, "Cams_ThirdPerson_Zoom", 125, 85, 0, 100, 0 )
  2702.  
  2703.     //Bhop Tab
  2704.     AddCheckBox( Bhop, "Bhop", 15, 45, "Enables/Disables Bhop hacks", "Bhop_Toggle" )
  2705.     AddCheckBox( Bhop, "Fast Walk", 15, 65, "Makes you walk slightly faster", "Bhop_FastWalk" )
  2706.     AddCheckBox( Bhop, "Auto Hop", 15, 85, "Hold space to bhop", "Bhop_AutoHop" )
  2707.     AddCheckBox( Bhop, "Auto Strafe", 15, 105, "Automatically turns in the air", "Bhop_AutoStrafe")
  2708.     AddCheckBox( Bhop, "Edge Jump", 15, 125, "Jumps just before an edge", "Bhop_EdgeJump")
  2709.     AddSlider( Bhop, "Bhop_EdgeJump_Distance", 100, 125, 0, 100, 0 )
  2710.     AddCheckBox( Bhop, "Sideways", 15, 145, "Turns your camera so you can bhop normally while in Sideways mode", "Bhop_Sideways")
  2711.     AddCheckBox( Bhop, "W-Only", 15, 165, "Turns your camera so you can bhop normally while in W-Only mode", "Bhop_WOnly")
  2712.  
  2713.     //Spam Tab
  2714.     AddCheckBox( Spam, "Spam", 15, 45, "Enables/Disables Chat Spammer", "Spam_Toggle" )
  2715.     AddCheckBox( Spam, "Delay", 15, 65, "Pauses between each spam for x seeconds", "Spam_Delay" )
  2716.     AddSlider( Spam, "Spam_Delay_Value", 80, 65, 0, 10, 2 )
  2717.     AddCheckBox( Spam, "Anti-Anti-Spam", 15, 85, "Adds a random number to the end of your message to help avoid Anti-Spammers", "Spam_AntiAntiSpam" )
  2718.  
  2719.     AddCheckBox( Spam, "Message 1", 15, 265, "Enable spam message #1", "Spam_Message_1" )
  2720.     AddCheckBox( Spam, "Message 2", 15, 285, "Enable spam message #2", "Spam_Message_2" )
  2721.     AddCheckBox( Spam, "Message 3", 15, 305, "Enable spam message #3", "Spam_Message_3" )
  2722.     AddCheckBox( Spam, "Message 4", 15, 325, "Enable spam message #4", "Spam_Message_4" )
  2723.     AddCheckBox( Spam, "Message 5", 15, 345, "Enable spam message #5", "Spam_Message_5" )
  2724.     AddTextEntry( Spam, 485, 100, 262, "", "Spam1", true )
  2725.     AddTextEntry( Spam, 485, 100, 282, "", "Spam2", true )
  2726.     AddTextEntry( Spam, 485, 100, 302, "", "Spam3", true )
  2727.     AddTextEntry( Spam, 485, 100, 322, "", "Spam4", true )
  2728.     AddTextEntry( Spam, 485, 100, 342, "", "Spam5", true )
  2729.    
  2730.     //Config Tab
  2731.     AddSavePage( Config, "Configs" )
  2732.    
  2733.     if SmegHack.ActiveTab == nil then SmegHack.ActiveTab = 1 end
  2734.     if SmegHack.ActiveTab == 1 then ChangeTab( Main, 1 )
  2735.     elseif SmegHack.ActiveTab == 2 then ChangeTab( Aimbot, 2 )
  2736.     elseif SmegHack.ActiveTab == 3 then ChangeTab( ESP, 3 )
  2737.     elseif SmegHack.ActiveTab == 4 then ChangeTab( Ents, 4 )
  2738.     elseif SmegHack.ActiveTab == 5 then ChangeTab( Misc, 5 )
  2739.     elseif SmegHack.ActiveTab == 6 then ChangeTab( Friends, 6 )
  2740.     elseif SmegHack.ActiveTab == 7 then ChangeTab( Cams, 7 )
  2741.     elseif SmegHack.ActiveTab == 8 then ChangeTab( Bhop, 8 )
  2742.     elseif SmegHack.ActiveTab == 9 then ChangeTab( Spam, 9 )
  2743.     elseif SmegHack.ActiveTab == 10 then ChangeTab( Test10, 10 )
  2744.     elseif SmegHack.ActiveTab == 11 then ChangeTab( Test11, 11 )
  2745.     elseif SmegHack.ActiveTab == 12 then ChangeTab( Config, 12 )
  2746.     elseif SmegHack.ActiveTab == 13 then ChangeTab ( FriendSaves, 13 )
  2747.     elseif SmegHack.ActiveTab == 14 then ChangeTab ( EntitySaves, 14 )
  2748.     elseif SmegHack.ActiveTab == 15 then ChangeTab ( CustomCrosshair, 15 ) end
  2749.  
  2750.     function CloseMenu()
  2751.         MenuOpen = false
  2752.         Menu:Close()
  2753.     end
  2754. end
  2755. LoadSmegHack(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement