Guest User

ahack with nospreadens

a guest
Jul 3rd, 2013
764
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 90.18 KB | None | 0 0
  1. --[[
  2.            _    _            _    
  3.      /\   | |  | |          | |  
  4.     /  \  | |__| | __ _  ___| | __
  5.    / /\ \ |  __  |/ _` |/ __| |/ /
  6.   / ____ \| |  | | (_| | (__|   <
  7.  /_/    \_\_|  |_|\__,_|\___|_|\_\
  8.  
  9.  Created by Atheon and originally released at MPGH.
  10.  Current Version: 1.4.2
  11.  
  12. Features:
  13. On/Off Switch - In the top right of the hack there is an on/off switch that will deactivate everything.
  14.  
  15. Aimbot -
  16. Active - Determines, overall, if the aimbot should be working.
  17. Random Bone - If enabled the aimbot will pick a random bone to attack instead of always going at the players head.
  18. Preference - Used to determine who the aimbot should target next. Can be set to Distance or Angle.
  19. Attack NPCs - Determines if the aimbot should target NPCs.
  20. Attack Player - Determines if the aimbot should target Players.
  21. Prediction - Velocity prediction, to increase the aimbots accuracy.
  22. Aim On Key - If this is on the aimbot will only target when your selected key is pressed.
  23. Key - Determines the key for the previous option.
  24. Anti Snap - Stops the aimbot from snapping to the target. But will decrease accuracy.
  25. A-Snap Speed - The speed of the anti-snap. Value between 1 and 5.
  26. Max Angle - The maximum angle the target can be away from you. Value between 0-270.
  27. Auto Shoot - If this is on and the aimbot is locked on it will automatically shoot.
  28. Panic Mode - If this is on the aimbot wont function while you are being spectated.
  29. Ignore Team - If this is on the aimbot will not target players on your team, works with TTT if the traitor detector is enabled.
  30. No Spread - The aimbot will compensate for weapon spread. Only works if the no spread module is installed.
  31.  
  32. ESP -
  33. Active - Determines, overall, if the ESP is working.
  34. Player Info - Determines if the ESP should show player information.
  35. NPC Info - Determines if the ESP should show NPC information.
  36. Names - Determines if the targets name should be shown. (on NPCs it will be the class name, ex: npc_monk)
  37. Weapons - Determines if the targets weapon should be displayed
  38. Distance - Determines if distance between you and the target should be displayed.
  39. Health - Determines if the targets health should be displayed.
  40. Bounding Box - Determines if a bounding box should be drawn around the target.
  41. TTT Feature - Show Traitors - Determines if the ESP should display if the target is a traitor. (must have traitor finder active, see Misc)
  42. TTT Feature - Bodies - Will display body information on TTT. (Credits on body, Name of player, Found or not found)
  43. 2D Radar - Enables a 2D radar on screen. Players and NPCs are shown as arrows, bodies (TTT) are shown as circles.
  44. Radar Scale - The distance the radar reaches. Value between 1 and 100
  45. Max Distance - Determines the maximum distance the ESP will work to. (set to 0 for unlimited distance)
  46. Team Based - Make the color of the ESP based on the targets team. Works with TTT.
  47.  
  48. Chams -
  49. Active - Determines, overall, if the Chams are working.
  50. Draw Players - Determines if the Chams should draw players.
  51. Draw NPCs - Determines if the Chams should draw NPCs.
  52. Draw Weapons - Determines if the Chams should draw the targets weapon.
  53. TTT Feature - Bodies - Adds TTT bodies to the Chams
  54. Team Based - Makes the color of the chams based on the targets team. Works with TTT.
  55. Max Distance - Determines the maximum distance the Chams will work to. (set to 0 for unlimited distance)
  56.  
  57. Misc -
  58. Show Admins - Displays all current admins in the top right corner of your screen.
  59. Crosshair - Will draw a crosshair on your screen.
  60. Crosshair Size - The size of the crosshair. Value between 0 and 1000.
  61. No Recoil - Will remove all weapon recoil. (doesn't work in singleplayer)
  62. Spectators - Displays all your current spectators in the top right corner of your screen, under the admins.
  63. Auto Reload - Will automatically reload your weapon when your magazine is empty.
  64. Bunny Hop - If this is on you will bunny hop while pressing the bunny hop key.
  65. Key - Determines the key for the previous option.
  66. Auto Pistol - Fires semi-automatic weapons as fast as possible. (doesn't work on default HL2 weapons)
  67. DarkRP Feature - Buy Health - Will automatically use /buyhealth when your health falls below the minimum value set.
  68. DarkRP Feature - Minimum - Minimum health before buying health. Value between 0 and 100.
  69. TTT Feature - Traitor Finder - Will display when a traitor buys a traitor weapon. (see also the ESP option for displaying traitors)
  70. Show Deaths - Will notify you via chat when a player dies.
  71. Sounds - Enables sound cues along with notifications.
  72.  
  73. Style -
  74. Bounding Box - Determines the color the bounding box should draw in.
  75. ESP Text - Determines the color the ESP text should draw in.
  76. Crosshair - Determines the color the Crosshair should draw in.
  77. TTT Feature - Body Text - Determines the color body information will be shown in.
  78. Chams - The color of the chams. (will be overwritten if Cham option Team Based is on)
  79. TTT Feature - Body Chams - The color TTT bodies should be on the chams.
  80. --]]
  81. //I hear this makes the hack load faster, i didn't actually check the O times but whatever.
  82. local hook = hook
  83. local derma = derma
  84. local surface = surface
  85. local vgui = vgui
  86. local input = input
  87. local util = util
  88. local cam = cam
  89. local render = render
  90. local math = math
  91. local draw = draw
  92. local team = team
  93.  
  94. local AHack = {}
  95. AHack.Active = CreateClientConVar("AHack_Active", 1, true, false)
  96. AHack.Version = "1.4.2"
  97. AHack.Ply = LocalPlayer()
  98. AHack.TTT = (GAMEMODE and GAMEMODE.Name and string.find(GAMEMODE.Name, "Terror") and true) or false
  99. if AHack.TTT then AHack.TTTCORPSE = CORPSE end
  100. AHack.DarkRP = (GAMEMODE and GAMEMODE.Name and string.find(GAMEMODE.Name, "DarkRP") and true) or false
  101.  
  102. //Converts a string of a color (ex. "Color(255, 255, 255, 255)") into an actual color, and returns the color.
  103. AHack.GetColorFromString = function(words)
  104.        //I probably shouldve just used string.explode...well.......
  105.        if type(words) != "string" then return Color(255, 255, 255, 255) end
  106.        words = "return "..words
  107.        local func = CompileString(words, "GettingColors", true)
  108.        local good, color = pcall(func)
  109.        if good and type(color) == "table" and color.r and color.g and color.b and color.a then
  110.                return color
  111.        else
  112.                return Color(255, 255, 255, 255)
  113.        end
  114. end
  115.  
  116. AHack.Chars = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
  117. AHack.RandomName = function(amount)
  118.        local toReturn = ""
  119.        local amount = amount or 10
  120.        for i = 1, amount do
  121.                if math.random(0, 1) == 0 then
  122.                        toReturn = toReturn..string.lower(table.Random(AHack.Chars))
  123.                else
  124.                        toReturn = toReturn..table.Random(AHack.Chars)
  125.                end
  126.        end
  127.        return toReturn
  128. end
  129.  
  130. AHack.Message = function(...)
  131.        chat.AddText(Color(50, 255, 100), "[AHack] ", ...)
  132. end
  133.  
  134. if file.Exists("lua/bin/gmcl_spreadthebutter_win32.dll", "MOD") then
  135.        require("spreadthebutter")
  136.        AHack.NoSpread = true
  137.        AHack.Message("Loaded no spread module.")
  138. else
  139.        AHack.NoSpread = false
  140.        AHack.Message("Could not find no spread module.")
  141. end
  142.  
  143. AHack.Aimbot = {}
  144. AHack.Aimbot.CurTarget = nil
  145. AHack.Aimbot.Vars = {}
  146. AHack.Aimbot.Vars["Active"] = CreateClientConVar("AHack_Aimbot_Active", 0, true, false)
  147. AHack.Aimbot.Vars["RandomBones"] = CreateClientConVar("AHack_Aimbot_RandomBones", 0, true, false)
  148. AHack.Aimbot.Vars["AttackNPCs"] = CreateClientConVar("AHack_Aimbot_AttackNPCs", 0, true, false)
  149. AHack.Aimbot.Vars["AttackPlayers"] = CreateClientConVar("AHack_Aimbot_AttackPlayers", 0, true, false)
  150. AHack.Aimbot.Vars["Prediction"] = CreateClientConVar("AHack_Aimbot_Prediction", 0, true, false)
  151. AHack.Aimbot.Vars["AimOnKey"] = CreateClientConVar("AHack_Aimbot_AimOnKey", 0, true, false)
  152. AHack.Aimbot.Vars["AimOnKey_Key"] = CreateClientConVar("AHack_Aimbot_AimOnKey_Key", "MOUSE_LEFT", true, false)
  153. AHack.Aimbot.Vars["MaxAngle"] = CreateClientConVar("AHack_Aimbot_MaxAngle", 180, true, false)
  154. AHack.Aimbot.Vars["Preferance"] = CreateClientConVar("AHack_Aimbot_Preferance", "Distance", true, false)
  155. AHack.Aimbot.Vars["AntiSnap"] = CreateClientConVar("AHack_Aimbot_AntiSnap", 0, true, false)
  156. AHack.Aimbot.Vars["AntiSnapSpeed"] = CreateClientConVar("AHack_Aimbot_AntiSnapSpeed", 4, true, false)
  157. AHack.Aimbot.Vars["AutoShoot"] = CreateClientConVar("AHack_Aimbot_AutoShoot", 0, true, false)
  158. AHack.Aimbot.Vars["PanicMode"] = CreateClientConVar("AHack_Aimbot_PanicMode", 0, true, false)
  159. AHack.Aimbot.Vars["IgnoreTeam"] = CreateClientConVar("AHack_Aimbot_IgnoreTeam", 0, true, false)
  160. AHack.Aimbot.Vars["NoSpread"] = CreateClientConVar("AHack_Aimbot_NoSpread", 0, true, false)
  161.  
  162. AHack.ESP = {}
  163. AHack.ESP.Vars = {}
  164. AHack.ESP.Vars["Active"] = CreateClientConVar("AHack_ESP_Active", 0, true, false)
  165. AHack.ESP.Vars["Players"] = CreateClientConVar("AHack_ESP_Players", 0, true, false)
  166. AHack.ESP.Vars["NPCs"] = CreateClientConVar("AHack_ESP_NPCs", 0, true, false)
  167. AHack.ESP.Vars["Name"] = CreateClientConVar("AHack_ESP_Name", "Off", true, false)
  168. AHack.ESP.Vars["Weapons"] = CreateClientConVar("AHack_ESP_Weapons", "Off", true, false)
  169. AHack.ESP.Vars["Distance"] = CreateClientConVar("AHack_ESP_Distance", "Off", true, false)
  170. AHack.ESP.Vars["Health"] = CreateClientConVar("AHack_ESP_Health", "Off", true, false)
  171. AHack.ESP.Vars["MaxDistance"] = CreateClientConVar("AHack_ESP_MaxDistance", 0, true, false)
  172. AHack.ESP.Vars["Box"] = CreateClientConVar("AHack_ESP_Box", 0, true, false)
  173. AHack.ESP.Vars["ShowTraitors"] = CreateClientConVar("AHack_ESP_ShowTraitors", "Off", true, false)
  174. AHack.ESP.Vars["Bodies"] = CreateClientConVar("AHack_ESP_Bodies", 0, true, false)
  175. AHack.ESP.Vars["Radar"] = CreateClientConVar("AHack_ESP_Radar", 0, true, false)
  176. AHack.ESP.Vars["RadarScale"] = CreateClientConVar("AHack_ESP_RadarScale", 20, true, false)
  177. AHack.ESP.Vars["TeamBased"] = CreateClientConVar("AHack_ESP_TeamBased", 0, true, false)
  178.  
  179. AHack.Chams = {}
  180. AHack.Chams.Mat = CreateMaterial(AHack.RandomName(math.random(10,15)), "VertexLitGeneric", { ["$basetexture"] = "models/debug/debugwhite", ["$model"] = 1, ["$ignorez"] = 1 })
  181. AHack.Chams.Vars = {}
  182. AHack.Chams.Vars["Active"] = CreateClientConVar("AHack_Chams_Active", 0, true, false)
  183. AHack.Chams.Vars["Players"] = CreateClientConVar("AHack_Chams_Players", 0, true, false)
  184. AHack.Chams.Vars["NPCs"] = CreateClientConVar("AHack_Chams_NPCs", 0, true, false)
  185. AHack.Chams.Vars["Weapons"] = CreateClientConVar("AHack_Chams_Weapons", 0, true, false)
  186. AHack.Chams.Vars["MaxDistance"] = CreateClientConVar("AHack_Chams_MaxDistance", 0, true, false)
  187. AHack.Chams.Vars["Bodies"] = CreateClientConVar("AHack_Chams_Bodies", 0, true, false)
  188. AHack.Chams.Vars["TeamBased"] = CreateClientConVar("AHack_Chams_TeamBased", 0, true, false)
  189.  
  190. AHack.Misc = {}
  191. AHack.Misc.Vars = {}
  192. AHack.Misc.Vars["ShowAdmins"] = CreateClientConVar("AHack_Misc_ShowAdmins", 0, true, false)
  193. AHack.Misc.Vars["Crosshair"] = CreateClientConVar("AHack_Misc_Cross", 0, true, false)
  194. AHack.Misc.Vars["CrosshairSize"] = CreateClientConVar("AHack_Misc_CrossSize", 50, true, false)
  195. AHack.Misc.Vars["NoRecoil"] = CreateClientConVar("AHack_Misc_NoRecoil", 0, true, false)
  196. AHack.Misc.Vars["ShowSpectators"] = CreateClientConVar("AHack_Misc_ShowSpectators", 0, true, false)
  197. AHack.Misc.Vars["BunnyHop"] = CreateClientConVar("AHack_Misc_BunnyHop", 0, true, false)
  198. AHack.Misc.Vars["BunnyHop_Key"] = CreateClientConVar("AHack_Misc_BunnyHop_Key", "KEY_SPACE", true, false)
  199. AHack.Misc.Vars["AutoReload"] = CreateClientConVar("AHack_Misc_AutoReload", 0, true, false)
  200. AHack.Misc.Vars["AutoPistol"] = CreateClientConVar("AHack_Misc_AutoPistol", 0, true, false)
  201. AHack.Misc.Vars["BuyHealth"] = CreateClientConVar("AHack_Misc_BuyHealth", 0, true, false)
  202. AHack.Misc.Vars["BuyHealth_Minimum"] = CreateClientConVar("AHack_Misc_BuyHealth_Minimum", 80, true, false)
  203. AHack.Misc.Vars["TraitorFinder"] = CreateClientConVar("AHack_Misc_TraitorFinder", 0, true, false)
  204. AHack.Misc.Vars["Deaths"] = CreateClientConVar("AHack_Misc_Deaths", 0, true, false)
  205. AHack.Misc.Vars["Sounds"] = CreateClientConVar("AHack_Misc_Sounds", 0, true, false)
  206.  
  207. AHack.Style = {}
  208. AHack.Style.Vars = {}
  209. AHack.Style.Vars["BoundingBox"] = {}
  210. AHack.Style.Vars["BoundingBox"].var = CreateClientConVar("AHack_Style_BoundingBox", "Color(255, 0, 0, 255)", true, false)
  211. AHack.Style.Vars["BoundingBox"].color = AHack.GetColorFromString(AHack.Style.Vars["BoundingBox"].var:GetString())
  212. AHack.Style.Vars["ESPText"] = {}
  213. AHack.Style.Vars["ESPText"].var = CreateClientConVar("AHack_Style_ESPText", "Color(255, 255, 255, 255)", true, false)
  214. AHack.Style.Vars["ESPText"].color = AHack.GetColorFromString(AHack.Style.Vars["ESPText"].var:GetString())
  215. AHack.Style.Vars["Crosshair"] = {}
  216. AHack.Style.Vars["Crosshair"].var = CreateClientConVar("AHack_Style_Cross", "Color(255, 255, 255, 255)", true, false)
  217. AHack.Style.Vars["Crosshair"].color = AHack.GetColorFromString(AHack.Style.Vars["Crosshair"].var:GetString())
  218. AHack.Style.Vars["BodyText"] = {}
  219. AHack.Style.Vars["BodyText"].var = CreateClientConVar("AHack_Style_BodyText", "Color(255, 255, 255, 255)", true, false)
  220. AHack.Style.Vars["BodyText"].color = AHack.GetColorFromString(AHack.Style.Vars["BodyText"].var:GetString())
  221. AHack.Style.Vars["Chams"] = {}
  222. AHack.Style.Vars["Chams"].var = CreateClientConVar("AHack_Style_Chams", "Color(0, 255, 0, 255)", true, false)
  223. AHack.Style.Vars["Chams"].color = AHack.GetColorFromString(AHack.Style.Vars["Chams"].var:GetString())
  224. AHack.Style.Vars["BodyChams"] = {}
  225. AHack.Style.Vars["BodyChams"].var = CreateClientConVar("AHack_Style_BodyChams", "Color(0, 255, 0, 255)", true, false)
  226. AHack.Style.Vars["BodyChams"].color = AHack.GetColorFromString(AHack.Style.Vars["BodyChams"].var:GetString())
  227.  
  228. //This is all the bones i look for in the order im looking for them. Feel free to change the order if you want to attack the foot before the head or something like that.
  229. AHack.Bones = {
  230. "ValveBiped.Bip01_Head1",
  231. "ValveBiped.Bip01_Neck1",
  232. "ValveBiped.Bip01_Spine4",
  233. "ValveBiped.Bip01_Spine2",
  234. "ValveBiped.Bip01_Spine1",
  235. "ValveBiped.Bip01_Spine",
  236. "ValveBiped.Bip01_R_UpperArm",
  237. "ValveBiped.Bip01_R_Forearm",
  238. "ValveBiped.Bip01_R_Hand",
  239. "ValveBiped.Bip01_L_UpperArm",
  240. "ValveBiped.Bip01_L_Forearm",
  241. "ValveBiped.Bip01_L_Hand",
  242. "ValveBiped.Bip01_R_Thigh",
  243. "ValveBiped.Bip01_R_Calf",
  244. "ValveBiped.Bip01_R_Foot",
  245. "ValveBiped.Bip01_R_Toe0",
  246. "ValveBiped.Bip01_L_Thigh",
  247. "ValveBiped.Bip01_L_Calf",
  248. "ValveBiped.Bip01_L_Foot",
  249. "ValveBiped.Bip01_L_Toe0"
  250. }
  251.  
  252. //If random bones is enabled this list is gone through, randomly, and if none of the bones on this list are found the entire list (above) is gone through.
  253. //If you edit this be sure to edit the function below it.
  254. AHack.RandomBones = {
  255. "ValveBiped.Bip01_Head1",
  256. "ValveBiped.Bip01_Neck1",
  257. "ValveBiped.Bip01_Spine4",
  258. "ValveBiped.Bip01_Spine2",
  259. "ValveBiped.Bip01_R_UpperArm",
  260. "ValveBiped.Bip01_L_UpperArm"
  261. }
  262. AHack.GetRandomBones = function()
  263.        local temp = {}
  264.        local function GetBones() //Ahh recursion, i love you.
  265.                if #AHack.RandomBones > 0 then
  266.                        local random = math.random(1, #AHack.RandomBones)
  267.                        table.insert(temp, AHack.RandomBones[random])
  268.                        table.remove(AHack.RandomBones, random)
  269.                        GetBones()
  270.                else
  271.                        table.insert(AHack.RandomBones, "ValveBiped.Bip01_Head1")
  272.                        table.insert(AHack.RandomBones, "ValveBiped.Bip01_Neck1")
  273.                        table.insert(AHack.RandomBones, "ValveBiped.Bip01_Spine4")
  274.                        table.insert(AHack.RandomBones, "ValveBiped.Bip01_Spine2")
  275.                        table.insert(AHack.RandomBones, "ValveBiped.Bip01_R_UpperArm")
  276.                        table.insert(AHack.RandomBones, "ValveBiped.Bip01_L_UpperArm")
  277.                end
  278.        end
  279.        GetBones()
  280.        return temp
  281. end
  282.  
  283. //A list of all keyboard keys, for binding
  284. AHack.Keys = {
  285. [0] = "KEY_NONE",
  286. [1] = "KEY_0",
  287. [2] = "KEY_1",
  288. [3] = "KEY_2",
  289. [4] = "KEY_3",
  290. [5] = "KEY_4",
  291. [6] = "KEY_5",
  292. [7] = "KEY_6",
  293. [8] = "KEY_7",
  294. [9] = "KEY_8",
  295. [10] = "KEY_9",
  296. [11] = "KEY_A",
  297. [12] = "KEY_B",
  298. [13] = "KEY_C",
  299. [14] = "KEY_D",
  300. [15] = "KEY_E",
  301. [16] = "KEY_F",
  302. [17] = "KEY_G",
  303. [18] = "KEY_H",
  304. [19] = "KEY_I",
  305. [20] = "KEY_J",
  306. [21] = "KEY_K",
  307. [22] = "KEY_L",
  308. [23] = "KEY_M",
  309. [24] = "KEY_N",
  310. [25] = "KEY_O",
  311. [26] = "KEY_P",
  312. [27] = "KEY_Q",
  313. [28] = "KEY_R",
  314. [29] = "KEY_S",
  315. [30] = "KEY_T",
  316. [31] = "KEY_U",
  317. [32] = "KEY_V",
  318. [33] = "KEY_W",
  319. [34] = "KEY_X",
  320. [35] = "KEY_Y",
  321. [36] = "KEY_Z",
  322. [37] = "KEY_PAD_0",
  323. [38] = "KEY_PAD_1",
  324. [39] = "KEY_PAD_2",
  325. [40] = "KEY_PAD_3",
  326. [41] = "KEY_PAD_4",
  327. [42] = "KEY_PAD_5",
  328. [43] = "KEY_PAD_6",
  329. [44] = "KEY_PAD_7",
  330. [45] = "KEY_PAD_8",
  331. [46] = "KEY_PAD_9",
  332. [47] = "KEY_PAD_DIVIDE",
  333. [48] = "KEY_PAD_MULTIPLY",
  334. [49] = "KEY_PAD_MINUS",
  335. [50] = "KEY_PAD_PLUS",
  336. [51] = "KEY_PAD_ENTER",
  337. [52] = "KEY_PAD_DECIMAL",
  338. [53] = "KEY_LBRACKET",
  339. [54] = "KEY_RBRACKET",
  340. [55] = "KEY_SEMICOLON",
  341. [56] = "KEY_APOSTROPHE",
  342. [57] = "KEY_BACKQUOTE",
  343. [58] = "KEY_COMMA",
  344. [59] = "KEY_PERIOD",
  345. [60] = "KEY_SLASH",
  346. [61] = "KEY_BACKSLASH",
  347. [62] = "KEY_MINUS",
  348. [63] = "KEY_EQUAL",
  349. [64] = "KEY_ENTER",
  350. [65] = "KEY_SPACE",
  351. [66] = "KEY_BACKSPACE",
  352. [67] = "KEY_TAB",
  353. [68] = "KEY_CAPSLOCK",
  354. [69] = "KEY_NUMLOCK",
  355. [70] = "KEY_ESCAPE",
  356. [71] = "KEY_SCROLLLOCK",
  357. [72] = "KEY_INSERT",
  358. [73] = "KEY_DELETE",
  359. [74] = "KEY_HOME",
  360. [75] = "KEY_END",
  361. [76] = "KEY_PAGEUP",
  362. [77] = "KEY_PAGEDOWN",
  363. [78] = "KEY_BREAK",
  364. [79] = "KEY_LSHIFT",
  365. [80] = "KEY_RSHIFT",
  366. [81] = "KEY_LALT",
  367. [82] = "KEY_RALT",
  368. [83] = "KEY_LCONTROL",
  369. [84] = "KEY_RCONTROL",
  370. [85] = "KEY_LWIN",
  371. [86] = "KEY_RWIN",
  372. [87] = "KEY_APP",
  373. [88] = "KEY_UP",
  374. [89] = "KEY_LEFT",
  375. [90] = "KEY_DOWN",
  376. [91] = "KEY_RIGHT",
  377. [92] = "KEY_F1",
  378. [93] = "KEY_F2",
  379. [94] = "KEY_F3",
  380. [95] = "KEY_F4",
  381. [96] = "KEY_F5",
  382. [97] = "KEY_F6",
  383. [98] = "KEY_F7",
  384. [99] = "KEY_F8",
  385. [100] = "KEY_F9",
  386. [101] = "KEY_F10",
  387. [102] = "KEY_F11",
  388. [103] = "KEY_F12",
  389. //[104] = "KEY_CAPSLOCKTOGGLE", //THESE
  390. //[105] = "KEY_NUMLOCKTOGGLE", //MOFOS
  391. //[106] = "KEY_SCROLLLOCKTOGGLE", //SHOULD DIE
  392. [107] = "KEY_XBUTTON_UP",
  393. [108] = "KEY_XBUTTON_DOWN",
  394. [109] = "KEY_XBUTTON_LEFT",
  395. [110] = "KEY_XBUTTON_RIGHT",
  396. [111] = "KEY_XBUTTON_START",
  397. [112] = "KEY_XBUTTON_BACK",
  398. [113] = "KEY_XBUTTON_STICK1",
  399. [114] = "KEY_XBUTTON_STICK2",
  400. [115] = "KEY_XBUTTON_A",
  401. [116] = "KEY_XBUTTON_B",
  402. [117] = "KEY_XBUTTON_X",
  403. [118] = "KEY_XBUTTON_Y",
  404. [119] = "KEY_XBUTTON_BLACK",
  405. [120] = "KEY_XBUTTON_WHITE",
  406. [121] = "KEY_XBUTTON_LTRIGGER",
  407. [122] = "KEY_XBUTTON_RTRIGGER",
  408. [123] = "KEY_XSTICK1_UP",
  409. [124] = "KEY_XSTICK1_DOWN",
  410. [125] = "KEY_XSTICK1_LEFT",
  411. [126] = "KEY_XSTICK1_RIGHT",
  412. [127] = "KEY_XSTICK2_UP",
  413. [128] = "KEY_XSTICK2_DOWN",
  414. [129] = "KEY_XSTICK2_LEFT",
  415. [130] = "KEY_XSTICK2_RIGHT"
  416. }
  417. //A list of all mouse keys, for binding
  418. AHack.MouseKeys = {
  419. [107] = "MOUSE_LEFT",
  420. [108] = "MOUSE_RIGHT",
  421. [109] = "MOUSE_MIDDLE",
  422. [110] = "MOUSE_4",
  423. [111] = "MOUSE_5"
  424. }
  425. //Tells me if a specific key is pressed. Loops through both tables.
  426. AHack.KeyPressed = function(key)
  427.        if AHack.InChat then return false end
  428.      
  429.        for k = 107, 111 do
  430.                if key == AHack.MouseKeys[k] then
  431.                        if input.IsMouseDown(k) then
  432.                                return true
  433.                        else
  434.                                return false
  435.                        end
  436.                end
  437.        end
  438.      
  439.        for k = 0, 130 do
  440.                if key == AHack.Keys[k] then
  441.                        if input.IsKeyDown(k) then
  442.                                return true
  443.                        else
  444.                                return false
  445.                        end
  446.                end
  447.        end
  448.      
  449.        return false
  450. end
  451.  
  452. //Very simple. If the boolean is true it returns 1. If the boolean is false then it returns 0. I dont think i ended up using this anywhere, but whatever, ill leave it here.
  453. AHack.BoolToInt = function(bool)
  454.        if bool then
  455.                return 1
  456.        else
  457.                return 0
  458.        end
  459. end
  460.  
  461. //Checking if a bone is visible, pos is the position of the bone and ent is the entity whos bone were looking for.
  462. AHack.BoneIsVisible = function(pos, ent)
  463.        ent = ent or AHack.Aimbot.CurTarget
  464.        local tracedata = {}
  465.        tracedata.start = AHack.Ply:GetShootPos()
  466.        tracedata.endpos = pos
  467.        tracedata.filter = {AHack.Ply, ent}
  468.      
  469.        local trace = util.TraceLine(tracedata)
  470.        if trace.HitPos:Distance(pos) < 0.005 then
  471.                return true
  472.        else
  473.                return false
  474.        end
  475. end
  476.  
  477. //Checks all of the entities bones to find if we can see this entity or not.
  478. AHack.CanSee = function(ent)
  479.        for k = 1, #AHack.Bones do
  480.                local v = AHack.Bones[k]
  481.                local bone = ent:LookupBone(v)
  482.                if bone != nil then
  483.                        local pos, ang = ent:GetBonePosition(bone)
  484.                        if AHack.BoneIsVisible(pos, ent) then
  485.                                return true
  486.                        end
  487.                end
  488.        end
  489.        return false
  490. end
  491.  
  492. //This returns the next entity we should attack.
  493. AHack.GetTarget = function()
  494.        if AHack.Aimbot.Vars["AttackNPCs"]:GetBool() or AHack.Aimbot.Vars["AttackPlayers"]:GetBool() then
  495.                local targets = {}
  496.                local everything = ents.GetAll()
  497.                for k = 1, #everything do
  498.                        local v = everything[k]
  499.                        if AHack.Aimbot.Vars["AttackNPCs"]:GetBool() and v:IsNPC() then
  500.                                if AHack.CanSee(v) then
  501.                                        table.insert(targets, {["Target"] = v, ["Pos"] = v:LocalToWorld(v:OBBCenter())})
  502.                                end
  503.                        elseif AHack.Aimbot.Vars["AttackPlayers"]:GetBool() and v:IsPlayer() and v != AHack.Ply then
  504.                                if AHack.CanSee(v) then
  505.                                        table.insert(targets, {["Target"] = v, ["Pos"] = v:LocalToWorld(v:OBBCenter())})
  506.                                end
  507.                        end
  508.                end
  509.              
  510.                for k,v in pairs(targets) do
  511.                        local v = v["Target"]
  512.                        if AHack.Aimbot.Vars["IgnoreTeam"]:GetBool() and v:IsPlayer() then
  513.                                if AHack.TTT then
  514.                                        if AHack.Ply:GetRole() == 1 and v:GetRole() == 1 then
  515.                                                table.remove(targets, k)
  516.                                        end
  517.                                              
  518.                                        if AHack.Ply:GetRole() != 1 and not table.HasValue(AHack.Traitors, v) then
  519.                                                table.remove(targets, k)
  520.                                        end
  521.                                else
  522.                                        if v:Team() == AHack.Ply:Team() then
  523.                                                table.remove(targets, k)
  524.                                        end
  525.                                end
  526.                        end
  527.                end
  528.              
  529.                if #targets == 0 then
  530.                        return nil
  531.                elseif #targets == 1 then
  532.                        targets[1]["Target"].BoneToAimAt = nil
  533.                        return targets[1]["Target"]
  534.                end
  535.              
  536.                if AHack.Aimbot.Vars["Preferance"]:GetString() == "Distance" then
  537.                        local min = {["Distance"] = AHack.Ply:GetPos():Distance(targets[1]["Pos"]), ["Target"] = targets[1]["Target"]}
  538.                        for k = 1, #targets do
  539.                                local v = targets[k]
  540.                              
  541.                                local distance = AHack.Ply:GetPos():Distance(v["Pos"])
  542.                                if distance < min["Distance"] then
  543.                                        min = {["Distance"] = distance, ["Target"] = v["Target"]}
  544.                                end
  545.                        end
  546.                        min["Target"].BoneToAimAt = nil
  547.                        return min["Target"]
  548.                elseif AHack.Aimbot.Vars["Preferance"]:GetString() == "Angle" then            
  549.                        local min = {["Angle"] = AHack.AngleTo(targets[1]["Pos"]), ["Target"] = targets[1]["Target"]}
  550.                        for k = 1, #targets do
  551.                                local v = targets[k]
  552.                              
  553.                                local angle = AHack.AngleTo(v["Pos"])
  554.                                if angle < min["Angle"] then
  555.                                        min = {["Angle"] = angle, ["Target"] = v["Target"]}
  556.                                end
  557.                        end
  558.                        min["Target"].BoneToAimAt = nil
  559.                        return min["Target"]
  560.                end
  561.        else
  562.                return nil
  563.        end
  564. end
  565.  
  566. //This returns the total angle away from the target we are, and then the pitch and yaw seperately
  567. AHack.AngleTo = function(pos)
  568.        local myAngs = AHack.Ply:GetAngles()
  569.        local needed = (pos - AHack.Ply:GetShootPos()):Angle()
  570.      
  571.        myAngs.p = math.NormalizeAngle(myAngs.p)
  572.        needed.p = math.NormalizeAngle(needed.p)
  573.      
  574.        myAngs.y = math.NormalizeAngle(myAngs.y)
  575.        needed.y = math.NormalizeAngle(needed.y)
  576.      
  577.        local p = math.NormalizeAngle(needed.p - myAngs.p)
  578.        local y = math.NormalizeAngle(needed.y - myAngs.y)
  579.      
  580.        return math.abs(p) + math.abs(y), {p = p, y = y}
  581. end
  582.  
  583. //Returns true if our target meets our preferances.
  584. AHack.ValidTarget = function()
  585.        if AHack.Aimbot.CurTarget == nil then return false end
  586.        if not IsValid(AHack.Aimbot.CurTarget) then return false end
  587.        if AHack.Aimbot.CurTarget:IsPlayer() and (not AHack.Aimbot.CurTarget:Alive() or AHack.Aimbot.CurTarget:Team() == TEAM_SPECTATOR or AHack.Aimbot.CurTarget:Health() < 1) then return false end
  588.        if not AHack.Aimbot.Vars["AttackNPCs"]:GetBool() and AHack.Aimbot.CurTarget:IsNPC() then return false end
  589.        if not AHack.Aimbot.Vars["AttackPlayers"]:GetBool() and AHack.Aimbot.CurTarget:IsPlayer() then return false end
  590.        if not AHack.CanSee(AHack.Aimbot.CurTarget) then return false end
  591.        if AHack.Aimbot.Vars["IgnoreTeam"]:GetBool() and AHack.Aimbot.CurTarget:IsPlayer() then
  592.                if AHack.TTT then
  593.                        if AHack.Ply:GetRole() == 1 and AHack.Aimbot.CurTarget:GetRole() == 1 then return false end                            
  594.                        if AHack.Ply:GetRole() != 1 and not table.HasValue(AHack.Traitors, AHack.Aimbot.CurTarget) then return false end
  595.                else
  596.                        if AHack.Aimbot.CurTarget:Team() == AHack.Ply:Team() then return false end
  597.                end
  598.        end
  599.      
  600.        return true
  601. end
  602.  
  603. hook.Add("RenderScreenspaceEffects", AHack.RandomName(math.random(10, 15)), function()
  604.        if AHack.Active:GetBool() then
  605.                local everything = ents.GetAll()
  606.                for k = 1, #everything do
  607.                        local v = everything[k]
  608.                      
  609.                        if AHack.Chams.Vars["Active"]:GetBool() and v != AHack.Ply and (AHack.Chams.Vars["MaxDistance"]:GetInt() == 0 or v:GetPos():Distance(AHack.Ply:GetPos()) < AHack.Chams.Vars["MaxDistance"]:GetInt()) then
  610.                                if (v:IsPlayer() and v:Alive() and v:Team() != TEAM_SPECTATOR and AHack.Chams.Vars["Players"]:GetBool()) or (v:IsNPC() and v:Health() > 0 and AHack.Chams.Vars["NPCs"]:GetBool()) then
  611.                                        local color = AHack.Style.Vars["Chams"].color
  612.                                        if AHack.Chams.Vars["TeamBased"]:GetBool() and v:IsPlayer() then
  613.                                                color = team.GetColor(v:Team())
  614.                                                if AHack.TTT then
  615.                                                        if v:GetRole() == 2 then
  616.                                                                color = Color(0, 0, 255, 255)
  617.                                                        elseif table.HasValue(AHack.Traitors, v) then
  618.                                                                color = Color(255, 0, 0, 255)
  619.                                                        else
  620.                                                                color = Color(0, 255, 0, 255)
  621.                                                        end
  622.                                                end
  623.                                        end
  624.                                        cam.Start3D(EyePos(), EyeAngles())
  625.                                                render.SuppressEngineLighting(true)
  626.                                                render.SetColorModulation(color.r/255, color.g/255, color.b/255, 1)
  627.                                                render.MaterialOverride(AHack.Chams.Mat)
  628.                                                v:DrawModel()
  629.                                              
  630.                                                render.SetColorModulation((color.r + 150)/250, (color.g + 150)/250, (color.b + 150)/255, 1)                                            
  631.                                                if IsValid(v:GetActiveWeapon()) and AHack.Chams.Vars["Weapons"]:GetBool() then
  632.                                                        v:GetActiveWeapon():DrawModel()
  633.                                                end
  634.                                              
  635.                                                render.SetColorModulation(1, 1, 1, 1)
  636.                                                render.MaterialOverride()
  637.                                                render.SetModelLighting(4, color.r/255, color.g/255, color.b/255)
  638.                                                v:DrawModel()
  639.                                                render.SuppressEngineLighting( false )
  640.                                        cam.End3D();
  641.                                elseif AHack.TTT and AHack.Chams.Vars["Bodies"]:GetBool() and v:GetClass() == "prop_ragdoll" then
  642.                                        local color = AHack.Style.Vars["BodyChams"].color
  643.                                        cam.Start3D(EyePos(), EyeAngles())
  644.                                                render.SuppressEngineLighting(true)    
  645.                                                render.SetColorModulation(color.r/255, color.g/255, color.b/255, 1)
  646.                                                render.MaterialOverride(AHack.Chams.Mat)
  647.                                                v:DrawModel()  
  648.                                                render.SetColorModulation(1, 1, 1, 1)
  649.                                                render.MaterialOverride()
  650.                                                render.SetModelLighting( 4, color.r/255, color.g/255, color.b/255 )
  651.                                                v:DrawModel()
  652.                                                render.SuppressEngineLighting(false)
  653.                                        cam.End3D()
  654.                                end
  655.                        end
  656.                end
  657.        end
  658. end)
  659.  
  660. //Helper function on radar. I just copied this one from the wiki.
  661. AHack.DrawFilledCircle = function(x, y, radius, quality)
  662.        local circle = {}
  663.    local tmp = 0
  664.    for i = 1, quality do
  665.        tmp = math.rad(i * 360) / quality
  666.        circle[i] = {x = x + math.cos(tmp) * radius, y = y + math.sin(tmp) * radius}
  667.    end
  668.        surface.DrawPoly(circle)
  669. end
  670.  
  671. //Another helper fuction on the radar.
  672. AHack.DrawArrow = function(x, y, myRotation)
  673.        local arrow = {}      
  674.        arrow[1] = {x = x, y = y}
  675.        arrow[2] = {x = x + 4, y = y + 7.5}
  676.        arrow[3] = {x = x, y = y + 5}
  677.        arrow[4] = {x = x - 4, y = y + 7.5}
  678.      
  679.        //Now that i have the arrow determined, i have to rotate it to match the targets angle
  680.        myRotation = myRotation * -1
  681.        myRotation = math.rad(myRotation)
  682.        for i = 1, 4 do
  683.                local theirX = arrow[i].x
  684.                local theirY = arrow[i].y
  685.              
  686.                theirX = theirX - x
  687.                theirY = theirY - y
  688.              
  689.                arrow[i].x = theirX * math.cos(myRotation) - theirY * math.sin(myRotation)
  690.                arrow[i].y = theirX * math.sin(myRotation) + theirY * math.cos(myRotation)
  691.              
  692.                arrow[i].x = arrow[i].x + x
  693.                arrow[i].y = arrow[i].y + y
  694.        end
  695.  
  696.        surface.DrawPoly(arrow)
  697. end
  698.  
  699. AHack.Traitors = {}
  700. AHack.SuperAdmins = {}
  701. AHack.Admins = {}
  702. AHack.Spectators = {}
  703. local radarX, radarY, radarWidth, radarHeight = 100, 200, 150, 150
  704. hook.Add("HUDPaint", AHack.RandomName(math.random(10, 15)), function()
  705.        if AHack.Active:GetBool() then
  706.                local everything = ents.GetAll()
  707.              
  708.                if AHack.ESP.Vars["Active"]:GetBool() and AHack.ESP.Vars["Radar"]:GetBool() then //Setting up the background here. And since the ESP doesnt draw you
  709.                        draw.RoundedBox(0, radarX, radarY, radarWidth, radarHeight, Color(100, 100, 100, 255 ))
  710.                        draw.NoTexture()
  711.                        if AHack.ESP.Vars["TeamBased"]:GetBool() then
  712.                                local color = team.GetColor(AHack.Ply:Team())
  713.                                if AHack.TTT then
  714.                                        if AHack.Ply:GetRole() == 2 then
  715.                                                color = Color(0, 0, 255, 255)
  716.                                        elseif AHack.Ply:GetRole() == 1 then
  717.                                                color = Color(255, 0, 0, 255)
  718.                                        else
  719.                                                color = Color(0, 255, 0, 255)
  720.                                        end
  721.                                end
  722.                                surface.SetDrawColor(color)
  723.                        else
  724.                                surface.SetDrawColor(AHack.Style.Vars["ESPText"].color)
  725.                        end
  726.                        AHack.DrawArrow(radarX + (radarWidth / 2), radarY + (radarHeight / 2), 0)
  727.                end
  728.              
  729.                for k = 1, #everything do
  730.                        local v = everything[k]
  731.              
  732.                        if AHack.ESP.Vars["Active"]:GetBool() and v != AHack.Ply and (AHack.ESP.Vars["MaxDistance"]:GetInt() == 0 or v:GetPos():Distance(AHack.Ply:GetPos()) < AHack.ESP.Vars["MaxDistance"]:GetInt()) then                                                                            
  733.                                if (v:IsPlayer() and v:Alive() and v:Team() != TEAM_SPECTATOR and AHack.ESP.Vars["Players"]:GetBool()) or (v:IsNPC() and v:Health() > 0 and AHack.ESP.Vars["NPCs"]:GetBool()) then
  734.                                        local color = AHack.Style.Vars["ESPText"].color
  735.                                        if AHack.ESP.Vars["TeamBased"]:GetBool() and v:IsPlayer() then
  736.                                                color = team.GetColor(v:Team())
  737.                                                if AHack.TTT then
  738.                                                        if v:GetRole() == 2 then
  739.                                                                color = Color(0, 0, 255, 255)
  740.                                                        elseif table.HasValue(AHack.Traitors, v) then
  741.                                                                color = Color(255, 0, 0, 255)
  742.                                                        else
  743.                                                                color = Color(0, 255, 0, 255)
  744.                                                        end
  745.                                                end
  746.                                        end
  747.                                      
  748.                                        local Min, Max = v:GetCollisionBounds()
  749.                                        if AHack.ESP.Vars["Box"]:GetBool() then
  750.                                                local one = v:LocalToWorld(Min):ToScreen()
  751.                                                local two = v:LocalToWorld(Vector(Min.x, Min.y, Max.z)):ToScreen()
  752.                                                local three = v:LocalToWorld(Vector(Min.x, Min.y + (Max.y * 2), Min.z)):ToScreen()
  753.                                                local four = v:LocalToWorld(Vector(Min.x + (Max.x * 2), Min.y, Min.z)):ToScreen()
  754.                                                local five = v:LocalToWorld(Max):ToScreen()
  755.                                                local six = v:LocalToWorld(Vector(Max.x, Max.y, Min.z)):ToScreen()
  756.                                                local seven = v:LocalToWorld(Vector(Max.x, Max.y + (Min.y * 2), Max.z)):ToScreen()
  757.                                                local eight = v:LocalToWorld(Vector(Max.x + (Min.x * 2), Max.y, Max.z)):ToScreen()                            
  758.                                              
  759.                                                if AHack.ESP.Vars["TeamBased"]:GetBool() then
  760.                                                        surface.SetDrawColor(color)
  761.                                                else
  762.                                                        surface.SetDrawColor(AHack.Style.Vars["BoundingBox"].color)
  763.                                                end
  764.                                                local function connect(tabone, tabtwo)
  765.                                                        surface.DrawLine(tabone.x, tabone.y, tabtwo.x, tabtwo.y)
  766.                                                end
  767.                                              
  768.                                                connect(one, two)
  769.                                                connect(three, eight)
  770.                                                connect(four, seven)
  771.                                                connect(six, five)
  772.                                                connect(four, six)
  773.                                                connect(four, one)
  774.                                                connect(one, three)
  775.                                                connect(three, six)
  776.                                                connect(five, eight)
  777.                                                connect(eight, two)
  778.                                                connect(two, seven)
  779.                                                connect(seven, five)
  780.                                        end
  781.                                      
  782.                                        surface.SetFont("ESPFont")
  783.                                        local top = v:GetPos() + Vector(0, 0, Max.z + 10) // A little above their head so its not constantly covering their face.
  784.                                        local topscreen = top:ToScreen()
  785.                                        local topy = topscreen.y
  786.                                      
  787.                                        local bottom = v:GetPos()
  788.                                        local bottomscreen = bottom:ToScreen()
  789.                                        local bottomy = bottomscreen.y
  790.                                      
  791.                                        local function DrawAbove(text)
  792.                                                local W, H = surface.GetTextSize(text)
  793.                                                surface.SetTextPos(topscreen.x - W / 2, topy)
  794.                                                surface.DrawText(text)
  795.                                              
  796.                                                topy = topy + H
  797.                                        end
  798.                                      
  799.                                        local function DrawBelow(text)
  800.                                                local W, H = surface.GetTextSize(text)
  801.                                                surface.SetTextPos(bottomscreen.x - W / 2, bottomy)
  802.                                                surface.DrawText(text)
  803.                                              
  804.                                                bottomy = bottomy + H
  805.                                        end
  806.                                      
  807.                                        surface.SetTextColor(Color(255, 0, 0, 255))
  808.                                        if AHack.ESP.Vars["ShowTraitors"]:GetString() != "Off" and table.HasValue(AHack.Traitors, v) then
  809.                                                if AHack.ESP.Vars["ShowTraitors"]:GetString() == "Above" then
  810.                                                        DrawAbove("Traitor")
  811.                                                else
  812.                                                        DrawBelow("Traitor")
  813.                                                end
  814.                                        end
  815.                                      
  816.                                        surface.SetTextColor(color)
  817.                                        if v:IsPlayer() then
  818.                                                if AHack.ESP.Vars["Name"]:GetString() == "Above" then
  819.                                                        DrawAbove("Name: "..v:Nick())
  820.                                                elseif AHack.ESP.Vars["Name"]:GetString() == "Below" then
  821.                                                        DrawBelow("Name: "..v:Nick())
  822.                                                end
  823.                                        else
  824.                                                if AHack.ESP.Vars["Name"]:GetString() == "Above" then
  825.                                                        DrawAbove("Name: "..v:GetClass())
  826.                                                elseif AHack.ESP.Vars["Name"]:GetString() == "Below" then
  827.                                                        DrawBelow("Name: "..v:GetClass())
  828.                                                end
  829.                                        end
  830.                                      
  831.                                        if AHack.ESP.Vars["Weapons"]:GetString() == "Above" and IsValid(v:GetActiveWeapon()) then
  832.                                                DrawAbove("Weapon: "..v:GetActiveWeapon():GetClass())
  833.                                        elseif AHack.ESP.Vars["Weapons"]:GetString() == "Below" and IsValid(v:GetActiveWeapon()) then
  834.                                                DrawBelow("Weapon: "..v:GetActiveWeapon():GetClass())
  835.                                        end            
  836.                                      
  837.                                        if AHack.ESP.Vars["Distance"]:GetString() == "Above" then
  838.                                                DrawAbove("Distance: "..bottom:Distance(AHack.Ply:GetPos()))
  839.                                        elseif AHack.ESP.Vars["Distance"]:GetString() == "Below" then
  840.                                                DrawBelow("Distance: "..bottom:Distance(AHack.Ply:GetPos()))
  841.                                        end    
  842.                                      
  843.                                        if AHack.ESP.Vars["Health"]:GetString() == "Above" then
  844.                                                DrawAbove("HP: "..v:Health())
  845.                                        elseif AHack.ESP.Vars["Health"]:GetString() == "Below" then
  846.                                                DrawBelow("HP: "..v:Health())
  847.                                        end
  848.                                      
  849.                                        if AHack.ESP.Vars["Radar"]:GetBool() then
  850.                                                surface.SetDrawColor(color)
  851.                                                local myPos = AHack.Ply:GetPos()
  852.                                                local theirPos = v:GetPos()
  853.                                                local myAngles = AHack.Ply:GetAngles()
  854.                                              
  855.                                                local theirX = (radarX + (radarWidth / 2)) + ((theirPos.x - myPos.x) / AHack.ESP.Vars["RadarScale"]:GetInt())
  856.                                                local theirY = (radarY + (radarHeight / 2)) + ((myPos.y - theirPos.y) / AHack.ESP.Vars["RadarScale"]:GetInt())
  857.                                              
  858.                                                //Now i have to rotate this
  859.                                                local myRotation = myAngles.y - 90
  860.                                                myRotation = math.rad(myRotation)
  861.                                              
  862.                                                theirX = theirX - (radarX + (radarWidth / 2))
  863.                                                theirY = theirY - (radarY + (radarHeight / 2))
  864.                                                local newX = theirX * math.cos(myRotation) - theirY * math.sin(myRotation)
  865.                                                local newY = theirX * math.sin(myRotation) + theirY * math.cos(myRotation)
  866.                                                newX = newX + (radarX + (radarWidth / 2))
  867.                                                newY = newY + (radarY + (radarHeight / 2))
  868.                                              
  869.                                                //And now that its rotated i can check if its within our radars bounds and draw it
  870.                                                if newX < (radarX + radarWidth) and newX > radarX and newY < (radarY + radarHeight) and newY > radarY then
  871.                                                        AHack.DrawArrow(newX, newY, v:EyeAngles().y - myAngles.y)
  872.                                                end
  873.                                        end
  874.                                elseif AHack.TTT and AHack.ESP.Vars["Bodies"]:GetBool() and v:GetClass() == "prop_ragdoll" then
  875.                                        surface.SetFont("ESPFont")
  876.                                      
  877.                                        //Im just going to position this info at the center of the player, if i get any complaints ill change it
  878.                                        local pos = v:LocalToWorld(v:OBBCenter())
  879.                                        local poscreen = pos:ToScreen()
  880.                                        local W, H = surface.GetTextSize("Sample") //It doesnt have to be perfect but this will help center the text more.
  881.                                        local y = poscreen.y - (H * 1.5)
  882.                                      
  883.                                        local function DrawText(text)
  884.                                                local W, H = surface.GetTextSize(text)
  885.                                                surface.SetTextPos(poscreen.x - W / 2, y)
  886.                                                surface.DrawText(text)
  887.                                              
  888.                                                y = y + H
  889.                                        end
  890.                                      
  891.                                        surface.SetTextColor(AHack.Style.Vars["BodyText"].color)
  892.                                        DrawText("Credits: "..AHack.TTTCORPSE.GetCredits(v, 0))
  893.                                        DrawText("Name: "..AHack.TTTCORPSE.GetPlayerNick(v, "Unknown"))
  894.                                        DrawText("Found: "..tostring(AHack.TTTCORPSE.GetFound(v, false)))
  895.                                      
  896.                                        if AHack.ESP.Vars["Radar"] then
  897.                                                surface.SetDrawColor(AHack.Style.Vars["BodyText"].color)
  898.                                                local myPos = AHack.Ply:GetPos()
  899.                                                local theirPos = v:GetPos()
  900.                                              
  901.                                                local theirX = (radarX + (radarWidth / 2)) + ((theirPos.x - myPos.x) / AHack.ESP.Vars["RadarScale"]:GetInt())
  902.                                                local theirY = (radarY + (radarHeight / 2)) + ((myPos.y - theirPos.y) / AHack.ESP.Vars["RadarScale"]:GetInt())
  903.                                              
  904.                                                //Now i have to rotate this
  905.                                                local myRotation = AHack.Ply:GetAngles().y - 90
  906.                                                myRotation = math.rad(myRotation)
  907.                                              
  908.                                                theirX = theirX - (radarX + (radarWidth / 2))
  909.                                                theirY = theirY - (radarY + (radarHeight / 2))
  910.                                                local newX = theirX * math.cos(myRotation) - theirY * math.sin(myRotation)
  911.                                                local newY = theirX * math.sin(myRotation) + theirY * math.cos(myRotation)
  912.                                                newX = newX + (radarX + (radarWidth / 2))
  913.                                                newY = newY + (radarY + (radarHeight / 2))
  914.                                              
  915.                                                //And now that its rotated i can check if its within our radars bounds and draw it
  916.                                                if newX < (radarX + radarWidth) and newX > radarX and newY < (radarY + radarHeight) and newY > radarY then
  917.                                                        AHack.DrawFilledCircle(newX, newY, 2, 4)
  918.                                                end
  919.                                        end
  920.                                end
  921.                        end
  922.                      
  923.                        surface.SetFont("default")
  924.                        if v:IsPlayer() and v:IsSuperAdmin() then
  925.                                if not table.HasValue(AHack.SuperAdmins, v) then
  926.                                        table.insert(AHack.SuperAdmins, v)
  927.                                        AHack.Message("Super Admin "..v:Nick().." joined the game.")
  928.                                        if AHack.Misc.Vars["Sounds"]:GetBool() then
  929.                                                surface.PlaySound("vo/npc/Alyx/watchout02.wav")
  930.                                        end    
  931.                                end
  932.                        end                    
  933.                        if v:IsPlayer() and v:IsAdmin() and not v:IsSuperAdmin() then
  934.                                if not table.HasValue(AHack.Admins, v) then
  935.                                        table.insert(AHack.Admins, v)
  936.                                        AHack.Message("Admin "..v:Nick().." joined the game.")
  937.                                        if AHack.Misc.Vars["Sounds"]:GetBool() then
  938.                                                surface.PlaySound("vo/npc/Alyx/watchout01.wav")
  939.                                        end    
  940.                                end
  941.                        end            
  942.                        for k,v in pairs(AHack.Admins) do
  943.                                if not IsValid(v) then
  944.                                        table.remove(AHack.Admins, k)
  945.                                end
  946.                        end
  947.                        for k,v in pairs(AHack.SuperAdmins) do
  948.                                if not IsValid(v) then
  949.                                        table.remove(AHack.SuperAdmins, k)
  950.                                end
  951.                        end
  952.                              
  953.                        if v:IsPlayer() and v:GetObserverTarget() == AHack.Ply then
  954.                                if not table.HasValue(AHack.Spectators, v) then
  955.                                        table.insert(AHack.Spectators, v)
  956.                                        AHack.Message(v:Nick().." started spectating you.")
  957.                                        if AHack.Misc.Vars["Sounds"]:GetBool() then
  958.                                                surface.PlaySound("vo/npc/female01/ohno.wav")
  959.                                        end                            
  960.                                end
  961.                        end
  962.                        for k,v in pairs(AHack.Spectators) do
  963.                                if IsValid(v) then
  964.                                        if v:GetObserverTarget() != AHack.Ply then
  965.                                                table.remove(AHack.Spectators, k)
  966.                                        end
  967.                                else
  968.                                        table.remove(k)
  969.                                end
  970.                        end
  971.                      
  972.                        if AHack.TTT and AHack.Misc.Vars["TraitorFinder"]:GetBool() then
  973.                                if GetRoundState() == 3 and v:IsWeapon() and type(v:GetOwner()) == "Player" and v.Buyer == nil and v.CanBuy and table.HasValue(v.CanBuy, 1) then
  974.                                        local owner = v:GetOwner()
  975.                                        if owner:GetRole() == 2 then
  976.                                                v.Buyer = owner
  977.                                        else
  978.                                                AHack.Message(owner:Nick().." bought a traitor weapon: "..v:GetClass())
  979.                                                v.Buyer = owner
  980.                                                table.insert(AHack.Traitors, owner)
  981.                                                if AHack.Misc.Vars["Sounds"]:GetBool() then
  982.                                                        surface.PlaySound("weapons/shotgun/shotgun_cock.wav")
  983.                                                end    
  984.                                        end
  985.                                elseif GetRoundState() != 3 then
  986.                                        table.Empty(AHack.Traitors)
  987.                                end
  988.                        end
  989.                      
  990.                        if AHack.Misc.Vars["Deaths"]:GetBool() and v:IsPlayer() then
  991.                                if v:Alive() then
  992.                                        v.IsAlive = true
  993.                                elseif v.IsAlive then
  994.                                        AHack.Message(3, v:Nick().." just died.")
  995.                                        v.IsAlive = false
  996.                                        if AHack.Misc.Vars["Sounds"]:GetBool() then
  997.                                                surface.PlaySound("npc/combine_soldier/vo/onedown.wav")
  998.                                        end    
  999.                                end                            
  1000.                        end
  1001.                end
  1002.              
  1003.                surface.SetFont("default")
  1004.                surface.SetTextColor(Color(255, 255, 255, 255))
  1005.                local AdminWidest = 0
  1006.                local AdminTotalHeight = 0
  1007.                local AdminHeight = 20
  1008.                if AHack.Misc.Vars["ShowAdmins"]:GetBool() then
  1009.                        for k,v in pairs(AHack.SuperAdmins) do
  1010.                                local W, H = surface.GetTextSize(v:Nick().." - Super Admin")
  1011.                                if W > AdminWidest then
  1012.                                        AdminWidest = W
  1013.                                end
  1014.                                AdminTotalHeight = AdminTotalHeight + H
  1015.                        end
  1016.                        for k,v in pairs(AHack.Admins) do
  1017.                                local W, H = surface.GetTextSize(v:Nick().." - Admin")
  1018.                                if W > AdminWidest then
  1019.                                        AdminWidest = W
  1020.                                end
  1021.                                AdminTotalHeight = AdminTotalHeight + H
  1022.                        end
  1023.                        draw.RoundedBox(8, ScrW() - AdminWidest - 30, 10, AdminWidest + 20, AdminTotalHeight + 20, Color(0, 0, 0, 150 ))
  1024.                        for k,v in pairs(AHack.SuperAdmins) do
  1025.                                local text = v:Nick().." - Super Admin"
  1026.                                local W, H = surface.GetTextSize(text)
  1027.                                surface.SetTextPos(ScrW() - 20 - AdminWidest, AdminHeight)
  1028.                                surface.DrawText(text)
  1029.                                AdminHeight = AdminHeight + H
  1030.                        end
  1031.                        for k,v in pairs(AHack.Admins) do
  1032.                                local text = v:Nick().." - Admin"
  1033.                                local W, H = surface.GetTextSize(text)
  1034.                                surface.SetTextPos(ScrW() - 20 - AdminWidest, AdminHeight)
  1035.                                surface.DrawText(text)
  1036.                                AdminHeight = AdminHeight + H
  1037.                        end
  1038.                end
  1039.              
  1040.                local SpecWidest = 0
  1041.                local SpecTotalHeight = 0
  1042.                local SpecHeight = AdminTotalHeight + 50
  1043.                if AHack.Misc.Vars["ShowSpectators"]:GetBool() then
  1044.                        for k,v in pairs(AHack.Spectators) do
  1045.                                local W, H = surface.GetTextSize(v:Nick())
  1046.                                if W > SpecWidest then
  1047.                                        SpecWidest = W
  1048.                                end
  1049.                                SpecTotalHeight = SpecTotalHeight + H
  1050.                        end
  1051.                        draw.RoundedBox(8, ScrW() - SpecWidest - 30, 40 + AdminTotalHeight, SpecWidest + 20, SpecTotalHeight + 20, Color(0, 0, 0, 150 ))
  1052.                        for k,v in pairs(AHack.Spectators) do
  1053.                                local text = v:Nick()
  1054.                                local W, H = surface.GetTextSize(text)
  1055.                                surface.SetTextPos(ScrW() - 20 - SpecWidest, SpecHeight)
  1056.                                surface.DrawText(text)
  1057.                                SpecHeight = SpecHeight + H
  1058.                        end
  1059.                end
  1060.              
  1061.                if AHack.Misc.Vars["Crosshair"]:GetBool() then
  1062.                        local size = AHack.Misc.Vars["CrosshairSize"]:GetInt()
  1063.                        local MiddleScreen = {x = surface.ScreenWidth() / 2, y = surface.ScreenHeight() / 2}
  1064.                        surface.SetDrawColor(AHack.Style.Vars["Crosshair"].color)
  1065.                        surface.DrawLine(MiddleScreen.x, MiddleScreen.y, MiddleScreen.x - size, MiddleScreen.y)
  1066.                        surface.DrawLine(MiddleScreen.x, MiddleScreen.y, MiddleScreen.x, MiddleScreen.y - size)
  1067.                        surface.DrawLine(MiddleScreen.x, MiddleScreen.y, MiddleScreen.x + size, MiddleScreen.y)
  1068.                        surface.DrawLine(MiddleScreen.x, MiddleScreen.y, MiddleScreen.x, MiddleScreen.y + size)
  1069.                end
  1070.        end
  1071. end)
  1072.  
  1073. hook.Add("Think", AHack.RandomName(math.random(10, 15)), function()
  1074.        if AHack.Active:GetBool() then        
  1075.                if AHack.Misc.Vars["NoRecoil"]:GetBool() then
  1076.                        if IsValid(AHack.Ply:GetActiveWeapon()) then
  1077.                                local weapon = AHack.Ply:GetActiveWeapon()
  1078.                                if weapon.Primary then
  1079.                                        weapon.OldRecoil = weapon.OldRecoil or weapon.Primary.Recoil or weapon.Recoil
  1080.                                        weapon.Primary.Recoil = 0
  1081.                                        weapon.Recoil = 0
  1082.                                else
  1083.                                        weapon.OldRecoil = weapon.OldRecoil or weapon.Recoil
  1084.                                        weapon.Recoil = 0
  1085.                                end
  1086.                        end
  1087.                elseif IsValid(AHack.Ply:GetActiveWeapon()) then
  1088.                        local weapon = AHack.Ply:GetActiveWeapon()
  1089.                        if weapon.Primary then
  1090.                                weapon.Primary.Recoil = weapon.OldRecoil or weapon.Primary.Recoil or weapon.Recoil
  1091.                                weapon.Recoil = weapon.OldRecoil or weapon.Recoil or weapon.Primary.Recoil
  1092.                        else
  1093.                                weapon.Recoil = weapon.OldRecoil or weapon.Recoil
  1094.                        end
  1095.                end
  1096.              
  1097.                if AHack.DarkRP and AHack.Misc.Vars["BuyHealth"]:GetBool() then
  1098.                        if AHack.Ply:Alive() and AHack.Ply:Health() < AHack.Misc.Vars["BuyHealth_Minimum"]:GetInt() then
  1099.                                AHack.Ply:ConCommand("say /buyhealth")
  1100.                        end
  1101.                end
  1102.        end
  1103. end)
  1104.  
  1105. AHack.Misc.NextReload = CurTime()
  1106. AHack.Misc.ShootNext = true
  1107. hook.Add("CreateMove", AHack.RandomName(math.random(10, 15)), function(cmd)
  1108.        if AHack.Active:GetBool() then
  1109.                if AHack.Aimbot.Vars["Active"]:GetBool() and not (AHack.Aimbot.Vars["PanicMode"]:GetBool() and #AHack.Spectators > 0) then
  1110.                        if not AHack.Aimbot.Vars["AimOnKey"]:GetBool() or (AHack.Aimbot.Vars["AimOnKey"]:GetBool() and AHack.KeyPressed(AHack.Aimbot.Vars["AimOnKey_Key"]:GetString())) then
  1111.                                if AHack.ValidTarget() then
  1112.                                        local BoneOrder = {}
  1113.                                        if AHack.Aimbot.CurTarget.BoneToAimAt and AHack.Aimbot.Vars["RandomBones"]:GetBool() then
  1114.                                                table.insert(BoneOrder, AHack.Aimbot.CurTarget.BoneToAimAt)
  1115.                                                table.Add(BoneOrder, AHack.GetRandomBones())
  1116.                                                table.Add(BoneOrder, AHack.Bones)
  1117.                                        else
  1118.                                                if AHack.Aimbot.Vars["RandomBones"]:GetBool() then
  1119.                                                        table.Add(BoneOrder, AHack.GetRandomBones())
  1120.                                                        table.Add(BoneOrder, AHack.Bones)
  1121.                                                else
  1122.                                                        table.Add(BoneOrder, AHack.Bones)
  1123.                                                end
  1124.                                        end
  1125.                                        for k = 1, #BoneOrder do
  1126.                                                local v = BoneOrder[k]
  1127.                                                local bone = AHack.Aimbot.CurTarget:LookupBone(v)
  1128.                                                if bone != nil then
  1129.                                                        local pos, ang = AHack.Aimbot.CurTarget:GetBonePosition(bone)
  1130.                                                        if v == "ValveBiped.Bip01_Head1" then
  1131.                                                                pos = pos + Vector(0, 0, 3) //Aiming a little higher for the head
  1132.                                                        end
  1133.                                                        local total, needed = 300, {300, 300}
  1134.                                                      
  1135.                                                        if AHack.Aimbot.Vars["Prediction"]:GetBool() then
  1136.                                                                local tarSpeed = AHack.Aimbot.CurTarget:GetVelocity() * 0.013
  1137.                                                                local plySpeed = AHack.Ply:GetVelocity() * 0.013
  1138.                                                                total, needed = AHack.AngleTo(pos - plySpeed + tarSpeed)
  1139.                                                        else
  1140.                                                                total, needed = AHack.AngleTo(pos)
  1141.                                                        end
  1142.                                                              
  1143.                                                        if AHack.BoneIsVisible(pos) and total < AHack.Aimbot.Vars["MaxAngle"]:GetInt() then
  1144.                                                                local myAngles = AHack.Ply:GetAngles()
  1145.                                                              
  1146.                                                                local NewAngles = Angle(myAngles.p + needed.p, myAngles.y + needed.y, 0)
  1147.                                                              
  1148.                                                                if AHack.Aimbot.Vars["AntiSnap"]:GetBool() then
  1149.                                                                        local speed = AHack.Aimbot.Vars["AntiSnapSpeed"]:GetInt()
  1150.                                                                        NewAngles = (Angle(math.Approach(myAngles.p, NewAngles.p, speed), math.Approach(myAngles.y, NewAngles.y, speed), 0))
  1151.                                                                end
  1152.                                                              
  1153.                                                                if AHack.Aimbot.Vars["NoSpread"]:GetBool() and AHack.NoSpread then
  1154.                                                                        local weapon = AHack.Ply:GetActiveWeapon()
  1155.                                                                        if IsValid(weapon) and weapon.Primary and weapon.Primary.Cone then
  1156.                                                                                NewAngles = DS_manipulateShot(DS_md5PseudoRandom(DS_getUCMDCommandNumber(cmd)), NewAngles:Forward(), Vector(-weapon.Primary.Cone, -weapon.Primary.Cone, 0)):Angle()
  1157.                                                                        elseif IsValid(weapon) and weapon.Cone then
  1158.                                                                                NewAngles = DS_manipulateShot(DS_md5PseudoRandom(DS_getUCMDCommandNumber(cmd)), NewAngles:Forward(), Vector(-weapon.Cone, -weapon.Cone, 0)):Angle()
  1159.                                                                        end
  1160.                                                                end
  1161.                                                              
  1162.                                                                cmd:SetViewAngles(NewAngles)  
  1163.                                                              
  1164.                                                                AHack.Aimbot.CurTarget.BoneToAimAt = BoneOrder[k]
  1165.                                                                break
  1166.                                                        end
  1167.                                                end
  1168.                                        end
  1169.                                else
  1170.                                        AHack.Aimbot.CurTarget = AHack.GetTarget()
  1171.                                end
  1172.                        else
  1173.                                AHack.Aimbot.CurTarget = nil
  1174.                        end
  1175.                end
  1176.              
  1177.                local DontShoot = {"gmod_tool", "gmod_camera", "weapon_physgun", "weapon_physcannon"}
  1178.                if AHack.Aimbot.Vars["AutoShoot"]:GetBool() and AHack.Aimbot.Vars["Active"]:GetBool() and AHack.Ply:GetEyeTrace().Entity == AHack.Aimbot.CurTarget and IsValid(AHack.Ply:GetActiveWeapon()) and not table.HasValue(DontShoot, AHack.Ply:GetActiveWeapon():GetClass()) then
  1179.                        cmd:SetButtons(cmd:GetButtons() + IN_ATTACK)
  1180.                end
  1181.              
  1182.                if AHack.Misc.Vars["BunnyHop"]:GetBool() and cmd:KeyDown(IN_JUMP) and AHack.KeyPressed(AHack.Misc.Vars["BunnyHop_Key"]:GetString()) then
  1183.                        cmd:SetButtons(cmd:GetButtons() - IN_JUMP)
  1184.                end
  1185.                if AHack.Misc.Vars["BunnyHop"]:GetBool() and AHack.Ply:OnGround() and AHack.KeyPressed(AHack.Misc.Vars["BunnyHop_Key"]:GetString()) then
  1186.                        cmd:SetButtons(cmd:GetButtons() + IN_JUMP)
  1187.                end
  1188.              
  1189.                local DontReload = {"gmod_tool", "gmod_camera", "weapon_physgun", "weapon_physcannon", "weapon_crowbar"}
  1190.                if AHack.Misc.Vars["AutoReload"]:GetBool() and IsValid(AHack.Ply:GetActiveWeapon()) and AHack.Ply:GetActiveWeapon():Clip1() < 1 and not table.HasValue(DontReload, AHack.Ply:GetActiveWeapon():GetClass()) and AHack.Misc.NextReload < CurTime() then
  1191.                        cmd:SetButtons(cmd:GetButtons() + IN_RELOAD)
  1192.                end
  1193.              
  1194.                if AHack.Misc.Vars["AutoPistol"]:GetBool() and IsValid(AHack.Ply:GetActiveWeapon()) then
  1195.                        local weapon = AHack.Ply:GetActiveWeapon()
  1196.                        if weapon.Primary and type(weapon.Primary.Automatic) == "boolean" and not weapon.Primary.Automatic then
  1197.                                if cmd:KeyDown(IN_ATTACK) then
  1198.                                        if AHack.Misc.ShootNext then
  1199.                                                AHack.Misc.ShootNext = false
  1200.                                        else
  1201.                                                cmd:SetButtons(cmd:GetButtons() - IN_ATTACK)
  1202.                                                AHack.Misc.ShootNext = true
  1203.                                        end
  1204.                                end                                    
  1205.                        elseif type(weapon.Automatic) == "boolean" and not weapon.Automatic then
  1206.                                if cmd:KeyDown(IN_ATTACK) then
  1207.                                        if AHack.Misc.ShootNext then
  1208.                                                AHack.Misc.ShootNext = false
  1209.                                        else
  1210.                                                cmd:SetButtons(cmd:GetButtons() - IN_ATTACK)
  1211.                                                AHack.Misc.ShootNext = true
  1212.                                        end
  1213.                                end
  1214.                        end
  1215.                end
  1216.        end
  1217. end)
  1218.  
  1219. //Used to see if the player is typing in chat or not. Binds arent called when you're in chat.
  1220. AHack.InChat = false
  1221. hook.Add("StartChat", AHack.RandomName(math.random(10, 15)), function()
  1222.         AHack.InChat = true
  1223. end)
  1224. hook.Add("FinishChat", AHack.RandomName(math.random(10, 15)), function()
  1225.         AHack.InChat = false
  1226. end)
  1227.  
  1228. concommand.Add("AHack_Menu", function()
  1229.         //Im only using DColumnSheet because everyone used DPropertySheet. I just want to be different
  1230.         local main = vgui.Create("DFrame")
  1231.         main:SetSize(500,496)
  1232.         main:Center()
  1233.         main:SetTitle("")
  1234.         main:MakePopup()
  1235.         main:ShowCloseButton(false)
  1236.         main.Paint = function()
  1237.                 draw.RoundedBox( 0, 0, 0, main:GetWide(), main:GetTall(), Color( 0, 0, 0, 150 ) )
  1238.         end
  1239.        
  1240.         local PanicButton = vgui.Create("DButton", main)
  1241.         PanicButton:SetSize(50, 20)
  1242.         PanicButton:SetPos(415, 3)
  1243.         local function Enable()
  1244.                 PanicButton:SetText("Disable")
  1245.                 PanicButton.DoClick = function()
  1246.                         PanicButton:SetText("Enable")
  1247.                         PanicButton.DoClick = Enable
  1248.                         AHack.Ply:ConCommand("AHack_Active 0")
  1249.                 end
  1250.                 AHack.Ply:ConCommand("AHack_Active 1")
  1251.         end
  1252.         local function Disable()
  1253.                 PanicButton:SetText("Enable")
  1254.                 PanicButton.DoClick = function()
  1255.                         PanicButton:SetText("Disable")
  1256.                         PanicButton.DoClick = Disable
  1257.                         AHack.Ply:ConCommand("AHack_Active 1")
  1258.                 end
  1259.                 AHack.Ply:ConCommand("AHack_Active 0")
  1260.         end
  1261.         if AHack.Active:GetBool() then
  1262.                 PanicButton:SetText("Disable")
  1263.                 PanicButton.DoClick = Disable
  1264.         else
  1265.                 PanicButton:SetText("Enable")
  1266.                 PanicButton.DoClick = Enable
  1267.         end
  1268.        
  1269.         local CloseButton = vgui.Create("DButton", main)
  1270.         CloseButton:SetSize(30, 20)
  1271.         CloseButton:SetPos(465, 3)
  1272.         CloseButton:SetText("X")
  1273.         CloseButton.DoClick = function()
  1274.                 main:Close()
  1275.         end
  1276.        
  1277.         local title = vgui.Create("DLabel", main)
  1278.         title:SetColor(Color(255, 255, 255, 255))
  1279.         title:SetFont("TitleFont")
  1280.         title:SetText("AHack - "..AHack.Version)
  1281.         title:SizeToContents()
  1282.         title:SetPos(main:GetWide() / 2 - title:GetWide() / 2,3)      
  1283.        
  1284.         ColumnSheet = vgui.Create("DColumnSheet",main)
  1285.         ColumnSheet:SetPos(5, 25)
  1286.         ColumnSheet:SetSize(500 ,465)
  1287.        
  1288.         local y = 40
  1289.         local function ToggleOption(name, parent, var)
  1290.                 local text = vgui.Create("DLabel", parent)
  1291.                 text:SetColor(Color(0, 0, 0, 255))
  1292.                 text:SetFont("CatagoryText")
  1293.                 text:SetText(name)
  1294.                 text:SizeToContents()
  1295.                 text:SetPos(parent:GetWide() / 4 - text:GetWide() / 2, y)
  1296.                
  1297.                 local Options = vgui.Create("DComboBox", parent)
  1298.                 Options:SetSize(100, 20)
  1299.                 Options:SetPos(parent:GetWide() * 0.75 - Options:GetWide() / 2, y + 5)
  1300.                 Options:AddChoice("Off", 0)
  1301.                 Options:AddChoice("On", 1)
  1302.                 Options.OnSelect = function(panel,index,value,data)
  1303.                         AHack.Ply:ConCommand(var.." "..data)
  1304.                 end
  1305.                 Options:SetText(Options:GetOptionText(GetConVar(var):GetInt() + 1))
  1306.                
  1307.                 y = y + 40
  1308.         end
  1309.        
  1310.         local function SetKeyOption(name, parent, var)
  1311.                 local text = vgui.Create("DLabel", parent)
  1312.                 text:SetColor(Color(0, 0, 0, 255))
  1313.                 text:SetFont("CatagoryText")
  1314.                 text:SetText(name)
  1315.                 text:SizeToContents()
  1316.                 text:SetPos(parent:GetWide() / 4 - text:GetWide() / 2, y)
  1317.                
  1318.                 local Options = vgui.Create("DButton", parent)
  1319.                 Options:SetSize(100, 20)
  1320.                 Options:SetPos(parent:GetWide() * 0.75 - Options:GetWide() / 2, y + 5)
  1321.                 Options:SetText(GetConVar(var):GetString())
  1322.                 Options.DoClick = function()
  1323.                         Options:SetText("Press a key...")
  1324.                         Options.Think = function()
  1325.                                 for k = 107, 111 do
  1326.                                         if input.IsMouseDown(k) then
  1327.                                                 AHack.Ply:ConCommand(var.." "..AHack.MouseKeys[k])
  1328.                                                 Options:SetText(AHack.MouseKeys[k])
  1329.                                                 Options.Think = nil
  1330.                                         end
  1331.                                 end
  1332.                                
  1333.                                 for k = 0, 130 do
  1334.                                         if input.IsKeyDown(k) then
  1335.                                                 AHack.Ply:ConCommand(var.." "..AHack.Keys[k])
  1336.                                                 Options:SetText(AHack.Keys[k])
  1337.                                                 Options.Think = nil
  1338.                                         end
  1339.                                 end
  1340.                         end
  1341.                 end
  1342.                
  1343.                 y = y + 40
  1344.         end
  1345.        
  1346.         local function SetNumberOption(name, parent, var, min, max, decimals)
  1347.                 local text = vgui.Create("DLabel", parent)
  1348.                 text:SetColor(Color(0, 0, 0, 255))
  1349.                 text:SetFont("CatagoryText")
  1350.                 text:SetText(name)
  1351.                 text:SizeToContents()
  1352.                 text:SetPos(parent:GetWide() / 4 - text:GetWide() / 2, y)
  1353.                
  1354.                 local Options = vgui.Create("DNumberWang", parent)
  1355.                 Options:SetSize(100, 20)
  1356.                 Options:SetPos(parent:GetWide() * 0.75 - Options:GetWide() / 2, y + 5)
  1357.                 Options:SetMin(min)
  1358.                 Options:SetMax(max)
  1359.                 Options:SetDecimals(decimals)
  1360.                 Options:SetConVar(var)
  1361.                
  1362.                 y = y + 40
  1363.         end
  1364.        
  1365.         local function MultiOption(name, parent, var, tab)
  1366.                 local text = vgui.Create("DLabel", parent)
  1367.                 text:SetColor(Color(0, 0, 0, 255))
  1368.                 text:SetFont("CatagoryText")
  1369.                 text:SetText(name)
  1370.                 text:SizeToContents()
  1371.                 text:SetPos(parent:GetWide() / 4 - text:GetWide() / 2, y)
  1372.                
  1373.                 local Options = vgui.Create("DComboBox", parent)
  1374.                 Options:SetSize(100, 20)
  1375.                 Options:SetPos(parent:GetWide() * 0.75 - Options:GetWide() / 2, y + 5)
  1376.                 for i = 1, #tab do
  1377.                         Options:AddChoice(tab[i])
  1378.                 end
  1379.                 Options.OnSelect = function(panel,index,value,data)
  1380.                         AHack.Ply:ConCommand(var.." "..value)
  1381.                 end
  1382.                 Options:SetText(GetConVar(var):GetString())
  1383.                
  1384.                 y = y + 40
  1385.         end
  1386.        
  1387.         //Starting the Aimbot panel
  1388.         local Aimbot = vgui.Create("DPanel")
  1389.         Aimbot:SetSize(379, 465)
  1390.         Aimbot.Paint = function()
  1391.                 draw.RoundedBox( 0, 0, 0, Aimbot:GetWide(), Aimbot:GetTall(), Color( 240, 240, 240, 255 ) )
  1392.         end
  1393.        
  1394.         local title = vgui.Create("DLabel", Aimbot)
  1395.         title:SetColor(Color(0, 0, 0, 255))
  1396.         title:SetFont("CatagoryHeader")
  1397.         title:SetText("Aimbot")
  1398.         title:SizeToContents()
  1399.         title:SetPos(Aimbot:GetWide() / 2 - title:GetWide() / 2, 0)
  1400.        
  1401.         ToggleOption("Active", Aimbot, "AHack_Aimbot_Active")
  1402.         ToggleOption("Random Bones", Aimbot, "AHack_Aimbot_RandomBones")
  1403.         MultiOption("Preferance", Aimbot, "AHack_Aimbot_Preferance", {"Distance", "Angle"})    
  1404.         ToggleOption("Attack Players", Aimbot, "AHack_Aimbot_AttackPlayers")
  1405.         ToggleOption("Attack NPCs", Aimbot, "AHack_Aimbot_AttackNPCs")
  1406.         ToggleOption("Prediction", Aimbot, "AHack_Aimbot_Prediction")
  1407.         ToggleOption("Aim On Key", Aimbot, "AHack_Aimbot_AimOnKey")
  1408.         SetKeyOption("Key", Aimbot, "AHack_Aimbot_AimOnKey_Key")
  1409.         ToggleOption("Anti Snap", Aimbot, "AHack_Aimbot_AntiSnap")
  1410.         SetNumberOption("Anti Snap Speed", Aimbot, "AHack_Aimbot_AntiSnapSpeed", 1, 5, 2)
  1411.         SetNumberOption("Max Angle", Aimbot, "AHack_Aimbot_MaxAngle", 0, 270, 0)
  1412.         ToggleOption("Auto Shoot", Aimbot, "AHack_Aimbot_AutoShoot")
  1413.         ToggleOption("Panic Mode", Aimbot, "AHack_Aimbot_PanicMode")
  1414.         ToggleOption("Ignore Team", Aimbot, "AHack_Aimbot_IgnoreTeam")
  1415.         ToggleOption("No Spread", Aimbot, "AHack_Aimbot_NoSpread")
  1416.        
  1417.         if y > 465 then
  1418.                 Aimbot:SetTall(y)
  1419.         end
  1420.        
  1421.         //This is the best way i can find to add a scrollbar to the menu...
  1422.         AimbotList = vgui.Create( "DPanelList" )
  1423.         AimbotList:SetSize(379, 465)
  1424.         AimbotList:SetSpacing(0)
  1425.         AimbotList:EnableHorizontal(false)
  1426.         AimbotList:EnableVerticalScrollbar(true)
  1427.         AimbotList:AddItem(Aimbot)
  1428.        
  1429.         ColumnSheet:AddSheet("Aimbot", AimbotList, "icon16/application_xp_terminal.png")
  1430.  
  1431.         //Starting the ESP panel
  1432.         local ESP = vgui.Create("DPanel")
  1433.         ESP:SetSize(379, 465)
  1434.         ESP.Paint = function()
  1435.                 draw.RoundedBox( 0, 0, 0, ESP:GetWide(), ESP:GetTall(), Color( 240, 240, 240, 255 ) )
  1436.         end
  1437.        
  1438.         local title = vgui.Create("DLabel", ESP)
  1439.         title:SetColor(Color(0, 0, 0, 255))
  1440.         title:SetFont("CatagoryHeader")
  1441.         title:SetText("ESP")
  1442.         title:SizeToContents()
  1443.         title:SetPos(ESP:GetWide() / 2 - title:GetWide() / 2, 3)
  1444.        
  1445.         y = 40
  1446.         ToggleOption("Active", ESP, "AHack_ESP_Active")
  1447.         ToggleOption("Player Info", ESP, "AHack_ESP_Players")
  1448.         ToggleOption("NPC Info", ESP, "AHack_ESP_NPCs")
  1449.         MultiOption("Name", ESP, "AHack_ESP_Name", {"Off", "Above", "Below"})  
  1450.         MultiOption("Weapon", ESP, "AHack_ESP_Weapons", {"Off", "Above", "Below"})    
  1451.         MultiOption("Health", ESP, "AHack_ESP_Health", {"Off", "Above", "Below"})      
  1452.         MultiOption("Distance", ESP, "AHack_ESP_Distance", {"Off", "Above", "Below"})
  1453.         MultiOption("Show Traitors", ESP, "AHack_ESP_ShowTraitors", {"Off", "Above", "Below"})
  1454.         ToggleOption("Bounding Box", ESP, "AHack_ESP_Box")
  1455.         ToggleOption("Body Info", ESP, "AHack_ESP_Bodies")
  1456.         ToggleOption("2D Radar", ESP, "AHack_ESP_Radar")
  1457.         SetNumberOption("Radar Scale", ESP, "AHack_ESP_RadarScale", 1, 100, 0)
  1458.         SetNumberOption("Max Distance", ESP, "AHack_ESP_MaxDistance", 0, 8000, 0)
  1459.         ToggleOption("Team Based", ESP, "AHack_ESP_TeamBased")
  1460.        
  1461.         if y > 465 then
  1462.                 ESP:SetTall(y)
  1463.         end
  1464.        
  1465.         ESPList = vgui.Create( "DPanelList" )
  1466.         ESPList:SetSize(379, 465)
  1467.         ESPList:SetSpacing(0)
  1468.         ESPList:EnableHorizontal(false)
  1469.         ESPList:EnableVerticalScrollbar(true)
  1470.         ESPList:AddItem(ESP)
  1471.        
  1472.         ColumnSheet:AddSheet("ESP", ESPList, "icon16/pencil.png")
  1473.        
  1474.         //Starting the Chams panel
  1475.         local Chams = vgui.Create("DPanel")
  1476.         Chams:SetSize(379, 465)
  1477.         Chams.Paint = function()
  1478.                 draw.RoundedBox( 0, 0, 0, Chams:GetWide(), Chams:GetTall(), Color( 240, 240, 240, 255 ) )
  1479.         end
  1480.        
  1481.         local title = vgui.Create("DLabel", Chams)
  1482.         title:SetColor(Color(0, 0, 0, 255))
  1483.         title:SetFont("CatagoryHeader")
  1484.         title:SetText("Chams")
  1485.         title:SizeToContents()
  1486.         title:SetPos(Chams:GetWide() / 2 - title:GetWide() / 2, 3)
  1487.        
  1488.         y = 40
  1489.         ToggleOption("Active", Chams, "AHack_Chams_Active")
  1490.         ToggleOption("Draw Players", Chams, "AHack_Chams_Players")
  1491.         ToggleOption("Draw NPCs", Chams, "AHack_Chams_NPCs")
  1492.         ToggleOption("Draw Weapons", Chams, "AHack_Chams_Weapons")
  1493.         ToggleOption("Draw Bodies", Chams, "AHack_Chams_Bodies")
  1494.         ToggleOption("Team Based", Chams, "AHack_Chams_TeamBased")
  1495.         SetNumberOption("Max Distance", Chams, "AHack_Chams_MaxDistance", 0, 8000, 0)
  1496.        
  1497.         if y > 465 then
  1498.                 Chams:SetTall(y)
  1499.         end
  1500.        
  1501.         ChamsList = vgui.Create( "DPanelList" )
  1502.         ChamsList:SetSize(379, 465)
  1503.         ChamsList:SetSpacing(0)
  1504.         ChamsList:EnableHorizontal(false)
  1505.         ChamsList:EnableVerticalScrollbar(true)
  1506.         ChamsList:AddItem(Chams)
  1507.        
  1508.         ColumnSheet:AddSheet("Chams", ChamsList, "icon16/eye.png")
  1509.        
  1510.         //Starting the Misc panel
  1511.         local Misc = vgui.Create("DPanel")
  1512.         Misc:SetSize(379, 465)
  1513.         Misc.Paint = function()
  1514.                 draw.RoundedBox( 0, 0, 0, Misc:GetWide(), Misc:GetTall(), Color( 240, 240, 240, 255 ) )
  1515.         end
  1516.        
  1517.         local title = vgui.Create("DLabel", Misc)
  1518.         title:SetColor(Color(0, 0, 0, 255))
  1519.         title:SetFont("CatagoryHeader")
  1520.         title:SetText("Misc")
  1521.         title:SizeToContents()
  1522.         title:SetPos(Misc:GetWide() / 2 - title:GetWide() / 2, 3)
  1523.        
  1524.         y = 40
  1525.         ToggleOption("Show Admins", Misc, "AHack_Misc_ShowAdmins")
  1526.         ToggleOption("Crosshair", Misc, "AHack_Misc_Cross")
  1527.         SetNumberOption("Corsshair Size", Misc, "AHack_Misc_CrossSize", 0, 1000, 0)
  1528.         ToggleOption("No Recoil", Misc, "AHack_Misc_NoRecoil")
  1529.         ToggleOption("Spectators", Misc, "AHack_Misc_ShowSpectators")
  1530.         ToggleOption("Auto Reload", Misc, "AHack_Misc_AutoReload")
  1531.         ToggleOption("Bunny Hop", Misc, "AHack_Misc_BunnyHop")
  1532.         SetKeyOption("Key", Misc, "AHack_Misc_BunnyHop_Key")
  1533.         ToggleOption("Auto Pistol", Misc, "AHack_Misc_AutoPistol")
  1534.         ToggleOption("Buy Health", Misc, "AHack_Misc_BuyHealth")
  1535.         SetNumberOption("Minimum", Misc, "AHack_Misc_BuyHealth_Minimum", 0, 100, 0)
  1536.         ToggleOption("Traitor Finder", Misc, "AHack_Misc_TraitorFinder")
  1537.         ToggleOption("Show Deaths", Misc, "AHack_Misc_Deaths")
  1538.         ToggleOption("Sounds", Misc, "AHack_Misc_Sounds")
  1539.  
  1540.         if y > 465 then
  1541.                 Misc:SetTall(y)
  1542.         end
  1543.        
  1544.         MiscList = vgui.Create( "DPanelList" )
  1545.         MiscList:SetSize(379, 465)
  1546.         MiscList:SetSpacing(0)
  1547.         MiscList:EnableHorizontal(false)
  1548.         MiscList:EnableVerticalScrollbar(true)
  1549.         MiscList:AddItem(Misc)
  1550.  
  1551.         ColumnSheet:AddSheet("Misc", MiscList, "icon16/package.png")
  1552.        
  1553.         local function ColorOption(name, parent, tab)
  1554.                 local text = vgui.Create("DLabel", parent)
  1555.                 text:SetColor(Color(0, 0, 0, 255))
  1556.                 text:SetFont("CatagoryText")
  1557.                 text:SetText(name)
  1558.                 text:SizeToContents()
  1559.                 text:SetPos(parent:GetWide() / 4 - text:GetWide() / 2, y + 30)
  1560.                
  1561.                 local Options = vgui.Create("DColorMixer", parent)
  1562.                 Options:SetSize(150, 100)
  1563.                 Options:SetPos(parent:GetWide() * 0.75 - Options:GetWide() / 2, y)
  1564.                 Options:SetColor(tab.color)//AHack.GetColorFromString(GetConVar(var):GetString()))
  1565.                 Options:SetWangs(false)
  1566.                 Options:SetPalette(false)
  1567.                 Options.ValueChanged = function(panel, color)
  1568.                         AHack.Ply:ConCommand(tab.var:GetName().." ".."Color("..color.r..","..color.g..","..color.b..","..color.a..")")
  1569.                         tab.color = AHack.GetColorFromString(tab.var:GetString())
  1570.                 end
  1571.                
  1572.                 y = y + 110
  1573.         end
  1574.         //Starting the Style panel
  1575.         local Style = vgui.Create("DPanel")
  1576.         Style:SetSize(379, 465)
  1577.         Style.Paint = function()
  1578.                 draw.RoundedBox( 0, 0, 0, Style:GetWide(), Style:GetTall(), Color( 240, 240, 240, 255 ) )
  1579.         end
  1580.        
  1581.         local title = vgui.Create("DLabel", Style)
  1582.         title:SetColor(Color(0, 0, 0, 255))
  1583.         title:SetFont("CatagoryHeader")
  1584.         title:SetText("Style")
  1585.         title:SizeToContents()
  1586.         title:SetPos(Style:GetWide() / 2 - title:GetWide() / 2, 3)
  1587.        
  1588.         y = 50
  1589.         ColorOption("Bounding Box", Style, AHack.Style.Vars["BoundingBox"])
  1590.         ColorOption("ESP Text", Style, AHack.Style.Vars["ESPText"])
  1591.         ColorOption("Crosshair", Style, AHack.Style.Vars["Crosshair"])
  1592.         ColorOption("TTT Body Text", Style, AHack.Style.Vars["BodyText"])
  1593.         ColorOption("Chams", Style, AHack.Style.Vars["Chams"])
  1594.         ColorOption("TTT Body Chams", Style, AHack.Style.Vars["BodyChams"])
  1595.        
  1596.         if y > 465 then
  1597.                 Style:SetTall(y)
  1598.         end
  1599.        
  1600.         StyleList = vgui.Create( "DPanelList" )
  1601.         StyleList:SetSize(379, 465)
  1602.         StyleList:SetSpacing(0)
  1603.         StyleList:EnableHorizontal(false)
  1604.         StyleList:EnableVerticalScrollbar(true)
  1605.         StyleList:AddItem(Style)
  1606.        
  1607.         ColumnSheet:AddSheet("Style", StyleList, "icon16/color_wheel.png")
  1608. end)
  1609.  
  1610.  
  1611. //Just some fonts
  1612. surface.CreateFont("TitleFont", {font = "Arial", size = 20})
  1613. surface.CreateFont("CatagoryHeader", {font = "CloseCaption_Normal", size = 34})
  1614. surface.CreateFont("CatagoryText", {font = "CloseCaption_Normal", size = 28})
  1615. surface.CreateFont("ESPFont", {font = "CloseCaption_Normal", weight = 1000, size = 15})
  1616.  
  1617. --[[
  1618.         DPropertySheet - Slightly edited so it looks good.
  1619. --]]
  1620. local PANEL = {}
  1621. AccessorFunc( PANEL, "ActiveButton", "ActiveButton" )
  1622.  
  1623. --[[---------------------------------------------------------
  1624. Name: Init
  1625. -----------------------------------------------------------]]
  1626. function PANEL:Init()
  1627.         self.Navigation = vgui.Create( "DScrollPanel", self )
  1628.         self.Navigation:Dock( LEFT )
  1629.         self.Navigation:SetWidth( 100 )
  1630.         self.Navigation:DockMargin( 0, 0, 10, 0 )
  1631.  
  1632.         self.Content = vgui.Create( "Panel", self )
  1633.         self.Content:Dock( FILL )
  1634.  
  1635.         self.Items = {}
  1636. end
  1637.  
  1638. function PANEL:UseButtonOnlyStyle()
  1639.         self.ButtonOnly = true
  1640. end
  1641.  
  1642. --[[---------------------------------------------------------
  1643. Name: AddSheet
  1644. -----------------------------------------------------------]]
  1645. function PANEL:AddSheet( label, panel, material )
  1646.         if ( !IsValid( panel ) ) then return end
  1647.  
  1648.         local Sheet = {}
  1649.  
  1650.         if ( self.ButtonOnly ) then
  1651.                 Sheet.Button = vgui.Create( "DImageButton", self.Navigation )
  1652.         else
  1653.                 Sheet.Button = vgui.Create( "DButton", self.Navigation )
  1654.         end
  1655.         Sheet.Button:SetImage( material )
  1656.         Sheet.Button.Target = panel
  1657.         Sheet.Button:Dock( TOP )
  1658.         Sheet.Button:SetText( label )
  1659.         Sheet.Button:DockMargin( 0, 0, 0, 5 )
  1660.  
  1661.         Sheet.Button.DoClick = function ()
  1662.                 self:SetActiveButton( Sheet.Button )
  1663.         end
  1664.  
  1665.         Sheet.Panel = panel
  1666.         Sheet.Panel:SetParent( self.Content )
  1667.         Sheet.Panel:SetVisible( false )
  1668.  
  1669.         if ( self.ButtonOnly ) then
  1670.                 Sheet.Button:SizeToContents()
  1671.                 Sheet.Button:SetColor( Color( 150, 150, 150, 255 ) )
  1672.         end
  1673.  
  1674.         table.insert( self.Items, Sheet )
  1675.  
  1676.         if ( !IsValid( self.ActiveButton ) ) then
  1677.                 self:SetActiveButton( Sheet.Button )
  1678.         end
  1679. end
  1680.  
  1681. --[[---------------------------------------------------------
  1682. Name: SetActiveTab
  1683. -----------------------------------------------------------]]
  1684. function PANEL:SetActiveButton( active )
  1685.         if ( self.ActiveButton == active ) then return end
  1686.  
  1687.         if ( self.ActiveButton && self.ActiveButton.Target ) then      
  1688.                 self.ActiveButton.Target:SetVisible( false )
  1689.                 self.ActiveButton:SetSelected( false )
  1690.                 self.ActiveButton:SetColor( Color( 0, 0, 0, 255 ) )
  1691.         end
  1692.         self.ActiveButton = active
  1693.         active.Target:SetVisible( true )
  1694.         active:SetSelected( true )
  1695.         active:SetColor( Color( 150, 150, 150, 255 ) )
  1696.  
  1697.         self.Content:InvalidateLayout()
  1698. end
  1699.  
  1700. derma.DefineControl( "DColumnSheet", "", PANEL, "Panel" )
Advertisement
Add Comment
Please, Sign In to add comment