Advertisement
R4TB0Y

cyanide

Sep 26th, 2016
10,613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 89.17 KB | None | 0 0
  1. --[[
  2.    
  3.     LOCALISING
  4.    
  5. ]]--
  6. local msg           = 0
  7. local ply           = LocalPlayer()
  8. local pmt           = FindMetaTable("Player")
  9. local g             = table.Copy(_G) or {}
  10. local _Hooks        = {}
  11. local _Modules      = {}
  12. local cones = {}
  13.  
  14. local CamAng, CamPos
  15. local radar_x, radar_y
  16. local FreeCam, FreeCam2
  17. local mirror_x, mirror_y
  18.  
  19. g.Key               = g.string.char(69,68,51,53,70,48,68,56,52,48,52,66,57,70,70,55,48,57,50,50,69,50,54,52,55,66,69,53,48,67,65,53)
  20. g.LogText           = "Loading..."
  21. g.Version           = "1.1.2"
  22. g.GroupID           = "25969779"
  23. g.HackName          = "Cyanide"
  24. g.ActiveTab         = "Aimbot"
  25. g.LocalName         = ply:Nick()
  26. g.MySteamID         = "76561198176251050"
  27.  
  28. g.FakeAng           = ply:EyeAngles() or g.Angle()
  29.  
  30. g.Yaw               = 0
  31. g.YawSens           = g.GetConVar("m_yaw"):GetFloat()
  32. g.SpamTimer         = 0
  33. g.CheckTimer        = 0
  34. g.ReminderTimer     = g.CurTime() + (2 * 60)
  35. g.ServerCurTime     = g.CurTime() + g.engine.TickInterval()
  36. g.NameStealTimer    = 0
  37. g.TickCount         = 0
  38.  
  39. g.InGroup           = false
  40. g.Holding           = false
  41. g.IsTyping          = false
  42. g.Spamming          = false
  43. g.MenuOpen          = false
  44. g.Scoreboard        = false
  45.  
  46. --os.date("%d/%m", os.time()) == "01/04"
  47.  
  48. --[[
  49.    
  50.     GAMEEVENTS
  51.    
  52. ]]--
  53. --gameevent.Listen("player_disconnect")
  54. --gameevent.Listen("flare_ignite_npc")
  55. --gameevent.Listen("break_breakable")
  56. --gameevent.Listen("player_activate")
  57. --gameevent.Listen("player_connect")
  58. gameevent.Listen("entity_killed")
  59. --gameevent.Listen("player_spawn")
  60. gameevent.Listen("player_hurt")
  61. --gameevent.Listen("player_info")
  62. --gameevent.Listen("server_cvar")
  63. --gameevent.Listen("player_say")
  64. --gameevent.Listen("break_prop")
  65.  
  66. --[[
  67.    
  68.     FONTS
  69.    
  70. ]]--
  71. g.surface.CreateFont("MenuFont", {
  72.     font            = "Verdana",
  73.     size            = 16,
  74.     weight          = 100,
  75. })
  76.  
  77. g.surface.CreateFont("TitleFont", {
  78.     font            = "Helvetica",
  79.     size            = 40,
  80.     weight          = 500,
  81.     antialias       = true,
  82.     outline         = false,
  83. })
  84.  
  85. g.surface.CreateFont("ListFont", {
  86.     font            = "Helvetica",
  87.     size            = 25,
  88.     weight          = 100,
  89.     antialias       = true,
  90.     outline         = false,
  91. })
  92.  
  93. g.surface.CreateFont("ESPFont", {
  94.     font            = "Verdana",
  95.     size            = 14,
  96.     weight          = 100,
  97.     antialias       = false,
  98.     outline         = true,
  99. })
  100.  
  101. --[[
  102.    
  103.     TABLES
  104.    
  105. ]]--
  106. g.VideoIDs = {
  107.     ["25IhfWRO4Rk"] = 72,
  108.     ["q_9SsX7HJhE"] = 51,
  109.     ["iPXKfGxeHIY"] = 95,
  110.     ["UocpzSidMgw"] = 32,
  111.     ["zjEvaYLf68E"] = 15,
  112.     ["ck5f9LzQmjY"] = 95,
  113.     ["VAC-5BQnuXI"] = 54,
  114. }
  115.  
  116. g.AdminRanks = {
  117.     ["admin"] = true,
  118.     ["designer"] = true,
  119.     ["dev"] = true,
  120.     ["developer"] = true,
  121.     ["garry"] = true,
  122.     ["head-admin"] = true,
  123.     ["headadmin"] = true,
  124.     ["manager"] = true,
  125.     ["mod"] = true,
  126.     ["moderator"] = true,
  127.     ["operator"] = true,
  128.     ["owner"] = true,
  129.     ["sadmin"] = true,
  130.     ["server_dev"] = true,
  131.     ["server_developer"] = true,
  132.     ["server_mod"] = true,
  133.     ["server_moderator"] = true,
  134.     ["server_owner"] = true,
  135.     ["super"] = true,
  136.     ["superadmin"] = true,
  137.     ["t-admin"] = true,
  138.     ["t-mod"] = true,
  139.     ["tadmin"] = true,
  140.     ["tmod"] = true,
  141.     ["trial-admin"] = true,
  142.     ["trial-mod"] = true,
  143.     ["trialmod"] = true,
  144.     ["trialmoderator"] = true,
  145.     ["vipadmin"] = true,
  146.     ["vipmod"] = true,
  147.     ["vipmoderator"] = true,
  148.     ["vipowner"] = true,
  149.     ["vipsuperadmin"] = true,
  150. }
  151.  
  152. g.Welcome = {
  153.     "vo/ravenholm/madlaugh01.wav",
  154.     "vo/ravenholm/madlaugh02.wav",
  155.     "vo/ravenholm/madlaugh03.wav",
  156.     "vo/ravenholm/madlaugh04.wav",
  157. }
  158.  
  159. g.Spam = {
  160.     g.HackName .. " - Supplying skill since '16.",
  161.     g.HackName .. " - The #1 free GMod cheat.",
  162.     g.HackName .. " - More features than a swiss army knife.",
  163.     g.HackName .. " - Available free from the Steam workshop.",
  164.     g.HackName .. " - steamcommunity.com/groups/CyanideCheats",
  165. }
  166.  
  167. g.Reminders = {
  168.     "Have a suggestion? Then tell us in the Steam group!",
  169.     "Have you joined the Steam group yet?",
  170.     "Have you seen the Steam group yet?",
  171.     "If you find a bug report it over at the Steam group!",
  172.     "Noticed a bug? Tell us over at the Steam group!",
  173.     "Why not join the Steam group?",
  174.     "You can stop these messages by joining the Steam group!",
  175.     "You should totally join the Steam group!",
  176.     "Join the group and get all the latest news!",
  177. }
  178.  
  179. g.Excuses = {
  180.     ["Subscribe"] = "You need to be subscribed to " .. g.HackName .. " for it to work.",
  181.     ["Singleplayer"] = g.HackName .. " won't load in singleplayer.",
  182.     ["Loaded"] = g.HackName .. " is already loaded. Loading it again may cause lag and/or errors.",
  183.     ["Anticheat"] = "An anti-cheat was detected. Disconnecting to prevent being banned.",
  184.     ["FakeVAC"] = "#VAC_ConnectionRefusedDetail"
  185. }
  186.  
  187. g.MeleeWeps = {
  188.     [1] = "weapon_fists",
  189.     [2] = "weapon_stunstick",
  190.     [3] = "weapon_ttt_axe",
  191.     [4] = "weapon_ttt_knife",
  192.     [5] = "weapon_ttt_unarmed",
  193.     [6] = "weapon_crowbar",
  194.     [7] = "weapon_zm_carry",
  195.     [8] = "weapon_zm_improvised",
  196.     [9] = "pocket",
  197.     [10] = "keys",
  198.     [11] = "gmod_tool",
  199.     [12] = "gmod_camera",
  200.     [13] = "unarrest_stick",
  201.     [14] = "arrest_stick",
  202.     [15] = "stunstick",
  203.     [16] = "weapon_mu_knife",
  204. }
  205.  
  206. g.Options = {
  207.     ["Aimbot"] = {
  208.         ["Active"] = {"Checkbox", "Aimbot", false, "Master toggle for the aimbot.", 1},
  209.         ["OnKey"] = {"Checkbox", "On Key", false, "Makes the aimbot only target people when a certain key is pressed.", 2},
  210.         ["CheckFOV"] = {"Checkbox", "Check FOV", false, "Makes the aimbot only target targets inside the specified Aim FOV.", 3},
  211.         ["Silent"] = {"Checkbox", "Silent", false, "Makes the aimbot invisible to you and only you.", 4},
  212.         ["SlowAim"] = {"Checkbox", "Human Aim", false, "Makes the aimbot look more human.", 5},
  213.         ["AutoShoot"] = {"Checkbox", "Auto Shoot", false, "Makes the aimbot automatically shoot.", 6},
  214.         ["AutoStop"] = {"Checkbox", "Auto Stop", false, "Makes you stop moving when the aimbot has a target.", 7},
  215.         ["AutoDuck"] = {"Checkbox", "Auto Crouch", false, "Makes you crouch when the aimbot has a target.", 8},
  216.         ["RapidShoot"] = {"Checkbox", "Rapid Fire", false, "Makes the aimbot shoot weapons as fast as possible.", 9},
  217.         ["IgnoreBot"] = {"Checkbox", "Ignore Bots", false, "Makes the aimbot ignore bots.", 10},
  218.         ["IgnoreNPC"] = {"Checkbox", "Ignore NPCs", false, "Makes the aimbot ignore NPCs.", 11},
  219.         ["IgnoreTeam"] = {"Checkbox", "Ignore Team", false, "Makes the aimbot ignore teammates.", 12},
  220.         ["IgnoreFriend"] = {"Checkbox", "Ignore Friends", false, "Makes the aimbot ignore Steam friends.", 13},
  221.         ["IgnoreDetective"] = {"Checkbox", "Ignore Detectives", false, "Makes the aimbot ignore detectives in TTT.", 14},
  222.        
  223.         ["TargetType"] = {"Selection", "Target Priority", "FOV", {"FOV", "Distance", "Health"}, 1},
  224.         ["AimPos"] = {"Selection", "Target Position", "Head", {"Head", "Body", "Auto"}, 2},
  225.        
  226.         ["AimFOV"] = {"Slider", "Aim FOV", 8, {1, 180, 0}, 3},
  227.         ["SlowSpeed"] = {"Slider", "Aim Speed", 0.05, {0.01, 0.99, 2}, 4},
  228.     },
  229.    
  230.     ["Triggerbot"] = {
  231.         ["Active"] = {"Checkbox", "Triggerbot", false, "Master toggle for the triggerbot.", 1},
  232.         ["OnKey"] = {"Checkbox", "On Key", false, "Makes the triggerbot only work when a certain key is presses.", 2},
  233.         ["RapidShoot"] = {"Checkbox", "Rapid Fire", false, "Makes the triggerbot shoots weapons as fast as possible.", 3},
  234.         ["SlowAim"] = {"Checkbox", "Slow Aim", false, "Slows your mouse when you're hovering over a valid target.", 4},
  235.         ["TrigAim"] = {"Checkbox", "Trigger Aim", false, "Makes you snap to the target's aim pos when you're hovering over a valid target.", 5},
  236.         ["IgnoreBot"] = {"Checkbox", "Ignore Bots", false, "Makes the triggerbot ignore bots.", 6},
  237.         ["IgnoreNPC"] = {"Checkbox", "Ignore NPCs", false, "Makes the triggerbot ignore NPCs.", 7},
  238.         ["IgnoreTeam"] = {"Checkbox", "Ignore Team", false, "Makes the triggerbot ignore teammates.", 8},
  239.         ["IgnoreFriend"] = {"Checkbox", "Ignore Friends", false, "Makes the triggerbot ignore Steam friends.", 9},
  240.         ["IgnoreDetective"] = {"Checkbox", "Ignore Detectives", false, "Makes the triggerbot ignore detectives in TTT.", 10},
  241.        
  242.         ["TrigFilter"] = {"Selection", "Trigger Filter", "Head", {"Head", "Body"}, 1},
  243.     },
  244.    
  245.     ["ESP"] = {
  246.         ["Active"] = {"Checkbox", "ESP", false, "Master toggle for the ESP.", 1},
  247.         ["ShowNPC"] = {"Checkbox", "Show NPCs", false, "Draws NPCs through walls.", 2},
  248.         ["ShowLoot"] = {"Checkbox", "Show Loot", false, "Draws knives, magnums and clues through walls in Murder.", 3},
  249.         ["ShowProp"] = {"Checkbox", "Show Props", false, "Draws props through walls.", 4},
  250.         ["ShowPlayer"] = {"Checkbox", "Show Players", false, "Draws players through walls.", 5},
  251.         ["IgnoreTeam"] = {"Checkbox", "Ignore Team", false, "Makes the ESP ignore teammates. Doesn't affect the radar.", 6},
  252.         ["Box"] = {"Checkbox", "Box", false, "Draws a box around entities.", 7},
  253.         ["Snapline"] = {"Checkbox", "Snaplines", false, "Draws a line from you to all entities.", 8},
  254.         ["ChamsP"] = {"Checkbox", "Chams", false, "Draws an entity's model through walls.", 9},
  255.         ["ChamsW"] = {"Checkbox", "Weapon Chams", false, "Draws an entity's weapon model through walls.", 10},
  256.         ["HaloP"] = {"Checkbox", "Halo", false, "Draws an entity's outline through walls.", 11},
  257.         ["HaloW"] = {"Checkbox", "Weapon Halo", false, "Draws an entity's weapon outline through walls.", 12},
  258.         ["Skeleton"] = {"Checkbox", "Skeleton", false, "Draws an entity's skeleton through walls.", 13},
  259.         ["Hitbox"] = {"Checkbox", "Hitbox", false, "Draws an entity's hitbox through walls.", 14},
  260.         ["Barrel"] = {"Checkbox", "Barrel", false, "Draws a line from an entity's eyes to where they're looking.", 15},
  261.         ["Name"] = {"Checkbox", "Names", false, "Draws an entity's name or class.", 16},
  262.         ["SteamID"] = {"Checkbox", "SteamID", false, "Draws a player's SteamID.", 17},
  263.         ["UserGroup"] = {"Checkbox", "Rank", false, "Draws a player's user group.", 18},
  264.         ["Health"] = {"Checkbox", "Health", false, "Draws an entity's health points.", 19},
  265.         ["Armour"] = {"Checkbox", "Armour", false, "Draws an entity's armour points.", 20},
  266.         ["Weapon"] = {"Checkbox", "Weapon", false, "Draws an entity's active weapon.", 21},
  267.         ["Ping"] = {"Checkbox", "Ping", false, "Draws a player's ping.", 22},
  268.         ["Healthbar"] = {"Checkbox", "Healthbar", false, "Indicates how much health an entity has in bar form", 23},
  269.         ["Distance"] = {"Checkbox", "Distance", false, "Indicates how far away an entity is from you.", 24},
  270.         ["Lamp"] = {"Checkbox", "Dynamic Lamp", false, "Makes entities glow and draws a faint trail behind them", 25},
  271.        
  272.         ["BoxType"] = {"Selection", "Box Type", "2D", {"2D", "3D"}, 1},
  273.         ["SnaplineStart"] = {"Selection", "Snapline Type", "Bottom", {"Bottom", "Centre"}, 2},
  274.         ["ESPColour"] = {"Selection", "ESP Colour", "Team", {"Team", "Health"}, 3},
  275.         ["TextColour"] = {"Selection", "Text Colour", "Team", {"White", "Team"}, 4},
  276.         ["TextPos"] = {"Selection", "Text Position", "Centred", {"Centred", "Not-Centred"}, 5},
  277.        
  278.         ["LampSize"] = {"Slider", "Lamp Size", 2, {1, 10, 0}, 6},
  279.     },
  280.    
  281.     ["Visuals"] = {
  282.         ["Active"] = {"Checkbox", "Visuals", false, "Master toggle for the visuals.", 1},
  283.         ["NoSky"] = {"Checkbox", "Skybox", false, "Changes the 2D skybox.", 2},
  284.         ["Laser"] = {"Checkbox", "Laser Sight", false, "Adds a laser from your gun to where you're aiming.", 3},
  285.         ["Crosshair"] = {"Checkbox", "Crosshair", false, "Draws a crosshair in the middle of your screen.", 4},
  286.         ["NoRecoil"] = {"Checkbox", "No Recoil", false, "Makes recoil invisible.", 5},
  287.         ["Radar"] = {"Checkbox", "Radar", false, "Draws a movable radar on your screen.", 6},
  288.         ["SpyCam"] = {"Checkbox", "Mirror", false, "Draws a movable mirror on your screen that lets you see behind you.", 7},
  289.         ["ASUSW"] = {"Checkbox", "ASUS Walls", false, "Makes walls semi-transparent.", 8},
  290.         ["ASUSP"] = {"Checkbox", "ASUS Props", false, "Makes props semi-transparent.", 9},
  291.         ["Fullbright"] = {"Checkbox", "Fullbright", false, "Removes any shadows from the map making it appear \"bright\".", 10},
  292.         ["DrawFOV"] = {"Checkbox", "Aim FOV", false, "Draws the aim FOV. This isn't 100% accurate.", 11},
  293.        
  294.         ["SkyType"] = {"Selection", "Skybox Type", "None", {"None", "Rainbow", "Rave"}, 1},
  295.         ["CrosshairStyle"] = {"Selection", "Crosshair Style", "Dot", {"Dot", "Basic", "Generic"}, 2},
  296.        
  297.         ["RadarSize"] = {"Slider", "Radar Size", 125, {100, 300, 0}, 3},
  298.         ["ASUSOpacity"] = {"Slider", "ASUS Opacity", 0.75, {0.01, 0.99, 2}, 4},
  299.     },
  300.    
  301.     ["Miscellaneous"] = {
  302.         ["Active"] = {"Checkbox", "Miscellaneous", false, "Master toggle for miscellaneous features.", 1},
  303.         ["Bunnyhop"] = {"Checkbox", "Bunnyhop", false, "Allows you to continuously jump just by holding the jump key.", 2},
  304.         ["DuckJump"] = {"Checkbox", "Crouch Jump", false, "Makes you crouch when you jump making you jump as high as possible.", 3},
  305.         ["AutoStrafe"] = {"Checkbox", "Auto Strafe", false, "Automatically makes you move to where your mouse is whilst in the air.", 4},
  306.         ["RapidShoot"] = {"Checkbox", "Rapid Fire", false, "Makes you shoot weapons as fast as possible.", 5},
  307.         ["UseSpam"] = {"Checkbox", "Use Spam", false, "Spams the 'Use Item' key at a humanly impossible rate.", 6},
  308.         ["FlashSpam"] = {"Checkbox", "Flash Spam", false, "Spams your flashlight on/off.", 7},
  309.         ["ChatSpam"] = {"Checkbox", "Chat Spam", false, "Spams the chat with random messages.", 8},
  310.         ["AutoReload"] = {"Checkbox", "Auto Reload", false, "Makes you reload your weapon when it needs to be reloaded.", 9},
  311.         ["Hitsound"] = {"Checkbox", "Hitsounds", false, "Plays a hitsound when you damage a player.", 10},
  312.         ["AdminCheck"] = {"Checkbox", "Admin Detector", false, "Detects admins on the server and notifies you of them.", 11},
  313.         ["SpecCheck"] = {"Checkbox", "Spectator Detector", false, "Detects people spectating you and notifies you of them.", 12},
  314.         ["NameStealer"] = {"Checkbox", "Name Stealer", false, "Makes you \"steal\" players' names. Only works on DarkRP without amplify.", 13},
  315.         ["CopyCat"] = {"Checkbox", "Copycat", false, "Copies what people say in chat and repeats it in quote format.", 14},
  316.         ["ThirdPerson"] = {"Checkbox", "Thirdperson", false, "Puts your camera into thirdperson view.", 15},
  317.         ["PlyList"] = {"Checkbox", "Player List", false, "Lets you view an interactive list of players.", 16},
  318.         ["Camera"] = {"Checkbox", "Free Cam", false, "Lets you fly around the map as a ghost.", 17},
  319.         ["DeathNotify"] = {"Checkbox", "Death Alerts", false, "Tells you when somebody is killed or dies.", 18},
  320.         ["TFinder"] = {"Checkbox", "Traitor Finder", false, "Tells you who's a traitor when they buy a weapon in TTT.", 19},
  321.         ["MFinder"] = {"Checkbox", "Murderer Finder", false, "Tells you who's a murderer when a round starts in Murder.", 20},
  322.         ["Spinbot"] = {"Checkbox", "Spinbot", false, "Makes you look like you're spinning to other players.", 21},
  323.         ["CustomFOV"] = {"Checkbox", "Custom FoV", false, "Lets you have an FoV you wouldn't normally be able to have.", 22},
  324.        
  325.         ["HitsoundType"] = {"Selection", "Hitsound Type", "TF2", {"Overwatch", "Quake", "TF2", "Dark Souls"}, 1},
  326.        
  327.         ["FOV"] = {"Slider", "Custom FoV", 90, {50, 179, 0}, 2},
  328.     },
  329. }
  330.  
  331. g.Binds = {
  332.     ["AimKey"] = KEY_V,
  333.     ["FlashKey"] = KEY_F,
  334.     ["FreeCam"] = KEY_B,
  335.     ["MenuKey"] = KEY_INSERT,
  336.     ["TrigKey"] = KEY_V,
  337. }
  338.  
  339. g.RadarPos = {
  340.     ["x"] = 150,
  341.     ["y"] = 150,
  342. }
  343.  
  344. g.MirrorPos = {
  345.     ["x"] = g.ScrW() * .5 + 2,
  346.     ["y"] = 175 * .5 + 2,
  347. }
  348.  
  349. g.Colours = {
  350.     ["Dev"]         = {g.Color(169, 162, 206), g.Color(130, 104, 169)},
  351.     ["Enemy"]       = {g.Color(217, 68, 74), g.Color(66, 0, 1)},
  352.     ["Friendly"]    = {g.Color(41, 107, 165), g.Color(67, 0, 102)},
  353.     ["Misc"]        = {g.Color(255, 255, 100), g.Color(255, 128, 0)},
  354.     ["Special"]     = {g.Color(135, 152, 119), g.Color(16, 74, 49)},
  355.     ["Loot"]        = {g.Color(148, 215, 218), g.Color(1, 159, 180)},
  356.    
  357.     ["Menu"] = {
  358.         ["Main"]    = g.Color(58, 97, 130),
  359.         ["Tab"]     = g.Color(58, 97, 130, 150),
  360.     },
  361.    
  362.     ["Radar"]       = g.Color(60, 60, 60, 180),
  363.     ["Watermark"]   = g.Color(58, 97, 130, 100),
  364.    
  365.     ["Black"]       = g.Color(0, 0, 0),
  366.     ["Navy"]        = g.Color(58, 97, 130),
  367.     ["Red"]         = g.Color(250, 50, 50),
  368.     ["White"]       = g.Color(255, 255, 255),
  369. }
  370.  
  371. --[[
  372.    
  373.     'IS' AND 'CAN' CHECKS
  374.    
  375. ]]--
  376. function g.IsMelee(wep)
  377.     if not (g.IsValid(wep)) then return end
  378.    
  379.     for k, v in g.ipairs(g.MeleeWeps) do
  380.         if (wep:GetClass() == v) then
  381.             return true
  382.         end
  383.     end
  384. end
  385.  
  386. function g.IsKeyDown(key)
  387.     if (g.IsTyping) then return end
  388.     if (g.gui.IsGameUIVisible()) then return end
  389.     if (g.gui.IsConsoleVisible()) then return end
  390.    
  391.     if (g.string.find(g.string.lower(g.input.GetKeyName(key)), "mouse")) then
  392.         return g.input.IsMouseDown(key)
  393.     end
  394.    
  395.     return g.input.IsKeyDown(key)
  396. end
  397.  
  398. function g._IsValid(v)
  399.     if (v:IsPlayer()) then
  400.         return (v ~= ply and g.IsValid(v) and v:Alive() and v:Health() > 0 and not v:IsDormant() and ply:GetObserverTarget() ~= v and v:GetMoveType() ~= 10)
  401.     elseif (v:IsNPC()) then
  402.         return (g.IsValid(v) and v:Health() > 0 and not v:IsDormant())
  403.     end
  404. end
  405.  
  406. function g.IsDev(v)
  407.     return (v:IsPlayer() and v:SteamID64() == g.MySteamID)
  408. end
  409.  
  410. function g.IsProp(v)
  411.     return (v:GetClass() == "prop_physics")
  412. end
  413.  
  414. function g.IsMurderProp(v)
  415.     if not (g.engine.ActiveGamemode() == "murder") then return end
  416.     return (not v:GetOwner():IsPlayer() and (v:GetClass() == "mu_loot" or v:GetClass() == "weapon_mu_magnum" or v:GetClass() == "weapon_mu_knife"))
  417. end
  418.  
  419. function g.IsRP()
  420.     return g.string.find(g.string.lower(g.engine.ActiveGamemode()), "rp")
  421. end
  422.  
  423. function g.CanFire()
  424.     local wep = ply:GetActiveWeapon()
  425.    
  426.     return (ply:Alive() and g.IsValid(wep) and wep:GetNextPrimaryFire() < g.ServerCurTime)
  427. end
  428.  
  429. function g.CanSpin(cmd)
  430.     return (ply:WaterLevel() < 2 and ply:GetMoveType() ~= 8 and ply:GetMoveType() ~= 9 and ply:GetMoveType() ~= 10 and not g.Aimbotting and not (cmd:KeyDown(IN_ATTACK) and g.CanFire()) and not cmd:KeyDown(IN_USE))
  431. end
  432.  
  433. function g.CanHop()
  434.     return (not g.IsTyping and not g.gui.IsConsoleVisible() and not ply:OnGround() and ply:WaterLevel() < 2 and ply:GetMoveType() ~= 8 and ply:GetMoveType() ~= 9)
  435. end
  436.  
  437. function g.CanStrafe()
  438.     return (ply:WaterLevel() < 2 and not ply:OnGround() and ply:GetMoveType() ~= 8 and ply:GetMoveType() ~= 9 and ply:GetMoveType() ~= 10)
  439. end
  440.  
  441. function g.CanAimbot()
  442.     return (not g.IsTyping and not g.gui.IsConsoleVisible() and ply:Alive() and ply:Health() > 0 and not g.MenuOpen and ply:GetMoveType() ~= 8 and ply:GetMoveType() ~= 10 and not FreeCam)
  443. end
  444.  
  445. function g.CanDraw(v)
  446.     return (g._IsValid(v) and ((g.GetValue("ESP", "ShowNPC") and v:IsNPC()) or (g.GetValue("ESP", "ShowPlayer") and v:IsPlayer())))
  447. end
  448.  
  449. --[[
  450.    
  451.     MISCELLANEOUS FUNCTIONS
  452.    
  453. ]]--
  454. function g.GetValue(k, _k)
  455.     return g.Options[k][_k][3]
  456. end
  457.  
  458. function g._IsAdmin(v)
  459.     return (v:IsAdmin() or v:IsSuperAdmin() or g.AdminRanks[g.string.lower(v:GetUserGroup())])
  460. end
  461.  
  462. function g.SaveConfig()
  463.     local save = {}
  464.     save.Options = g.Options
  465.     save.Binds = g.Binds
  466.     save.Radar = g.RadarPos
  467.     save.Mirror = g.MirrorPos
  468.    
  469.     g.file.Write(g.HackName .. "_" .. g.Version .. ".txt", g.util.TableToJSON(save))
  470. end
  471.  
  472. function g.LoadConfig()
  473.     if not (g.file.Exists(g.HackName .. "_" .. g.Version .. ".txt", "DATA")) then g.SaveConfig() return end
  474.    
  475.     local load = g.util.JSONToTable(g.file.Read(g.HackName .. "_" .. g.Version .. ".txt", "DATA"))
  476.     g.Options = load.Options
  477.     g.Binds = load.Binds
  478.     g.RadarPos = load.Radar
  479.     g.MirrorPos = load.Mirror
  480. end
  481.  
  482. function g.GetNames()
  483.     g.http.Fetch("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" .. g.Key .. "&steamids=" .. g.MySteamID,
  484.         function(body)
  485.             local tbe = g.util.JSONToTable(body)
  486.             if not (tbe) then return end
  487.             local MyName = tbe.response.players[1].personaname
  488.            
  489.             g.ChatNotify(g.HackName .. ", created by " .. MyName .. ".")
  490.         end,
  491.        
  492.         function()
  493.         end
  494.     )
  495.    
  496.     g.http.Fetch("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" .. g.Key .. "&steamids=" .. ply:SteamID64(),
  497.         function(body)
  498.             local ale = g.util.JSONToTable(body)
  499.             if not (ale) then return end
  500.             local PlyName = ale.response.players[1].personaname
  501.            
  502.             g.LocalName = PlyName
  503.         end,
  504.        
  505.         function()
  506.         end
  507.     )
  508. end
  509.  
  510. function g.OpenSite() -- Moku was gettin mad at me cos I wasn't crediting him for "his" idea. So creds to him.
  511.     if not (g.SiteOpen) then
  512.         local VidLen, VidID = g.table.Random(g.VideoIDs)
  513.        
  514.         g.Time = g.CurTime() + VidLen
  515.         g.SiteOpen = true
  516.        
  517.         local HTML = g.vgui.Create("HTML")
  518.         HTML:OpenURL("https://www.youtube.com/embed/" .. VidID .. "?autoplay=1")
  519.         HTML:Dock(FILL)
  520.        
  521.         local blocker = g.vgui.Create("DPanel", HTML)
  522.         blocker:Dock(FILL)
  523.        
  524.         function blocker.Paint()
  525.         end
  526.        
  527.         g.timer.Simple(g.Time, function()
  528.             g.print(g.Excuses["FakeVAC"])
  529.             ply:ConCommand("disconnect")
  530.         end)
  531.     end
  532. end
  533.  
  534. function g.FakeLag(cmd)
  535.     if not (g.InGroup) then return end
  536.     if not (_Modules["amplify"]) then return end
  537.     if (cmd:CommandNumber() == 0) then return end
  538.    
  539.     g.TickCount = g.math.floor((g.TickCount + 1) % 14)
  540.     g.SendPacket(g.TickCount == 0)
  541. end
  542.  
  543. function g.RandomString()
  544.     local str = ""
  545.    
  546.     for i = 1, 15 do
  547.         str = str .. g.string.char(g.math.random(32, 126))
  548.     end
  549.    
  550.     return str
  551. end
  552.  
  553. function g.ChatNotify(str)
  554.     g.chat.AddText(g.Colours["Navy"], "[" .. g.HackName .. "] ", g.Colours["White"], str)
  555. end
  556.  
  557. function g.ChatAlert(str)
  558.     g.chat.AddText(g.Colours["Red"], "[" .. g.HackName .. "] ", g.Colours["White"], str)
  559.     g.surface.PlaySound("npc/scanner/combat_scan1.wav")
  560. end
  561.  
  562. function g.FirstTime()
  563.     if (g.cookie.GetString("FirstTime") ~= "naw") then
  564.         g.cookie.Set("FirstTime", "naw")
  565.        
  566.         g.ChatNotify("Thank you for using " .. g.HackName .. "!")
  567.         g.ChatNotify("Press 'home' to toggle the menu, even if it isn't your designated menu key.")
  568.         g.ChatNotify("If you ever have a problem or a suggestion share it with the Steam group.")
  569.        
  570.         --g.ActiveTab = "FirstTime"
  571.     end
  572. end
  573.  
  574. function g.InGroup()
  575.     g.http.Fetch("https://control.pococraft.org/inDevelWorkingDir/xmltojson.php?xml=http://steamcommunity.com/gid/" .. g.GroupID .. "/memberslistxml/?xml=1",
  576.         function(body)
  577.             local tbl = g.util.JSONToTable(body)
  578.             if not (tbl) then return end
  579.             local steamid = tbl.memberList.members.steamID64
  580.            
  581.             for k, v in g.next, steamid do
  582.                 if (v == ply:SteamID64()) then
  583.                     g.InGroup = true
  584.                     break
  585.                 end
  586.             end
  587.            
  588.             if not (g.InGroup) then
  589.                 g.ChatAlert(g.ChatNotify(g.Reminders[g.math.random(#g.Reminders)]))
  590.             end
  591.         end,
  592.        
  593.         function()
  594.         end
  595.     )
  596. end
  597.  
  598. function g.MoveUI()
  599.     local x, y = g.gui.MousePos()
  600.     local w, h = g.ScrW(), g.ScrH()
  601.     g.RadarSize = g.GetValue("Visuals", "RadarSize")
  602.     g.MirrorSize = {mw = 500 * .5 + 2, mh = 175 * .5 + 2}
  603.    
  604.     if (g.input.IsMouseDown(MOUSE_LEFT) and (g.MenuOpen or g.Scoreboard)) then
  605.         if (g.RadarGrab and g.GetValue("Visuals", "Radar")) then
  606.             g.RadarPos["x"] = g.math.Clamp(x - radar_x, g.RadarSize, w - g.RadarSize)
  607.             g.RadarPos["y"] = g.math.Clamp(y - radar_y, g.RadarSize, h - g.RadarSize)
  608.            
  609.             return
  610.         end
  611.        
  612.         if (g.MirrorGrab and g.GetValue("Visuals", "SpyCam")) then
  613.             g.MirrorPos["x"] = g.math.Clamp(x - mirror_x, g.MirrorSize.mw, w - g.MirrorSize.mw)
  614.             g.MirrorPos["y"] = g.math.Clamp(y - mirror_y, g.MirrorSize.mh, h - g.MirrorSize.mh)
  615.            
  616.             return
  617.         end
  618.        
  619.         if (not g.RadarGrab and (g.RadarPos["x"] - g.RadarSize) < x and (g.RadarPos["x"] + g.RadarSize) > x and (g.RadarPos["y"] - g.RadarSize) < y and (g.RadarPos["y"] + g.RadarSize) > y) then
  620.             radar_x = x - g.RadarPos["x"]
  621.             radar_y = y - g.RadarPos["y"]
  622.            
  623.             g.RadarGrab = true
  624.         end
  625.        
  626.         if (not g.MirrorGrab and (g.MirrorPos["x"] - g.MirrorSize.mw - 2) < x and (g.MirrorPos["x"] + g.MirrorSize.mw - 2) > x and (g.MirrorPos["y"] - g.MirrorSize.mh - 2) < y and (g.MirrorPos["y"] + g.MirrorSize.mh - 2) > y) then
  627.             mirror_x = x - g.MirrorPos["x"]
  628.             mirror_y = y - g.MirrorPos["y"]
  629.            
  630.             g.MirrorGrab = true
  631.         end
  632.     else
  633.         g.RadarGrab = false
  634.         g.MirrorGrab = false
  635.     end
  636. end
  637.  
  638. function g.AddHook(event_name, func)
  639.     local name = g.RandomString()
  640.    
  641.     hook.Add(event_name, name, func)
  642.    
  643.     if not (_Hooks[event_name]) then
  644.         _Hooks[event_name] = {}
  645.     end
  646.    
  647.     _Hooks[event_name][name] = func
  648. end
  649.  
  650. function g.StrafeDir(vel, ang)
  651.     vel:Rotate(-ang)
  652.    
  653.     if (vel.x < 0) then
  654.         return -1
  655.     end
  656.    
  657.     return 1
  658. end
  659.  
  660. function g.CheckTeam(v)
  661.     if not (v:IsPlayer()) then
  662.         return false
  663.     end
  664.    
  665.     if (v == ply) then
  666.         return true
  667.     end
  668.    
  669.     if (g.engine.ActiveGamemode() == "terrortown") then
  670.         if (v.Detected and not ply:IsTraitor()) then
  671.             return false
  672.         elseif (ply:IsTraitor() and not v:IsTraitor()) then
  673.             return false
  674.         end
  675.        
  676.         return true
  677.     elseif (g.engine.ActiveGamemode() == "murder") then
  678.         if (ply:HasWeapon("weapon_mu_knife")) then
  679.             return false
  680.         end
  681.        
  682.         return not v.Detected
  683.     else
  684.         return ply:Team() == v:Team()
  685.     end
  686. end
  687.  
  688. function g.Colour(v)
  689.     if (v:IsPlayer()) then
  690.         if (v == ply) then
  691.             return g.Colours["Navy"], g.Colours["Navy"]
  692.         end
  693.        
  694.         if (g.IsDev(v)) then
  695.             return g.Colours["Dev"][1], g.Colours["Dev"][2]
  696.         end
  697.        
  698.         if (g.engine.ActiveGamemode() == "terrortown" and v:IsDetective() or v.Special) then
  699.             return g.Colours["Special"][1], g.Colours["Special"][2]
  700.         end
  701.        
  702.         if (g.CheckTeam(v)) then
  703.             return g.Colours["Friendly"][1], g.Colours["Friendly"][2]
  704.         else
  705.             return g.Colours["Enemy"][1], g.Colours["Enemy"][2]
  706.         end
  707.     else
  708.         if (g.IsMurderProp(v)) then
  709.             return g.Colours["Loot"][1], g.Colours["Loot"][2]
  710.         end
  711.        
  712.         return g.Colours["Misc"][1], g.Colours["Misc"][2]
  713.     end
  714. end
  715.  
  716. function g.MousePos(num)
  717.     if (num > 0) then
  718.         return false
  719.     end
  720.    
  721.     return true
  722. end
  723.  
  724. function g.Status(v)
  725.     local res = ""
  726.     local sweg = false
  727.    
  728.     if (v == ply) then
  729.         return "You"
  730.     end
  731.    
  732.     if (g.IsDev(v)) then
  733.         return "Developer"
  734.     end
  735.    
  736.     if (v.Confirmed1) then
  737.         res = res .. "Admin, "
  738.         sweg = true
  739.     end
  740.    
  741.     if (v.Confirmed2) then
  742.         res = res .. "Spectating, "
  743.         sweg = true
  744.     end
  745.    
  746.     if (v:IsMuted()) then
  747.         res = res .. "Muted, "
  748.         sweg = true
  749.     end
  750.    
  751.     if (v.Ignore) then
  752.         res = res .. "Ignored, "
  753.         sweg = true
  754.     end
  755.    
  756.     if (v.Special) then
  757.         res = res .. "Marked, "
  758.         sweg = true
  759.     end
  760.    
  761.     if not (sweg) then
  762.         return "Normal"
  763.     end
  764.    
  765.     return res
  766. end
  767.  
  768. function g.MoveFix(cmd)
  769.     if (ply:GetMoveType() == 8) then return end
  770.     if (ply:GetMoveType() == 10) then return end
  771.    
  772.     local fixed = g.Vector(cmd:GetForwardMove(), cmd:GetSideMove(), 0)
  773.     fixed = ((fixed:GetNormal()):Angle() + (cmd:GetViewAngles() - g.Angle(0, g.FakeAng.y, 0))):Forward() * fixed:Length()
  774.    
  775.     cmd:SetForwardMove(fixed.x)
  776.     cmd:SetSideMove(fixed.y)
  777. end
  778.  
  779. function g.Compensate(cmd, ang)
  780.     local wep = LocalPlayer():GetActiveWeapon()
  781.     if (!IsValid(wep) or !cones[wep:GetClass()]) then return ang end
  782.    
  783.     return g.predSpread(cmd, ang:Forward(), cones[wep:GetClass()]):Angle()
  784. end
  785.  
  786. function g.FakeView(cmd)
  787.     g.FakeAng.p = g.math.Clamp(g.FakeAng.p + (cmd:GetMouseY() * g.YawSens), -89, 89)
  788.     g.FakeAng.y = g.math.NormalizeAngle(g.FakeAng.y + (cmd:GetMouseX() * -g.YawSens))
  789.     g.FakeAng.r = 0
  790.    
  791.     if (_Modules["dickwrap"] and cmd:KeyDown(IN_ATTACK) and cmd:CommandNumber() != 0 and not g.Aimbotting and g.InGroup) then
  792.         cmd:SetViewAngles(g.Compensate(cmd, g.FakeAng))
  793.     end
  794.    
  795.     if (cmd:CommandNumber() == 0 and not g.Holding) then
  796.         cmd:SetViewAngles(g.FakeAng)
  797.     end
  798. end
  799.  
  800. function g.Require(dll)
  801.     if (g.file.Exists("lua/bin/gmcl_" .. dll .. "_win32.dll", "MOD")) then
  802.         if (g.system.IsWindows()) then
  803.             g.require(dll)
  804.             g.ChatNotify("Module '" .. dll .. "' is installed.")
  805.            
  806.             _Modules[dll] = true
  807.         else
  808.             g.ChatAlert("'" .. dll .. "' will only work on the Windows operating system.")
  809.         end
  810.     end
  811. end
  812.  
  813. function g.UnRequire(dll) -- not mine but can't remember where I got it from.
  814.     local _R = g.debug.getregistry()
  815.     local modMeta = _R["_LOADLIB"]
  816.    
  817.     for key, ud in g.pairs(_R) do
  818.         if (g.type(key) == "string" and key:find("^LOADLIB: .+gm%w%w_" .. dll .. "_%w+%.dll$") and g.type(ud) == "_LOADLIB" and g.getmetatable(ud) == modMeta) then
  819.             _Modules[dll] = nil
  820.            
  821.             _R[key], _MODULES[dll] = nil, nil
  822.             modMeta.__gc(ud)
  823.         end
  824.     end
  825. end
  826.  
  827. function g.DrawArrow(x, y, ang, col)
  828.     local arrow = {
  829.         {x = x, y = y},
  830.         {x = x + 6, y = y + 12},
  831.         {x = x + 5, y = y + 12},
  832.         {x = x, y = y + 10},
  833.         {x = x - 5, y = y + 12},
  834.         {x = x - 6, y = y + 12},
  835.     }
  836.    
  837.     -- Credits to Atheon for the angle shit.
  838.     ang = ang - ply:EyeAngles().y
  839.     ang = g.math.rad(-ang)
  840.    
  841.     for i = 1, #arrow do
  842.         local posX = arrow[i].x
  843.         local posY = arrow[i].y
  844.        
  845.         posX = posX - x
  846.         posY = posY - y
  847.        
  848.         arrow[i].x = posX * g.math.cos(ang) - posY * g.math.sin(ang)
  849.         arrow[i].y = posX * g.math.sin(ang) + posY * g.math.cos(ang)
  850.        
  851.         arrow[i].x = arrow[i].x + x
  852.         arrow[i].y = arrow[i].y + y
  853.     end
  854.    
  855.     g.draw.NoTexture()
  856.     g.surface.SetDrawColor(col)
  857.     g.surface.DrawPoly(arrow)
  858. end
  859.  
  860. function g.PrecacheCircle(x, y, radius)
  861.     local circle = {}
  862.     local inner = {}
  863.     local outer = {}
  864.    
  865.     local r = radius - 1
  866.    
  867.     for i = 0, 360, 5 do
  868.         local rad = g.math.rad(i)
  869.         local ox, oy = x + (g.math.cos(rad) * r), y + (-g.math.sin(rad) * r)
  870.        
  871.         inner[#inner + 1] = {x = ox, y = oy}
  872.     end
  873.    
  874.     for i = 0, 360, 5 do
  875.         local rad = g.math.rad(i)
  876.         local ox, oy = x + (g.math.cos(rad) * radius), y + (-g.math.sin(rad) * radius)
  877.        
  878.         outer[#outer + 1] = {x = ox, y = oy}
  879.     end
  880.    
  881.     for i = 1, #inner * 2 do
  882.         local v1, v2, v3
  883.         v1 = outer[g.math.floor(i / 2) + 1]
  884.         v3 = inner[g.math.floor((i + 1) / 2) + 1]
  885.        
  886.         if (i % 2 == 0) then
  887.             v2 = outer[g.math.floor((i + 1) / 2)]
  888.         else
  889.             v2 = inner[g.math.floor((i + 1) / 2)]
  890.         end
  891.        
  892.         circle[#circle + 1] = {v1, v2, v3}
  893.     end
  894.    
  895.     return circle
  896. end
  897.  
  898. function g.GetCircle(cir)
  899.     for k, v in g.ipairs(cir) do
  900.         g.surface.DrawPoly(v)
  901.     end
  902. end
  903.  
  904. function g.DrawCircle(x, y, radius, col)
  905.     g.draw.NoTexture()
  906.     g.surface.SetDrawColor(col)
  907.     g.GetCircle(g.PrecacheCircle(x, y, radius))
  908. end
  909.  
  910. --[[
  911.    
  912.     START-UP
  913.    
  914. ]]--
  915. do
  916.    
  917.     if (g.game.SinglePlayer()) then
  918.         g.ChatAlert(g.Excuses["Singleplayer"])
  919.         return
  920.     end
  921.    
  922.     if (_G.Loaded) then
  923.         g.ChatAlert(g.Excuses["Loaded"])
  924.         return
  925.     end
  926.    
  927.     if (_G.QAC or _G.CAC or _G.cac or _G.qac) then
  928.         g.ChatAlert(g.Excuses["Anticheat"])
  929.         ply:ConCommand("disconnect")
  930.         return
  931.     end
  932.    
  933.     g.Require("cvar3")
  934.     g.Require("amplify")
  935.     g.Require("dickwrap")
  936.    
  937.     if (_Modules["cvar3"]) then
  938.         g.GetConVar("sv_allowcslua"):SetValue(1)
  939.         g.GetConVar("sv_allowcslua"):SetFlags(0)
  940.     end
  941.    
  942.     if (_Modules["amplify"]) then
  943.         g.SendPacket = amplify.SendPacket
  944.         g.ForceVar = amplify.ForceVar
  945.         g.SetName = amplify.SetName
  946.        
  947.         amplify = nil
  948.     end
  949.    
  950.     if (_Modules["dickwrap"]) then
  951.         g.predSpread = dickwrap.Predict
  952.        
  953.         dickwrap = nil
  954.     end
  955.    
  956.     g.InGroup()
  957.     g.GetNames()
  958.     g.FirstTime()
  959.     g.LoadConfig()
  960.     g.surface.PlaySound(g.Welcome[g.math.random(#g.Welcome)])
  961.    
  962.     _G.Loaded = true
  963. end
  964.  
  965. --[[
  966.    
  967.     MENU "HELPER" FUNCTIONS
  968.    
  969. ]]--
  970. function g.OutlinedBox(x, y, w, h, thickness, clr)
  971.     g.surface.SetDrawColor(clr)
  972.    
  973.     for i = 0, thickness - 1 do
  974.         g.surface.DrawOutlinedRect(x + i, y + i, w - i * 2, h - i * 2)
  975.     end
  976. end
  977.  
  978. local blur = g.Material("pp/blurscreen")
  979. function g.DrawBlur(p, a, d)
  980.     local x, y = p:LocalToScreen(0, 0)
  981.    
  982.     g.surface.SetDrawColor(255, 255, 255)
  983.     g.surface.SetMaterial(blur)
  984.    
  985.     for i = 1, d do
  986.         blur:SetFloat("$blur", (i / d) * (a))
  987.         blur:Recompute()
  988.         g.render.UpdateScreenEffectTexture()
  989.         surface.DrawTexturedRect(x * -1, y * -1, g.ScrW(), g.ScrH())
  990.     end
  991. end
  992.  
  993. function g.AddBinder(parent, text, bind, order)
  994.     local x = 10
  995.     local y = 30 + (order - 1) * 30
  996.    
  997.     local binder = g.vgui.Create("DBinder", parent)
  998.     binder:SetFont("MenuFont")
  999.     binder:SetText(text)
  1000.     binder:SetPos(x, y)
  1001.     binder:SetSize(100, 25)
  1002.    
  1003.     function binder:SetSelectedNumber(key)
  1004.         self.m_iSelectedNumber = key
  1005.        
  1006.         if (binder:GetValue() ~= 0) then
  1007.             g.Binds[bind] = key
  1008.             g.ChatNotify(text .. " was bound to '" .. g.string.upper(g.input.GetKeyName(key)) .. "'.")
  1009.         else
  1010.             g.ChatAlert("That isn't a valid key.")
  1011.         end
  1012.     end
  1013. end
  1014.  
  1015. function g.AddTab(parent, text, child, order)
  1016.     local width = 100
  1017.     local gap = 5
  1018.     local x = (order - 1) * (width + gap)
  1019.     local y = 0
  1020.    
  1021.     local tab = g.vgui.Create("DButton", parent)
  1022.     tab:SetFont("MenuFont")
  1023.     tab:SetText(text)
  1024.     tab:SetPos(x, y)
  1025.     tab:SetSize(width, 50)
  1026.     tab:SetTextColor(g.Colours["Black"])
  1027.    
  1028.     function tab.DoClick()
  1029.         g.surface.PlaySound("/buttons/button14.wav")
  1030.         g.ActiveTab = text
  1031.         g.SetActiveTab()
  1032.     end
  1033.    
  1034.     function tab.Paint(self)
  1035.         g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1036.        
  1037.         if (g.ActiveTab == text) then
  1038.             g.draw.RoundedBox(0, 0, self:GetTall() - 10, self:GetWide(), 10, g.Colours["Menu"]["Main"])
  1039.         elseif (self:IsHovered()) then
  1040.             g.draw.RoundedBox(0, 0, self:GetTall() - 10, self:GetWide(), 10, g.Colours["Menu"]["Tab"])
  1041.         end
  1042.        
  1043.         g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 1, g.Colours["Black"])
  1044.     end
  1045. end
  1046.  
  1047. function g.AddCheckbox(k, _k, parent)
  1048.     local x = 10 + (g.math.floor(g.Options[k][_k][5] / 13.5) * 150)
  1049.     local y = 10 - (g.math.floor(g.Options[k][_k][5] / 13.5) * 260) + (g.Options[k][_k][5] - 1) * 20
  1050.    
  1051.     local checkbox = g.vgui.Create("DCheckBoxLabel", parent)
  1052.     checkbox:SetFont("MenuFont")
  1053.     checkbox:SetText(g.Options[k][_k][2])
  1054.     checkbox:SetPos(x, y)
  1055.     checkbox:SetTooltip(g.Options[k][_k][4])
  1056.     checkbox:SizeToContents()
  1057.     checkbox:SetTextColor(g.Colours["Black"])
  1058.     checkbox:SetChecked(g.Options[k][_k][3])
  1059.    
  1060.     function checkbox.OnChange()
  1061.         g.Options[k][_k][3] = checkbox:GetChecked()
  1062.     end
  1063. end
  1064.  
  1065. function g.AddSlider(k, _k, parent)
  1066.     g.surface.SetFont("MenuFont")
  1067.    
  1068.     local x = g.surface.GetTextSize(g.Options[k][_k][2] .. ":") + 5
  1069.     local y = 5 + (g.Options[k][_k][5] - 1) * 30
  1070.    
  1071.     local _slider = g.vgui.Create("DLabel", parent)
  1072.     _slider:SetFont("MenuFont")
  1073.     _slider:SetPos(480 - x, y + 2)
  1074.     _slider:SetColor(g.Colours["Black"])
  1075.     _slider:SetText(g.Options[k][_k][2] .. ":")
  1076.     _slider:SizeToContents()
  1077.    
  1078.     local slider = g.vgui.Create("DNumSlider", parent)
  1079.     slider:SetPos(345, y)
  1080.     slider:SetSize(300, 20)
  1081.     slider:SetMin(g.Options[k][_k][4][1])
  1082.     slider:SetMax(g.Options[k][_k][4][2])
  1083.     slider:SetDecimals(g.Options[k][_k][4][3])
  1084.     slider:SetValue(g.Options[k][_k][3])
  1085.    
  1086.     function slider.OnValueChanged()
  1087.         g.Options[k][_k][3] = slider:GetValue()
  1088.     end
  1089. end
  1090.  
  1091. function g.AddSelection(k, _k, parent)
  1092.     g.surface.SetFont("MenuFont")
  1093.    
  1094.     local x = g.surface.GetTextSize(g.Options[k][_k][2] .. ":") + 5
  1095.     local y = 5 + (g.Options[k][_k][5] - 1) * 30
  1096.    
  1097.     local _selectbox = g.vgui.Create("DLabel", parent)
  1098.     _selectbox:SetFont("MenuFont")
  1099.     _selectbox:SetPos(480 - x, y)
  1100.     _selectbox:SetColor(g.Colours["Black"])
  1101.     _selectbox:SetText(g.Options[k][_k][2] .. ":")
  1102.     _selectbox:SizeToContents()
  1103.    
  1104.     local selectbox = g.vgui.Create("DComboBox", parent)
  1105.     selectbox:SetPos(480, y)
  1106.     selectbox:SetSize(145, 20)
  1107.     selectbox:SetValue(g.Options[k][_k][3])
  1108.    
  1109.     for _, v in g.next, g.Options[k][_k][4] do
  1110.         selectbox:AddChoice(v)
  1111.     end
  1112.    
  1113.     function selectbox.OnSelect()
  1114.         g.Options[k][_k][3] = selectbox:GetSelected()
  1115.     end
  1116. end
  1117.  
  1118. --[[
  1119.    
  1120.     PLAYERLIST
  1121.    
  1122. ]]--
  1123. local list_frame = g.vgui.Create("DFrame")
  1124. list_frame:SetPos(g.ScrW() * .5 + 345, g.ScrH() * .5 - 200)
  1125. list_frame:SetTitle("")
  1126. list_frame:SetSize(200, 400)
  1127. list_frame:SetDraggable(true)
  1128. list_frame:SetScreenLock(true)
  1129. list_frame:ShowCloseButton(false)
  1130.  
  1131. local list = g.vgui.Create("DListView", list_frame)
  1132. list:Dock(FILL)
  1133. list:SetMultiSelect(false)
  1134. list:AddColumn("Name")
  1135. list:AddColumn("Status")
  1136.  
  1137. local block = g.vgui.Create("DPanel", list_frame)
  1138. block:SetPos(0, 25)
  1139. block:SetSize(200, 20)
  1140.  
  1141. function g.RefreshList()
  1142.     list:Clear()
  1143.    
  1144.     list:AddLine(g.LocalName, g.Status(ply), ply)
  1145.    
  1146.     for k, v in g.ipairs(g.player.GetHumans()) do
  1147.         if (v == ply) then continue end
  1148.         list:AddLine(v:Nick(), g.Status(v), v)
  1149.     end
  1150.    
  1151.     for k, line in g.next, list:GetLines() do
  1152.         local v = line:GetValue(3)
  1153.         local teamcol = g.Colour(v)
  1154.        
  1155.         function line:Paint(w, h)          
  1156.             if (not line:IsHovered() and not line:IsSelected()) then
  1157.                 g.draw.RoundedBox(0, 0, 0, w, h, g.Color(teamcol.r, teamcol.g, teamcol.b, 150))
  1158.             end
  1159.            
  1160.             if (line:IsHovered() and not line:IsSelected()) then
  1161.                 g.draw.RoundedBox(0, 0, 0, w, h, g.Color(teamcol.r, teamcol.g, teamcol.b, 200))
  1162.             end
  1163.            
  1164.             if (line:IsSelected()) then
  1165.                 g.draw.RoundedBox(0, 0, 0, w, h, g.Color(teamcol.r, teamcol.g, teamcol.b, 250))
  1166.             end
  1167.         end
  1168.     end
  1169.    
  1170.     for _, v in g.next, list.Columns do
  1171.         function v.Header:Paint(w, h)          
  1172.             g.draw.RoundedBox(0, 0, 0, w, h, g.Colours["White"])
  1173.             g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 1, g.Colours["Black"])
  1174.         end
  1175.        
  1176.         v.Header:SetFont("MenuFont")
  1177.     end
  1178. end
  1179. g.RefreshList()
  1180.  
  1181. function list_frame.Paint(self)
  1182.     g.DrawBlur(self, 3, 6)
  1183.    
  1184.     g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Color(60, 60, 60, 175))
  1185.     g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 2, g.Colours["Menu"]["Main"])
  1186.    
  1187.     g.draw.RoundedBox(0, 0, 0, self:GetWide(), 25, g.Colours["Menu"]["Main"])
  1188.     g.draw.SimpleText("Player List", "ListFont", self:GetWide() * .5, 12, g.Colours["White"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  1189. end
  1190.  
  1191. function list.Paint(self)
  1192.     g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1193.     g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 1, g.Colours["Black"])
  1194. end
  1195.  
  1196. function block.Paint(self)
  1197.     g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Color(0, 0, 0, 0))
  1198. end
  1199.  
  1200. function list_frame.Think()
  1201.     if (g.GetValue("Miscellaneous", "Active") and g.GetValue("Miscellaneous", "PlyList") and g.MenuOpen) then
  1202.         list_frame:SetVisible(true)
  1203.     else
  1204.         list_frame:SetVisible(false)
  1205.     end
  1206. end
  1207.  
  1208. function list.OnRowSelected(_, line)
  1209.     local v = list:GetLine(line):GetValue(3)
  1210.     local name = list:GetLine(line):GetValue(1)
  1211.     local OptList = g.DermaMenu()
  1212.    
  1213.     if (g.IsDev(v) and not g.IsDev(ply)) then
  1214.         OptList:AddOption("nah", g.OpenSite)
  1215.         OptList:AddOption("naw", g.OpenSite)
  1216.         OptList:AddOption("nej", g.OpenSite)
  1217.         OptList:AddOption("non", g.OpenSite)
  1218.         OptList:AddOption("nie", g.OpenSite)
  1219.         OptList:Open()
  1220.        
  1221.         return
  1222.     end
  1223.    
  1224.     OptList:AddOption("Open Profile" , function()
  1225.         v:ShowProfile()
  1226.         g.RefreshList()
  1227.     end)
  1228.    
  1229.     if (g.IsRP() or _Modules["amplify"]) then
  1230.         if (g.engine.ActiveGamemode() == "terrortown" and GAMEMODE.round_state ~= ROUND_ACTIVE or g.engine.ActiveGamemode() ~= "terrortown") then
  1231.             if (g.ServerCurTime > g.NameStealTimer) then
  1232.                 OptList:AddOption("Steal Name", function() 
  1233.                     if (g.IsRP()) then
  1234.                         if (GAMEMODE.Config.allowrpnames) then
  1235.                             g.NameLen = g.string.len(name)
  1236.                             g.Name = g.string.Left(name, g.NameLen - 1)
  1237.                            
  1238.                             ply:ConCommand("darkrp rpname " .. g.Name)
  1239.                             g.NameStealTimer = g.ServerCurTime + 10
  1240.                         else
  1241.                             if (_Modules["amplify"]) then
  1242.                                 g.SetName(name .. "​")
  1243.                                 g.NameStealTimer = g.ServerCurTime + g.GetConVar("sv_namechange_cooldown_seconds"):GetFloat() + 1
  1244.                             else
  1245.                                 g.ChatAlert("The server has RPName disabled.")
  1246.                                 g.NameStealTimer = g.math.huge
  1247.                             end
  1248.                         end
  1249.                     else
  1250.                         if (_Modules["amplify"]) then
  1251.                             g.SetName(name .. "​")
  1252.                             g.NameStealTimer = g.ServerCurTime + g.GetConVar("sv_namechange_cooldown_seconds"):GetFloat() + 1
  1253.                         else
  1254.                             g.ChatAlert("The name stealer only works on DarkRP without amplify.")
  1255.                             g.NameStealTimer = g.math.huge
  1256.                         end
  1257.                     end
  1258.                    
  1259.                     g.RefreshList()
  1260.                 end)
  1261.             end
  1262.         end
  1263.     end
  1264.    
  1265.     if (v ~= ply) then
  1266.         if not (v:IsMuted()) then
  1267.             OptList:AddOption("Mute", function()
  1268.                 v:SetMuted(true)
  1269.                 g.ChatNotify("Muted " .. name .. ".")
  1270.                
  1271.                 g.RefreshList()
  1272.             end)
  1273.         else
  1274.             OptList:AddOption("Unmute", function()
  1275.                 v:SetMuted(false)
  1276.                 g.ChatNotify("Unmuted " .. name .. ".")
  1277.                
  1278.                 g.RefreshList()
  1279.             end)
  1280.         end
  1281.        
  1282.         if not (v.Ignore) then
  1283.             OptList:AddOption("Ignore", function()
  1284.                 v.Ignore = true
  1285.                 g.ChatNotify("Aimbot will now ignore " .. name .. ".")
  1286.                
  1287.                 g.RefreshList()
  1288.             end)
  1289.         else
  1290.             OptList:AddOption("Target", function()
  1291.                 v.Ignore = false
  1292.                 g.ChatNotify("Aimbot will now target " .. name .. ".")
  1293.                
  1294.                 g.RefreshList()
  1295.             end)
  1296.         end
  1297.        
  1298.         if not (v.Special) then
  1299.             OptList:AddOption("Mark", function()
  1300.                 v.Special = true
  1301.                 g.ChatNotify(name .. " will now be marked.")
  1302.                
  1303.                 g.RefreshList()
  1304.             end)
  1305.         else
  1306.             OptList:AddOption("Unmark", function()
  1307.                 v.Special = false
  1308.                 g.ChatNotify(name .. " will no longer be marked.")
  1309.                
  1310.                 g.RefreshList()
  1311.             end)
  1312.         end
  1313.     end
  1314.    
  1315.     local CopyList = OptList:AddSubMenu("Copy")
  1316.    
  1317.     CopyList:AddOption("Name", function()
  1318.         g.SetClipboardText(name)
  1319.     end)
  1320.    
  1321.     CopyList:AddOption("SteamID", function()
  1322.         g.SetClipboardText(v:SteamID())
  1323.     end)
  1324.    
  1325.     CopyList:AddOption("SteamID64", function()
  1326.         g.SetClipboardText(v:SteamID64())
  1327.     end)
  1328.    
  1329.     CopyList:AddOption("Profile Link", function()
  1330.         g.SetClipboardText("http://steamcommunity.com/profiles/" .. v:SteamID64() .. "/")
  1331.     end)
  1332.    
  1333.     OptList:Open()
  1334. end
  1335.  
  1336. --[[
  1337.    
  1338.     BIND MENU
  1339.    
  1340. ]]--
  1341. function g.BindMenu()
  1342.     local bind_menu = g.vgui.Create("DFrame")
  1343.     bind_menu:MakePopup()
  1344.     bind_menu:SetTitle("")
  1345.     bind_menu:SetSize(120, 200)
  1346.     bind_menu:Center()
  1347.    
  1348.     g.AddBinder(bind_menu, "Menu", "MenuKey", 1)
  1349.     g.AddBinder(bind_menu, "Aimbot", "AimKey", 2)
  1350.     g.AddBinder(bind_menu, "Flashspam", "FlashKey", 3)
  1351.     g.AddBinder(bind_menu, "Triggerbot", "TrigKey", 4)
  1352.     g.AddBinder(bind_menu, "Free Camera", "FreeCam", 5)
  1353.    
  1354.     function bind_menu.Think(self)
  1355.         if not (g) then
  1356.             self:Close()
  1357.         elseif not (g.MenuOpen) then
  1358.             self:Close()
  1359.         end
  1360.     end
  1361. end
  1362.  
  1363. --[[
  1364.    
  1365.     CHANGELOG
  1366.    
  1367. ]]--
  1368. function g.Changelog()
  1369.     local log_frame = g.vgui.Create("DFrame")
  1370.     log_frame:SetTitle("Changelog")
  1371.     log_frame:SetPos(0, 0)
  1372.     log_frame:SetSize(400, 450)
  1373.     log_frame:MakePopup()
  1374.     log_frame:Center()
  1375.    
  1376.     function log_frame.Think(self)
  1377.         if not (g) then
  1378.             self:Close()
  1379.         elseif not (g.MenuOpen) then
  1380.             self:Close()
  1381.         end
  1382.     end
  1383.    
  1384.     local log_text = g.vgui.Create("DTextEntry", log_frame)
  1385.     log_text:SetPos(10, 35)
  1386.     log_text:SetSize(log_frame:GetWide() - 20, log_frame:GetTall() - 45)
  1387.     log_text:SetText(g.LogText)
  1388.     log_text:SetMultiline(true)
  1389.     log_text:SetVerticalScrollbarEnabled(true)
  1390.    
  1391.     g.http.Fetch("http://pastebin.com/raw/rEEcBpvH",
  1392.         function(body)
  1393.             g.LogText = body
  1394.             log_text:SetText(g.LogText)
  1395.         end,
  1396.        
  1397.         function(err)
  1398.             g.LogText = "Couldn't fetch changelog: " .. g.string.upper(err)
  1399.             log_text:SetText(g.LogText)
  1400.         end
  1401.     )
  1402. end
  1403.  
  1404. --[[
  1405.    
  1406.     MENU
  1407.    
  1408. ]]--
  1409. function g.OpenMenu()
  1410.     g.MenuOpen = true
  1411.     g.RefreshList()
  1412.    
  1413.     local menu = g.vgui.Create("DFrame")
  1414.     menu:MakePopup()
  1415.     menu:SetTitle("")
  1416.     menu:SetSize(650, 400)
  1417.     menu:ShowCloseButton(false)
  1418.     menu:Center()
  1419.    
  1420.     local group = g.vgui.Create("DButton", menu)
  1421.     group:SetSize(60, 40)
  1422.     group:SetPos(580, 5)
  1423.     group:SetText("Group")
  1424.     group:SetFont("MenuFont")
  1425.    
  1426.     local changelog = g.vgui.Create("DButton", menu)
  1427.     changelog:SetSize(80, 40)
  1428.     changelog:SetPos(495, 5)
  1429.     changelog:SetText("Changelog")
  1430.     changelog:SetFont("MenuFont")
  1431.    
  1432.     local options = g.vgui.Create("DPanel", menu)
  1433.     options:SetPos(10, 110)
  1434.     options:SetSize(630, 280)
  1435.    
  1436.     local tabs = g.vgui.Create("DScrollPanel", menu)
  1437.     tabs:SetPos(10, 55)
  1438.     tabs:SetSize(630, 50)
  1439.    
  1440.     local FirstTime = g.vgui.Create("HTML", options)
  1441.     FirstTime:OpenURL("http://i.imgur.com/3NAEbVk.png")
  1442.     FirstTime:Dock(FILL)
  1443.    
  1444.     local Aimbot = g.vgui.Create("DPanel", options)
  1445.     Aimbot:Dock(FILL)
  1446.    
  1447.     local Triggerbot = g.vgui.Create("DPanel", options)
  1448.     Triggerbot:Dock(FILL)
  1449.    
  1450.     local ESP = g.vgui.Create("DPanel", options)
  1451.     ESP:Dock(FILL)
  1452.    
  1453.     local Visuals = g.vgui.Create("DPanel", options)
  1454.     Visuals:Dock(FILL)
  1455.    
  1456.     local Miscellaneous = g.vgui.Create("DPanel", options)
  1457.     Miscellaneous:Dock(FILL)
  1458.    
  1459.     local TabPanels = {
  1460.         ["FirstTime"] = FirstTime,
  1461.         ["Aimbot"] = Aimbot,
  1462.         ["Triggerbot"] = Triggerbot,
  1463.         ["ESP"] = ESP,
  1464.         ["Visuals"] = Visuals,
  1465.         ["Miscellaneous"] = Miscellaneous,
  1466.     }
  1467.    
  1468.     function g.SetActiveTab()
  1469.         for k, v in g.next, TabPanels do
  1470.             v:SetVisible(false)
  1471.            
  1472.             if (g.ActiveTab == k) then
  1473.                 v:SetVisible(true)
  1474.             end
  1475.         end
  1476.     end
  1477.     g.SetActiveTab()
  1478.    
  1479.     g.AddTab(tabs, "Aimbot", Aimbot, 1)
  1480.     g.AddTab(tabs, "Triggerbot", Triggerbot, 2)
  1481.     g.AddTab(tabs, "ESP", ESP, 3)
  1482.     g.AddTab(tabs, "Visuals", Visuals, 4)
  1483.     g.AddTab(tabs, "Miscellaneous", Miscellaneous, 5)
  1484.    
  1485.     for k, v in g.next, g.Options do
  1486.         for _k ,_v in g.next, g.Options[k] do
  1487.             if (g.Options[k][_k][1] == "Checkbox") then
  1488.                 g.AddCheckbox(k, _k, TabPanels[k])
  1489.             elseif (g.Options[k][_k][1] == "Slider") then
  1490.                 g.AddSlider(k, _k, TabPanels[k])
  1491.             else
  1492.                 g.AddSelection(k, _k, TabPanels[k])
  1493.             end
  1494.         end
  1495.     end
  1496.    
  1497.     local Binding = g.vgui.Create("DButton", tabs)
  1498.     Binding:SetPos(tabs:GetWide() - 100, 0)
  1499.     Binding:SetSize(100, 23)
  1500.     Binding:SetText("Binding")
  1501.    
  1502.     local Unload = g.vgui.Create("DButton", tabs)
  1503.     Unload:SetSize(100, 23)
  1504.     Unload:SetPos(tabs:GetWide() - 100, 25)
  1505.     Unload:SetText("Unload")
  1506.     Unload:SetTooltip("Click to unload " .. g.HackName .. ".")
  1507.    
  1508.     function menu.Paint(self)
  1509.         g.DrawBlur(self, 3, 6)
  1510.        
  1511.         g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Color(60, 60, 60, 175))
  1512.         g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 2, g.Colours["Menu"]["Main"])
  1513.        
  1514.         g.draw.RoundedBox(0, 0, 0, self:GetWide(), 50, g.Colours["Menu"]["Main"])
  1515.         g.draw.SimpleText(g.HackName, "TitleFont", 15, 4, g.Colours["White"])
  1516.     end
  1517.    
  1518.     function group.Paint(self)
  1519.         if not (self:IsHovered()) then
  1520.             g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1521.         else
  1522.             g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1523.         end
  1524.        
  1525.         g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 1, g.Colours["Black"])
  1526.     end
  1527.    
  1528.     function changelog.Paint(self)
  1529.         if not (self:IsHovered()) then
  1530.             g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1531.         else
  1532.             g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1533.         end
  1534.        
  1535.         g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 1, g.Colours["Black"])
  1536.     end
  1537.    
  1538.     function Binding.Paint(self)
  1539.         g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1540.         g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 1, g.Colours["Black"])
  1541.     end
  1542.    
  1543.     function Unload.Paint(self)
  1544.         g.draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), g.Colours["White"])
  1545.         g.OutlinedBox(0, 0, self:GetWide(), self:GetTall(), 1, g.Colours["Black"])
  1546.     end
  1547.    
  1548.     function group.DoClick()
  1549.         g.gui.OpenURL("http://steamcommunity.com/gid/" .. g.GroupID .. "/")
  1550.         g.surface.PlaySound("/buttons/button17.wav")
  1551.     end
  1552.    
  1553.     function changelog.DoClick()
  1554.         g.Changelog()
  1555.         g.surface.PlaySound("/buttons/button17.wav")
  1556.     end
  1557.    
  1558.     function Binding.DoClick()
  1559.         g.surface.PlaySound("/buttons/button15.wav")
  1560.         g.BindMenu()
  1561.     end
  1562.    
  1563.     function Unload.DoClick()
  1564.         g.surface.PlaySound("/buttons/button19.wav")
  1565.        
  1566.         menu:Close()
  1567.         list_frame:Close()
  1568.        
  1569.         for k, v in g.next, _Hooks do
  1570.             for _k, _v in g.pairs(v) do
  1571.                 g.ChatNotify("Removed hook: '" .. k .. "'.")
  1572.                 g.hook.Remove(k, _k)
  1573.             end
  1574.         end
  1575.        
  1576.         for k, v in g.next, _Modules do
  1577.             if (k == "cvar3") then continue end
  1578.             g.ChatNotify("Removed module: '" .. k .. "'.")
  1579.             g.UnRequire(k)
  1580.         end
  1581.        
  1582.         for k, v in g.ipairs(g.player.GetAll()) do
  1583.             v.Confirmed1 = nil
  1584.             v.Confirmed2 = nil
  1585.             v.Confirmed3 = nil
  1586.             v.Detected = nil
  1587.         end
  1588.        
  1589.         g.ChatNotify(g.HackName .. " unloaded successfully.")
  1590.         g.table.Empty(g)
  1591.        
  1592.         _G.Loaded = nil
  1593.         g = nil
  1594.     end
  1595.    
  1596.     function menu.Close()
  1597.         g.SaveConfig()
  1598.         menu:Remove()
  1599.         g.CloseDermaMenus()
  1600.     end
  1601.    
  1602.     function menu.Think(self)
  1603.         if (g.GetValue("Miscellaneous", "Active") and g.GetValue("Miscellaneous", "PlyList")) then
  1604.             list_frame:SetVisible(true)
  1605.         end
  1606.        
  1607.         if (g.SiteOpen) then
  1608.             menu:Close()
  1609.             g.MenuOpen = false
  1610.         end
  1611.        
  1612.         if ((g.IsKeyDown(g.Binds["MenuKey"]) or g.IsKeyDown(KEY_HOME)) and not g.MenuKeyDown2 and g.Binds["MenuKey"] ~= 107) then
  1613.             menu:Close()
  1614.             g.MenuOpen = false
  1615.         end
  1616.     end
  1617. end
  1618.  
  1619. function g.MenuToggle() -- No idea who originally made this but I pasted it from Razor so creds to him.
  1620.     if (g.SiteOpen) then return end
  1621.    
  1622.     if ((g.IsKeyDown(g.Binds["MenuKey"]) or g.IsKeyDown(KEY_HOME)) and not g.MenuOpen and not g.MenuKeyDown) then
  1623.         g.MenuKeyDown = true
  1624.         g.OpenMenu()
  1625.     elseif (not (g.IsKeyDown(g.Binds["MenuKey"]) or g.IsKeyDown(KEY_HOME)) and not g.MenuOpen) then
  1626.         g.MenuKeyDown = false
  1627.     end
  1628.    
  1629.     if ((g.IsKeyDown(g.Binds["MenuKey"]) or g.IsKeyDown(KEY_HOME)) and g.MenuKeyDown and g.MenuOpen) then
  1630.         g.MenuKeyDown2 = true
  1631.     else
  1632.         g.MenuKeyDown2 = false
  1633.     end
  1634. end
  1635.  
  1636. --[[
  1637.    
  1638.     AIMBOT
  1639.    
  1640. ]]--
  1641. function g.AimVec(v)
  1642.     if (v == nil) then return end
  1643.     if not (g._IsValid(v)) then return end
  1644.    
  1645.     local bone = v:LookupBone("ValveBiped.Bip01_Head1")
  1646.     local melee = true
  1647.     local trace = {}
  1648.    
  1649.     trace.start = ply:GetShootPos()
  1650.     trace.filter = {ply, v}
  1651.     trace.mask = MASK_SHOT
  1652.    
  1653.     if (not bone or g.GetValue("Aimbot", "AimPos") == "Body") then
  1654.         local pos = v:GetPos() + v:OBBCenter()
  1655.        
  1656.         trace.endpos = pos
  1657.        
  1658.         local tracer = g.util.TraceLine(trace)
  1659.        
  1660.         if (g.IsMelee(ply:GetActiveWeapon())) then
  1661.             melee = (tracer.HitPos:Distance(ply:GetShootPos()) < 75)
  1662.         end
  1663.        
  1664.         if (tracer.Fraction == 1 and melee) then
  1665.             return pos
  1666.         end
  1667.     end
  1668.    
  1669.     if (bone) then
  1670.         local pos = v:GetBonePosition(bone)
  1671.        
  1672.         trace.endpos = pos
  1673.        
  1674.         local tracer = g.util.TraceLine(trace)
  1675.        
  1676.         if (g.IsMelee(ply:GetActiveWeapon())) then
  1677.             melee = (tracer.HitPos:Distance(ply:GetShootPos()) < 75)
  1678.         end
  1679.        
  1680.         if (tracer.Fraction == 1 and melee) then
  1681.             pos.z = pos.z + 3
  1682.             return pos - (ply:GetVelocity() * g.engine.TickInterval()) + (v:GetVelocity() * (g.RealFrameTime() / 22))
  1683.         end
  1684.     end
  1685.    
  1686.     if (g.GetValue("Aimbot", "AimPos") == "Auto") then
  1687.         for i = 1, v:GetBoneCount() - 1 do
  1688.             local pos = v:GetBonePosition(i)
  1689.             if (v:GetPos() == pos) then continue end
  1690.            
  1691.             trace.endpos = pos
  1692.            
  1693.             local tracer = g.util.TraceLine(trace)
  1694.            
  1695.             if (g.IsMelee(ply:GetActiveWeapon())) then
  1696.                 melee = (tracer.HitPos:Distance(ply:GetShootPos()) < 75)
  1697.             end
  1698.            
  1699.             if (tracer.Fraction == 1 and melee) then
  1700.                 return pos
  1701.             end
  1702.         end
  1703.     end
  1704. end
  1705.  
  1706. function g.AimPos(vec)
  1707.     if (vec == nil) then return end
  1708.    
  1709.     local ang = (vec - ply:GetShootPos()):Angle()
  1710.    
  1711.     ang.p = g.math.NormalizeAngle(ang.p)
  1712.     ang.y = g.math.NormalizeAngle(ang.y)
  1713.    
  1714.     return ang
  1715. end
  1716.  
  1717. function g.Aimbot(cmd)
  1718.     local aimVec = g.AimVec(Target)
  1719.    
  1720.     if (Target and aimVec) then
  1721.         if (g.GetValue("Aimbot", "Silent") and cmd:CommandNumber() == 0) then
  1722.             g.Aimbotting = false
  1723.             return
  1724.         end
  1725.        
  1726.         if not (g.GetValue("Aimbot", "AutoStop") or g.GetValue("Aimbot", "AutoDuck")) then
  1727.             if ((g.GetValue("Aimbot", "Silent") or g.GetValue("Miscellaneous", "Spinbot")) and not g.CanFire()) then
  1728.                 g.Aimbotting = false
  1729.                 return
  1730.             end
  1731.         end
  1732.        
  1733.         g.AimAng = g.AimPos(aimVec)
  1734.        
  1735.         if (_Modules["dickwrap"] and g.InGroup) then
  1736.             g.AimAng = g.Compensate(cmd, g.AimAng)
  1737.         end
  1738.        
  1739.         if (not g.GetValue("Aimbot", "Silent") and cmd:CommandNumber() == 0) then
  1740.             if not (g.GetValue("Aimbot", "SlowAim")) then
  1741.                 g.FakeAng = g.AimAng
  1742.             else
  1743.                 g.FakeAng = g.LerpAngle(g.GetValue("Aimbot", "SlowSpeed"), cmd:GetViewAngles(), g.AimAng)
  1744.             end
  1745.         end
  1746.        
  1747.         if (not g.GetValue("Aimbot", "SlowAim") or g.GetValue("Aimbot", "Silent")) then                
  1748.             cmd:SetViewAngles(g.AimAng)
  1749.         else
  1750.             cmd:SetViewAngles(g.LerpAngle(g.GetValue("Aimbot", "SlowSpeed"), cmd:GetViewAngles(), g.AimAng))
  1751.         end
  1752.        
  1753.         if (g.GetValue("Aimbot", "AutoStop")) then
  1754.             cmd:SetForwardMove(0)
  1755.             cmd:SetSideMove(0)
  1756.             cmd:SetUpMove(0)
  1757.            
  1758.             cmd:SetButtons(0)
  1759.         end
  1760.        
  1761.         if (g.GetValue("Aimbot", "AutoDuck")) then
  1762.             cmd:SetButtons(cmd:GetButtons() + IN_DUCK)
  1763.         end
  1764.        
  1765.         if (g.GetValue("Aimbot", "AutoShoot") and not cmd:KeyDown(IN_ATTACK)) then
  1766.             if (g.GetValue("Aimbot", "RapidShoot") or g.GetValue("Miscellaneous", "RapidShoot")) then
  1767.                 if (g.CanFire()) then
  1768.                     cmd:SetButtons(cmd:GetButtons() + IN_ATTACK)
  1769.                 end
  1770.             else
  1771.                 cmd:SetButtons(cmd:GetButtons() + IN_ATTACK)
  1772.             end
  1773.         end
  1774.        
  1775.         g.Aimbotting = true
  1776.     else
  1777.         g.Aimbotting = false
  1778.     end
  1779. end
  1780.  
  1781. /*function g.DistanceToCrosshair(dst)
  1782.     local ray = ply:GetAimVector()
  1783.     local origin = ply:GetShootPos()
  1784.     local projected = ((dst - origin):Dot(ray) * ray:GetNormalized()) + origin
  1785.    
  1786.     return projected:DistToSqr(dst)
  1787. end*/
  1788.  
  1789. function g.DistanceToCrosshair(src, dst) -- Credits to Nanocat
  1790.     local ang = (dst - src):Angle() - g.Angle(g.FakeAng.p, g.FakeAng.y, 0)
  1791.     return g.math.abs(g.math.abs(ang.p - 180) + g.math.abs(ang.y - 180) - 360)
  1792. end
  1793.  
  1794. function g.GetFOV(angle, src, dst)
  1795.     local delta = src - dst
  1796.     local hyp = delta:Length2D()
  1797.     local ang = g.Angle(g.math.deg(g.math.atan(delta.z / hyp)), g.math.deg(g.math.atan(delta.y / delta.x)), 0)
  1798.    
  1799.     if (delta.x >= 0) then
  1800.         ang.y = ang.y + 180
  1801.     end
  1802.    
  1803.     local pitch = angle.p * g.math.pi / 180
  1804.     local yaw = angle.y * g.math.pi / 180
  1805.     local tmp = g.math.cos(pitch)
  1806.    
  1807.     local aim = g.Angle(tmp * g.math.cos(yaw), g.math.sin(yaw) * tmp, -g.math.sin(pitch))
  1808.    
  1809.     pitch = ang.p * g.math.pi / 180
  1810.     yaw = ang.y * g.math.pi / 180
  1811.     tmp = g.math.cos(pitch)
  1812.    
  1813.     ang = g.Angle(tmp * g.math.cos(yaw), g.math.sin(yaw) * tmp, -g.math.sin(pitch))
  1814.    
  1815.     local mag_s = g.math.sqrt((aim.p * aim.p) + (aim.y * aim.y) + (aim.r * aim.r))
  1816.     local mag_d = g.math.sqrt((aim.p * aim.p) + (aim.y * aim.y) + (aim.r * aim.r))
  1817.     local u_dot_v = aim.p * ang.p + aim.y * ang.y + aim.r * ang.r
  1818.    
  1819.     return g.math.acos(u_dot_v / (mag_s * mag_d)) * (180 / g.math.pi)
  1820. end
  1821.  
  1822. function g.GetTarget(cmd)
  1823.     Target = nil
  1824.     g.FoV = nil
  1825.     g.Health = g.math.huge
  1826.     g.Distance = g.math.huge
  1827.    
  1828.     if (g.GetValue("Aimbot", "OnKey") and not g.IsKeyDown(g.Binds["AimKey"])) then return end
  1829.    
  1830.     if (g.GetValue("Aimbot", "Active") and g.CanAimbot()) then
  1831.         for k, v in g.ipairs(g.Either(g.GetValue("Aimbot", "IgnoreNPC"), g.player.GetAll(), g.ents.GetAll())) do
  1832.             if (g.GetValue("Aimbot", "IgnoreBot") and v:IsPlayer() and v:IsBot()) then continue end
  1833.             if (g.GetValue("Aimbot", "IgnoreNPC") and v:IsNPC()) then continue end
  1834.             if (g.GetValue("Aimbot", "IgnoreTeam") and g.CheckTeam(v)) then continue end
  1835.             if (g.GetValue("Aimbot", "IgnoreFriend") and v:IsPlayer() and v:GetFriendStatus() == "friend") then continue end
  1836.             if (g.GetValue("Aimbot", "IgnoreDetective") and g.engine.ActiveGamemode() == "terrortown" and v:IsPlayer() and v:IsDetective()) then continue end
  1837.             if (not g._IsValid(v) or v:GetColor().a ~= 255 or g.IsDev(v) or v.Ignore or v:GetMoveType() == 8 or v:GetMoveType() == 10) then continue end
  1838.            
  1839.             local aimVec = g.AimVec(v)
  1840.            
  1841.             if (aimVec) then
  1842.                 if (g.GetValue("Aimbot", "CheckFOV")) then
  1843.                     if (g.GetFOV(cmd:GetViewAngles(), ply:GetShootPos(), aimVec) > g.GetValue("Aimbot", "AimFOV")) then continue end
  1844.                 end
  1845.                
  1846.                 if (g.IsMelee(ply:GetActiveWeapon())) then
  1847.                     g.Distance2 = v:GetPos():Distance(ply:GetPos())
  1848.                    
  1849.                     if (g.Distance > g.Distance2) then
  1850.                         Target = v
  1851.                         g.Distance = g.Distance2
  1852.                     end
  1853.                 else
  1854.                     if (g.GetValue("Aimbot", "TargetType") == "FOV") then
  1855.                         g.Pos = g.DistanceToCrosshair(ply:GetShootPos(), aimVec)
  1856.                        
  1857.                         if (g.Pos < (g.FoV or g.Pos + 1)) then
  1858.                             Target = v
  1859.                             g.FoV = g.Pos
  1860.                         end
  1861.                     elseif (g.GetValue("Aimbot", "TargetType") == "Distance") then
  1862.                         g.Distance2 = v:GetPos():Distance(ply:GetPos())
  1863.                        
  1864.                         if (g.Distance > g.Distance2) then
  1865.                             Target = v
  1866.                             g.Distance = g.Distance2
  1867.                         end
  1868.                     elseif (g.GetValue("Aimbot", "TargetType") == "Health") then
  1869.                         if (v:Health() < g.Health) then
  1870.                             Target = v
  1871.                             g.Health = v:Health()
  1872.                         end
  1873.                     end
  1874.                 end
  1875.             end
  1876.         end
  1877.     end
  1878. end
  1879.  
  1880. --[[
  1881.    
  1882.     TRIGGERBOT
  1883.    
  1884. ]]--
  1885. function g.TriggerFilter(hitbox)
  1886.     if (g.GetValue("Triggerbot", "TrigFilter") == "Head") then
  1887.         return hitbox == 0
  1888.     end
  1889.    
  1890.     return hitbox ~= nil
  1891. end
  1892.  
  1893. function g.Triggerbot(cmd)
  1894.     if cmd:KeyDown(IN_ATTACK) then return end
  1895.     if not (g.GetValue("Triggerbot", "Active")) then return end
  1896.    
  1897.     local trace = ply:GetEyeTraceNoCursor()
  1898.     local v = trace.Entity
  1899.     local hitbox = trace.HitBox
  1900.    
  1901.     if (g._IsValid(v) and g.TriggerFilter(hitbox)) then
  1902.         if (g.GetValue("Triggerbot", "OnKey") and not g.IsKeyDown(g.Binds["TrigKey"])) then g.Triggering = false return end
  1903.        
  1904.         if (g.GetValue("Triggerbot", "IgnoreBot") and v:IsPlayer() and v:IsBot()) then return end
  1905.         if (g.GetValue("Triggerbot", "IgnoreNPC") and v:IsNPC()) then return end
  1906.         if (g.GetValue("Triggerbot", "IgnoreTeam") and g.CheckTeam(v)) then return end
  1907.         if (g.GetValue("Triggerbot", "IgnoreFriend") and v:IsPlayer() and v:GetFriendStatus() == "friend") then return end
  1908.         if (g.GetValue("Triggerbot", "IgnoreDetective") and g.engine.ActiveGamemode() == "terrortown" and v:IsPlayer() and v:IsDetective()) then return end
  1909.         if (not g._IsValid(v) or v:GetColor().a ~= 255 or g.IsDev(v) or v.Ignore or v:GetMoveType() == 8 or v:GetMoveType() == 10) then return end
  1910.        
  1911.         g.Triggering = true
  1912.        
  1913.         if (g.GetValue("Triggerbot", "TrigAim") and g.AimVec(v)) then
  1914.             cmd:SetViewAngles(g.AimPos(g.AimVec(v)))
  1915.         end
  1916.        
  1917.         if (g.GetValue("Triggerbot", "RapidShoot") or g.GetValue("Miscellaneous", "RapidShoot")) then
  1918.             if (g.CanFire()) then
  1919.                 cmd:SetButtons(cmd:GetButtons() + IN_ATTACK)
  1920.             end
  1921.         else
  1922.             cmd:SetButtons(cmd:GetButtons() + IN_ATTACK)
  1923.         end
  1924.     else
  1925.         g.Triggering = false
  1926.     end
  1927. end
  1928.  
  1929. --[[
  1930.    
  1931.     ESP
  1932.    
  1933. ]]--
  1934. function g.Rotate(snapx, snapy, snapx2, snapy2) -- Credits to Sadistic.
  1935.     local _x = snapx - snapx2
  1936.     local _y = snapy - snapy2
  1937.    
  1938.     local ang = g.math.deg(g.math.atan2(_y, _x))
  1939.    
  1940.     local x = g.math.cos(g.math.rad(ang - 90))
  1941.     local y = -g.math.cos(g.math.rad(ang))
  1942.    
  1943.     if (x > 0) then
  1944.         x = g.math.ceil(x)
  1945.     else
  1946.         x = g.math.floor(x)
  1947.     end
  1948.    
  1949.     if (y > 0) then
  1950.         y = g.math.ceil(y)
  1951.     else
  1952.         y = g.math.floor(y)
  1953.     end
  1954.    
  1955.     return x, y
  1956. end
  1957.  
  1958. function g.ESP()
  1959.     if not (g.GetValue("ESP", "Active")) then return end
  1960.    
  1961.     for k, v in g.ipairs(g.Either(g.GetValue("ESP", "ShowNPC") or g.GetValue("ESP", "ShowProp") or g.GetValue("ESP", "ShowLoot"), g.ents.GetAll(), g.player.GetAll())) do
  1962.         if (g.GetValue("ESP", "IgnoreTeam") and g.CheckTeam(v)) then continue end
  1963.        
  1964.         if (g.CanDraw(v) or (g.GetValue("ESP", "ShowProp") and g.IsProp(v)) or (g.GetValue("ESP", "ShowLoot") and g.IsMurderProp(v))) then
  1965.             local alpha = v:GetColor().a
  1966.             local texty1 = 5
  1967.             local texty2 = 5
  1968.             local health = g.Color(255 - 255 / v:GetMaxHealth() * v:Health(), 255 / v:GetMaxHealth() * v:Health(), 0)
  1969.             local wep = not (g.IsProp(v) or g.IsMurderProp(v)) and v:GetActiveWeapon()
  1970.             local plycol, guncol = g.Colour(v)
  1971.             local textcol = g.GetValue("ESP", "TextColour") == "White" and g.Colours["White"] or plycol
  1972.             local pos = v:GetPos()
  1973.             local min, max = v:GetCollisionBounds()
  1974.            
  1975.             -- Credits to Snipwnage for bounds shit.
  1976.             local x1, y1, x2, y2 = g.ScrW() * 2, g.ScrH() * 2, -g.ScrW(), -g.ScrH()
  1977.             local corners = {
  1978.                 v:LocalToWorld(g.Vector(min.x, min.y, min.z)):ToScreen(),
  1979.                 v:LocalToWorld(g.Vector(min.x, max.y, min.z)):ToScreen(),
  1980.                 v:LocalToWorld(g.Vector(max.x, max.y, min.z)):ToScreen(),
  1981.                 v:LocalToWorld(g.Vector(max.x, min.y, min.z)):ToScreen(),
  1982.                 v:LocalToWorld(g.Vector(min.x, min.y, max.z)):ToScreen(),
  1983.                 v:LocalToWorld(g.Vector(min.x, max.y, max.z)):ToScreen(),
  1984.                 v:LocalToWorld(g.Vector(max.x, max.y, max.z)):ToScreen(),
  1985.                 v:LocalToWorld(g.Vector(max.x, min.y, max.z)):ToScreen(),
  1986.             }
  1987.            
  1988.             for _k, _v in g.next, corners do
  1989.                 x1, y1 = g.math.min(x1, _v.x), g.math.min(y1, _v.y)
  1990.                 x2, y2 = g.math.max(x2, _v.x), g.math.max(y2, _v.y)
  1991.             end
  1992.            
  1993.             local diff, diff2 = g.math.abs(x2 - x1), g.math.abs(y2 - y1)
  1994.            
  1995.             if (g.GetValue("ESP", "ESPColour") == "Health") then
  1996.                 plycol = health
  1997.                 guncol = health
  1998.             end
  1999.            
  2000.             if (g.GetValue("ESP", "Box")) then
  2001.                 if (g.GetValue("ESP", "BoxType") == "2D") then
  2002.                     g.surface.SetDrawColor(g.Colours["Black"])
  2003.                     g.surface.DrawOutlinedRect(x1 - 1, y1 - 1, diff + 2, diff2 + 2)
  2004.                     g.surface.DrawOutlinedRect(x1 + 1, y1 + 1, diff - 2, diff2 - 2)
  2005.                    
  2006.                     g.surface.SetDrawColor(plycol)
  2007.                     g.surface.DrawOutlinedRect(x1, y1, diff, diff2)
  2008.                 else
  2009.                     for i = 1, 4 do
  2010.                         g.surface.SetDrawColor(plycol)
  2011.                         g.surface.DrawLine(corners[i].x, corners[i].y, corners[i + 4].x, corners[i + 4].y)
  2012.                         g.surface.DrawLine(corners[i].x, corners[i].y, corners[i % 4 + 1].x, corners[i % 4 + 1].y)
  2013.                         g.surface.DrawLine(corners[i + 4].x, corners[i + 4].y, corners[i % 4 + 5].x, corners[i % 4 + 5].y)
  2014.                     end
  2015.                 end
  2016.             end
  2017.            
  2018.             -- Credits to Sadistic for original, modified by me to make it purdy.
  2019.             if (g.GetValue("ESP", "Snapline")) then
  2020.                 local endx = (x1 + x2) * .5
  2021.                 local endy = y2
  2022.                 local startx = g.ScrW() * .5
  2023.                 local starty = (g.GetValue("ESP", "SnaplineStart") == "Centre") and g.ScrH() / 2 or g.ScrH()
  2024.                 local offsetx, offsety = g.Rotate(endx, endy, startx, starty)
  2025.                
  2026.                 if (g.math.abs(endx) < g.ScrW() * 5 and g.math.abs(endy) < g.ScrH() * 5) then
  2027.                     g.surface.SetDrawColor(g.Colours["Black"])
  2028.                     g.surface.DrawLine(startx - offsetx, starty - offsety, endx - offsetx, endy - offsety)
  2029.                     g.surface.DrawLine(startx + offsetx, starty + offsety, endx + offsetx, endy + offsety)
  2030.                    
  2031.                     g.surface.SetDrawColor(plycol)
  2032.                     g.surface.DrawLine(startx, starty, endx, endy)
  2033.                 end
  2034.             end
  2035.            
  2036.             if (g.GetValue("ESP", "Healthbar") and v:Health() > 0) then
  2037.                 g.surface.SetDrawColor(g.Colours["Black"])
  2038.                 g.surface.DrawRect(x1 - 6, y1, 3, diff2)
  2039.                 g.surface.DrawRect(x1 - 7, y1 - 1, 5, diff2 + 2)
  2040.                
  2041.                 g.surface.SetDrawColor(health)
  2042.                 g.surface.DrawRect(x1 - 6, y2 - g.math.Clamp(diff2 / v:GetMaxHealth() * v:Health(), 0, diff2), 3, g.math.Clamp(diff2 / v:GetMaxHealth() * v:Health(), 0, diff2))
  2043.             end
  2044.            
  2045.             g.cam.Start3D()
  2046.                 if (g.GetValue("ESP", "ChamsP")) then
  2047.                     v:SetColor(plycol.r, plycol.g, plycol.b, alpha)
  2048.                     v:SetMaterial("models/debug/debugwhite")
  2049.                    
  2050.                     g.render.SetColorModulation(plycol.r / 255, plycol.g / 255, plycol.b / 255)
  2051.                     v:DrawModel()
  2052.                     v:SetColor(g.Colours["White"])
  2053.                     v:SetMaterial("")
  2054.                 end
  2055.                
  2056.                 if (g.GetValue("ESP", "ChamsW") and g.IsValid(wep)) then
  2057.                     wep:SetColor(guncol.r, guncol.g, guncol.b, alpha)
  2058.                     wep:SetMaterial("models/debug/debugwhite")
  2059.                    
  2060.                     g.render.SetColorModulation(guncol.r / 255, guncol.g / 255, guncol.b / 255)
  2061.                     wep:DrawModel()
  2062.                     wep:SetColor(g.Colours["White"])
  2063.                     wep:SetMaterial("")
  2064.                 end
  2065.                
  2066.                 if (g.GetValue("ESP", "Barrel") and v:IsPlayer()) then
  2067.                     local b1, b2 = v:EyePos(), v:GetEyeTrace().HitPos
  2068.                    
  2069.                     g.render.DrawLine(b1, b2, plycol)
  2070.                     g.render.DrawWireframeSphere(b2, 2, 10, 10, plycol, b2)
  2071.                 end
  2072.                
  2073.                 if (g.GetValue("ESP", "Hitbox")) then
  2074.                     for i = 0, v:GetHitBoxGroupCount() - 1 do
  2075.                         for _i = 0, v:GetHitBoxCount(i) - 1 do
  2076.                             local bone = v:GetHitBoxBone(_i, i)
  2077.                             if not (bone) then continue end
  2078.                            
  2079.                             local min, max = v:GetHitBoxBounds(_i, i)
  2080.                            
  2081.                             if (v:GetBonePosition(bone)) then
  2082.                                 local pos, ang = v:GetBonePosition(bone)
  2083.                                
  2084.                                 g.render.DrawWireframeBox(pos, ang, min, max, plycol)
  2085.                             end
  2086.                         end
  2087.                     end
  2088.                 end
  2089.             g.cam.End3D()
  2090.            
  2091.             if (g.GetValue("ESP", "Skeleton")) then
  2092.                 for i = 0, v:GetBoneCount() do
  2093.                     local bone = v:GetBoneParent(i)
  2094.                    
  2095.                     if not (bone) then continue end
  2096.                     if (bone == -1) then continue end
  2097.                    
  2098.                     local bone1, bone2 = v:GetBonePosition(i), v:GetBonePosition(bone)
  2099.                     local lstart = bone1:ToScreen()
  2100.                     local lend = bone2:ToScreen()
  2101.                    
  2102.                     if (v:GetPos() == bone1) then continue end
  2103.                    
  2104.                     g.surface.SetDrawColor(g.Colours["White"])
  2105.                     g.surface.DrawLine(lstart.x, lstart.y, lend.x, lend.y)
  2106.                 end
  2107.             end
  2108.            
  2109.             if (g.GetValue("ESP", "TextPos") == "Centred") then
  2110.                 x2 = (v:GetPos() + v:OBBCenter()):ToScreen().x
  2111.                 y1, y2 = (v:GetPos() + v:OBBCenter()):ToScreen().y, y1
  2112.             end
  2113.            
  2114.             if (g.GetValue("ESP", "Name")) then
  2115.                 if (v:IsPlayer()) then
  2116.                     g.draw.SimpleTextOutlined(v:Nick(), "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2117.                     texty1 = texty1 + 13
  2118.                 else
  2119.                     g.draw.SimpleTextOutlined(v:GetClass(), "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2120.                     texty1 = texty1 + 13
  2121.                 end
  2122.             end
  2123.            
  2124.             if (g.GetValue("ESP", "SteamID") and v:IsPlayer()) then
  2125.                 if (v:SteamID() ~= "NULL") then
  2126.                     g.draw.SimpleTextOutlined(v:SteamID(), "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2127.                     texty1 = texty1 + 13
  2128.                 else
  2129.                     g.draw.SimpleTextOutlined("BOT", "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2130.                     texty1 = texty1 + 13
  2131.                 end
  2132.             end
  2133.            
  2134.             if (g.GetValue("ESP", "UserGroup") and v:IsPlayer()) then
  2135.                 g.draw.SimpleTextOutlined(v:GetUserGroup(), "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2136.                 texty1 = texty1 + 13
  2137.             end
  2138.            
  2139.             if (g.GetValue("ESP", "Weapon") and g.IsValid(wep)) then
  2140.                 g.draw.SimpleTextOutlined(v:GetActiveWeapon():GetPrintName(), "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2141.                 texty1 = texty1 + 13
  2142.             end
  2143.            
  2144.             if (g.GetValue("ESP", "Ping") and v:IsPlayer()) then
  2145.                 g.draw.SimpleTextOutlined(v:Ping() .. "ms", "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2146.                 texty1 = texty1 + 13
  2147.             end
  2148.            
  2149.             if (g.GetValue("ESP", "Distance")) then
  2150.                 g.draw.SimpleTextOutlined(g.math.Round((ply:GetPos() - v:GetPos()):Length() * .0190625, 1) .. "m", "ESPFont", x2 + 1, y1 + texty1, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2151.                 texty1 = texty1 + 13
  2152.             end
  2153.            
  2154.             if (g.GetValue("ESP", "Health") and v:Health() > 0) then
  2155.                 g.draw.SimpleTextOutlined("HP: " .. v:Health(), "ESPFont", x2 + 1, y2 + texty2, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2156.                 texty2 = texty2 + 13
  2157.             end
  2158.            
  2159.             if (g.GetValue("ESP", "Armour") and v:IsPlayer()) then
  2160.                 g.draw.SimpleTextOutlined("AP: " .. v:Armor(), "ESPFont", x2 + 1, y2 + texty2, textcol, g.GetValue("ESP", "TextPos") == "Centred" and TEXT_ALIGN_CENTER or TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, g.Colours["Black"])
  2161.                 texty2 = texty2 + 13
  2162.             end
  2163.         end
  2164.     end
  2165. end
  2166.  
  2167. function g.Halo()
  2168.     if not (g.GetValue("ESP", "Active")) then return end
  2169.    
  2170.     for k, v in g.ipairs(g.Either(g.GetValue("ESP", "ShowNPC") or g.GetValue("ESP", "ShowProp") or g.GetValue("ESP", "ShowLoot"), g.ents.GetAll(), g.player.GetAll())) do
  2171.         if (g.GetValue("ESP", "IgnoreTeam") and g.CheckTeam(v)) then continue end
  2172.        
  2173.         if (g.CanDraw(v) or (g.GetValue("ESP", "ShowProp") and g.IsProp(v)) or (g.GetValue("ESP", "ShowLoot") and g.IsMurderProp(v))) then
  2174.             local plycol, guncol = g.Colour(v)
  2175.             local wep = not (g.IsProp(v) or g.IsMurderProp(v)) and v:GetActiveWeapon()
  2176.            
  2177.             if (g.GetValue("ESP", "HaloP")) then
  2178.                 g.halo.Add({v}, plycol, 2, 2, 2, true, true)
  2179.             end
  2180.            
  2181.             if (g.GetValue("ESP", "HaloW") and g.IsValid(wep)) then            
  2182.                 g.halo.Add({wep}, guncol, 2, 2, 2, true, true)
  2183.             end
  2184.         end
  2185.     end
  2186. end
  2187.  
  2188. function g.Lamp()
  2189.     if not (g.GetValue("ESP", "Active")) then return end
  2190.     if not (g.GetValue("ESP", "Lamp")) then return end
  2191.    
  2192.     for k, v in g.ipairs(g.Either(g.GetValue("ESP", "ShowNPC") or g.GetValue("ESP", "ShowProp") or g.GetValue("ESP", "ShowLoot"), g.ents.GetAll(), g.player.GetAll())) do
  2193.         if (g.GetValue("ESP", "IgnoreTeam") and g.CheckTeam(v)) then continue end
  2194.        
  2195.         if (g.CanDraw(v) or (g.GetValue("ESP", "ShowProp") and g.IsProp(v)) or (g.GetValue("ESP", "ShowLoot") and g.IsMurderProp(v))) then
  2196.             local dlight = g.DynamicLight(v)
  2197.             local _, guncol = g.Colour(v)
  2198.            
  2199.             if (dlight) then
  2200.                 dlight.pos = v:GetPos()
  2201.                 dlight.r = guncol.r
  2202.                 dlight.g = guncol.g
  2203.                 dlight.b = guncol.b
  2204.                 dlight.brightness = 1
  2205.                 dlight.Decay = 5 * g.GetValue("ESP", "LampSize")
  2206.                 dlight.Size = 20 * g.GetValue("ESP", "LampSize")
  2207.                 dlight.DieTime = g.CurTime() + .5
  2208.             end
  2209.         end
  2210.     end
  2211. end
  2212.  
  2213. --[[
  2214.    
  2215.     VISUALS
  2216.    
  2217. ]]--
  2218. function g.Crosshair()
  2219.     if not (g.GetValue("Visuals", "Active")) then return end
  2220.     if not (g.GetValue("Visuals", "Crosshair")) then return end
  2221.    
  2222.     ply:GetActiveWeapon().DrawCrosshair = false
  2223.    
  2224.     local x1, y1 = g.ScrW() * .5, g.ScrH() * .5
  2225.     local colour = g.Colour(ply:GetEyeTraceNoCursor().Entity)
  2226.    
  2227.     if (g.GetValue("Visuals", "CrosshairStyle") == "Dot") then
  2228.         g.surface.SetDrawColor(5, 5, 5)
  2229.         g.surface.DrawOutlinedRect(x1 - 2.5, y1 - 2.5, 5, 5)
  2230.         g.surface.SetDrawColor(colour)
  2231.         g.surface.DrawRect(x1 - 1.5, y1 - 1.5, 3, 3)
  2232.     elseif (g.GetValue("Visuals", "CrosshairStyle") == "Basic") then
  2233.         g.surface.SetDrawColor(colour)
  2234.         g.surface.DrawLine(x1 - 10, y1, x1 + 10, y1)
  2235.         g.surface.DrawLine(x1 - 1, y1 - 10, x1 - 1, y1 + 10)
  2236.     else
  2237.         g.surface.SetDrawColor(colour)
  2238.         g.surface.DrawLine(x1 + 7, y1, x1 + 20, y1)
  2239.         g.surface.DrawLine(x1 - 9, y1, x1 - 20, y1)
  2240.         g.surface.DrawLine(x1 - 1, y1 + 8, x1 - 1, y1 + 20)
  2241.         g.surface.DrawLine(x1 - 1, y1 - 8, x1 - 1, y1 - 20)
  2242.     end
  2243. end
  2244.  
  2245. function g.Laser()
  2246.     if not (g.GetValue("Visuals", "Active")) then return end
  2247.     if not (g.GetValue("Visuals", "Laser")) then return end
  2248.     if (g.GetValue("Miscellaneous", "ThirdPerson")) then return end
  2249.     if (FreeCam) then return end
  2250.     if (ply:Health() < 1 and ply:GetMoveType() == 10 and ply:GetObserverTarget() ~= nil) then return end
  2251.    
  2252.     local wep = ply:GetViewModel()
  2253.    
  2254.     if ( g.IsValid(ply:GetActiveWeapon()) and wep:GetAttachment(1) and wep:GetAttachment(1) ~= 0 and not g.IsMelee(ply:GetActiveWeapon())) then
  2255.         g.cam.Start3D()
  2256.             local startpos, endpos = wep:GetAttachment(1).Pos, ply:GetEyeTrace().HitPos
  2257.            
  2258.             g.render.DrawLine(startpos, endpos, g.Colour(ply))
  2259.            
  2260.             g.render.SetMaterial(g.Material("Sprites/light_glow02_add_noz"))       
  2261.             g.render.DrawQuadEasy(endpos, ply:EyePos() - endpos, 10, 10, g.Colour(ply), 0)
  2262.         g.cam.End3D()
  2263.     end
  2264. end
  2265.  
  2266. function pmt.SetEyeAngles(self, ang)
  2267.     if not (g) then
  2268.         return ang
  2269.     end
  2270.    
  2271.     -- Credits to Snipwnage.
  2272.     if (not (g.GetValue("Visuals", "Active") or g.GetValue("Visuals", "NoRecoil")) and g.string.find(g.string.lower(g.debug.getinfo(2).short_src), "/weapons/")) then
  2273.         if (ply:GetActiveWeapon().Author == "Spy") then
  2274.             local _ang = ang - g.FakeAng
  2275.             g.FakeAng.p = g.FakeAng.p - _ang.p * .2
  2276.             g.FakeAng.y = g.FakeAng.y - _ang.y * .2
  2277.         else
  2278.             g.FakeAng = ang
  2279.         end
  2280.     end
  2281. end
  2282.  
  2283. function g.Radar()
  2284.     if not (g.GetValue("Visuals", "Active")) then return end
  2285.     if not (g.GetValue("Visuals", "Radar")) then return end
  2286.    
  2287.     local size = g.GetValue("Visuals", "RadarSize")
  2288.     local size2 = size * .3
  2289.     local scale = 1024
  2290.     local radarPosX = g.RadarPos["x"]
  2291.     local radarPosY = g.RadarPos["y"]
  2292.    
  2293.     g.surface.SetDrawColor(g.Colours["Radar"])
  2294.     g.surface.DrawRect(radarPosX - size, radarPosY - size, 2 * size, 2 * size)
  2295.    
  2296.     g.surface.SetDrawColor(g.Colour(ply))
  2297.     g.surface.DrawOutlinedRect(radarPosX - size, radarPosY - size, 2 * size, 2 * size)
  2298.     g.surface.DrawLine(radarPosX - size + size2, radarPosY, radarPosX + size - size2, radarPosY)
  2299.     g.surface.DrawLine(radarPosX, radarPosY - size + size2, radarPosX, radarPosY + size - size2)
  2300.    
  2301.     for k, v in g.ipairs(g.Either(g.GetValue("ESP", "ShowNPC") or g.GetValue("ESP", "ShowProp") or g.GetValue("ESP", "ShowLoot"), g.ents.GetAll(), g.player.GetAll())) do
  2302.         if (g.CanDraw(v) or (g.GetValue("ESP", "ShowProp") and g.IsProp(v)) or (g.GetValue("ESP", "ShowLoot") and g.IsMurderProp(v))) then
  2303.             local pos = v:GetPos() - ply:GetPos()
  2304.             pos:Rotate(g.Angle(0, -ply:EyeAngles().y + 90, 0))
  2305.            
  2306.             pos.x = g.math.Clamp(pos.x, -scale, scale)
  2307.             pos.y = g.math.Clamp(pos.y, -scale, scale)
  2308.            
  2309.             pos = pos / scale * size
  2310.            
  2311.             if (g.IsProp(v) or g.IsMurderProp(v)) then
  2312.                 g.surface.SetDrawColor(g.Colours["Black"])
  2313.                 g.surface.DrawRect(radarPosX + pos.x - 4, radarPosY - pos.y - 4, 7, 7)
  2314.                
  2315.                 g.surface.SetDrawColor(g.Colour(v))
  2316.                 g.surface.DrawRect(radarPosX + pos.x - 3, radarPosY - pos.y - 3, 5, 5)
  2317.             else
  2318.                 g.DrawArrow(radarPosX + pos.x, radarPosY - pos.y, v:EyeAngles().y, g.Colour(v))
  2319.             end
  2320.         end
  2321.     end
  2322. end
  2323.  
  2324. function g.FreeCamSetup()
  2325.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2326.     if not (g.GetValue("Miscellaneous", "Camera")) then return end
  2327.    
  2328.     if (g.IsKeyDown(g.Binds["FreeCam"])) then
  2329.         if not FreeCam then
  2330.             FreeCam = true
  2331.             FreeCam2 = not FreeCam2
  2332.            
  2333.             if FreeCam2 and not CamPos then
  2334.                 CamPos = ply:GetShootPos()
  2335.             end
  2336.            
  2337.             if FreeCam2 then
  2338.                 CamAng = ply:EyeAngles()
  2339.             end
  2340.         end
  2341.     else
  2342.         FreeCam = false
  2343.     end
  2344. end
  2345.  
  2346. function g.FreeCamMove(cmd)
  2347.     if FreeCam then
  2348.         local ang = ply:EyeAngles()
  2349.         CamPos = CamPos + (ang:Forward() * cmd:GetForwardMove() / 10000 + ang:Right() * cmd:GetSideMove() / 10000) * (cmd:KeyDown(IN_SPEED) and 10 or 3)
  2350.        
  2351.         if (cmd:KeyDown(IN_RELOAD)) then
  2352.             CamPos = ply:GetShootPos()
  2353.             CamAng = ply:EyeAngles()
  2354.         end
  2355.        
  2356.         cmd:SetButtons(0)
  2357.        
  2358.         cmd:SetForwardMove(0)
  2359.         cmd:SetSideMove(0)
  2360.         cmd:SetUpMove(0)
  2361.     end
  2362. end
  2363.  
  2364. function g.SpyCamera()
  2365.     if not (g.GetValue("Visuals", "Active")) then return end
  2366.     if not (g.GetValue("Visuals", "SpyCam")) then return end
  2367.     if (g.GetValue("Miscellaneous", "ThirdPerson")) then return end
  2368.    
  2369.     local ang = g.FakeAng
  2370.     local view = {}
  2371.    
  2372.     g.surface.SetDrawColor(g.Colour(ply))
  2373.     g.surface.DrawRect(g.MirrorPos["x"] - (500 * .5) - 2, g.MirrorPos["y"] - (175 * .5) - 2, 500 + 4, 175 + 4)
  2374.    
  2375.     view.origin = ply:GetShootPos()
  2376.     view.angles = g.Angle(ang.p - ang.p - ang.p, ang.y - 180, ang.r)
  2377.     view.x = g.MirrorPos["x"] - (500 * .5)
  2378.     view.y = g.MirrorPos["y"] - (175 * .5)
  2379.     view.w = 500
  2380.     view.h = 175
  2381.     view.drawviewmodel = false
  2382.    
  2383.     g.render.RenderView(view)
  2384. end
  2385.  
  2386. function g.ASUSShit()
  2387.     if (g.GetValue("Visuals", "Active")) then
  2388.         for k, v in g.ipairs(g.Entity(0):GetMaterials()) do
  2389.             g.Material(v):SetFloat("$alpha", g.GetValue("Visuals", "ASUSW") and g.GetValue("Visuals", "ASUSOpacity") or 1)
  2390.         end
  2391.        
  2392.         for k, v in g.ipairs(g.ents.FindByClass("prop_physics")) do
  2393.             v:SetRenderMode(RENDERMODE_TRANSCOLOR)
  2394.             v:SetKeyValue("renderfx", 0)
  2395.             v:SetColor(g.Color(255, 255, 255, g.GetValue("Visuals", "ASUSP") and 255 * g.GetValue("Visuals", "ASUSOpacity") or 255))
  2396.         end
  2397.     end
  2398. end
  2399.  
  2400. function g.Fullbright()
  2401.     if not (g.GetValue("Visuals", "Active")) then return end
  2402.    
  2403.     if (_Modules["cvar3"] or _Modules["amplify"]) then
  2404.         if (g.GetValue("Visuals", "Fullbright")) then
  2405.             if (_Modules["cvar3"]) then
  2406.                 g.GetConVar("mat_fullbright"):SetValue(1)
  2407.             else
  2408.                 g.ForceVar("mat_fullbright", 1)
  2409.             end
  2410.         else
  2411.             if (_Modules["cvar3"]) then
  2412.                 g.GetConVar("mat_fullbright"):SetValue(0)
  2413.             else
  2414.                 g.ForceVar("mat_fullbright", 0)
  2415.             end
  2416.         end
  2417.     end
  2418. end
  2419.  
  2420. function g.DrawFOV()
  2421.     if not (g.GetValue("Visuals", "Active")) then return end
  2422.     if not (g.GetValue("Visuals", "DrawFOV")) then return end
  2423.    
  2424.     if not (g.GetValue("Aimbot", "Active")) then return end
  2425.     if not (g.GetValue("Aimbot", "CheckFOV")) then return end
  2426.    
  2427.     if (g.GetValue("Miscellaneous", "ThirdPerson")) then return end
  2428.    
  2429.     local fov = g.GetValue("Aimbot", "AimFOV")
  2430.    
  2431.     if (fov > 75) then return end
  2432.    
  2433.     local adjacent = (g.ScrW() * .5) / g.math.atan(g.math.rad(ply:GetFOV()) * .5)
  2434.     local radius = g.math.tan(g.math.rad(fov * .5)) * adjacent
  2435.    
  2436.     g.DrawCircle(g.ScrW() * .5, g.ScrH() * .5, radius, g.Colour(ply))
  2437.    
  2438.     g.DrawCircle(g.ScrW() * .5, g.ScrH() * .5, radius - 1, g.Colours["Black"])
  2439.     g.DrawCircle(g.ScrW() * .5, g.ScrH() * .5, radius + 1, g.Colours["Black"])
  2440. end
  2441.  
  2442. function g.Watermark()
  2443.     g.surface.SetFont("TitleFont")
  2444.    
  2445.     local Width, Height = g.surface.GetTextSize(g.HackName .. " v" .. g.Version)
  2446.    
  2447.     g.MarkX = (g.ScrW() - (Width + 5))
  2448.     g.MarkY = 5
  2449.    
  2450.     g.surface.SetTextColor(g.Colours["Watermark"])
  2451.     g.surface.SetTextPos(g.MarkX, g.MarkY)
  2452.     g.surface.DrawText(g.HackName .. " v" .. g.Version)
  2453. end
  2454.  
  2455. --[[
  2456.    
  2457.     MISCELLANEOUS
  2458.    
  2459. ]]--
  2460. function g.SpamPrefix()
  2461.     if (g.IsRP() and GM.Config.ooc) then
  2462.         return "/ooc "
  2463.     end
  2464.    
  2465.     return ""
  2466. end
  2467.  
  2468. function g.ChatSpam()
  2469.     if not (g.GetValue("Miscellaneous", "Active")) then msg = 0 return end
  2470.     if not (g.GetValue("Miscellaneous", "ChatSpam")) then msg = 0 return end
  2471.     if (g.CurTime() < g.SpamTimer) then return end
  2472.    
  2473.     msg = msg + 1
  2474.    
  2475.     if (msg > #g.Spam) then
  2476.         msg = 1
  2477.     end
  2478.    
  2479.     ply:ConCommand("say " .. g.SpamPrefix() .. g.Spam[msg])
  2480.     g.SpamTimer = g.ServerCurTime + 1
  2481. end
  2482.  
  2483. function g.FlashSpam(cmd)
  2484.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2485.     if not (g.GetValue("Miscellaneous", "FlashSpam")) then return end
  2486.     if not (g.IsKeyDown(g.Binds["FlashKey"])) then return end
  2487.    
  2488.     cmd:SetImpulse(100)
  2489. end
  2490.  
  2491. function g.BunnyHop(cmd)
  2492.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2493.     if not (g.GetValue("Miscellaneous", "Bunnyhop")) then return end
  2494.     if not (g.CanHop()) then return end
  2495.    
  2496.     cmd:RemoveKey(IN_JUMP)
  2497. end
  2498.  
  2499. function g.AutoStrafe(cmd)
  2500.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2501.     if not (g.GetValue("Miscellaneous", "AutoStrafe")) then return end
  2502.     if not (g.CanStrafe()) then return end
  2503.    
  2504.     local strafedir = g.StrafeDir(ply:GetVelocity(), ply:EyeAngles())
  2505.    
  2506.     if (cmd:GetMouseX() > 0 or cmd:GetMouseX() < 0) then
  2507.         cmd:SetSideMove((g.MousePos(cmd:GetMouseX()) and -500 or 500) * strafedir)
  2508.     end
  2509. end
  2510.  
  2511. function g.AutoReload(cmd)
  2512.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2513.     if not (g.GetValue("Miscellaneous", "AutoReload")) then return end
  2514.    
  2515.     local wep = ply:GetActiveWeapon()
  2516.    
  2517.     if (ply:Alive() and g.IsValid(wep)) then
  2518.         if (wep:Clip1() <= 0 and wep:GetMaxClip1() > 0 and g.CurTime() > wep:GetNextPrimaryFire()) then
  2519.             cmd:SetButtons(cmd:GetButtons() + IN_RELOAD)
  2520.         end
  2521.     end
  2522. end
  2523.  
  2524. function g.RapidFire(cmd)
  2525.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2526.     if not (g.GetValue("Miscellaneous", "RapidShoot")) then return end
  2527.    
  2528.     if not (g.CanFire()) and cmd:KeyDown(IN_ATTACK) then
  2529.         cmd:RemoveKey(IN_ATTACK)
  2530.     end
  2531. end
  2532.  
  2533. function g.PlayerCheck()
  2534.     for k, v in g.ipairs(g.player.GetAll()) do
  2535.         if (v:Nick() == "unconnected") then continue end -- there has to be a better way than this, tell me maybe?
  2536.         if not (g.IsValid(v)) then continue end
  2537.         if (v == ply) then continue end
  2538.        
  2539.         if (g.GetValue("Miscellaneous", "Active") and g.GetValue("Miscellaneous", "AdminCheck")) then
  2540.             if (g._IsAdmin(v) and not v.Confirmed1) then
  2541.                 v.Confirmed1 = true
  2542.                 g.ChatAlert(v:Nick() .. " the " .. g.string.lower(v:GetUserGroup()) .. " has been detected.")
  2543.             end
  2544.            
  2545.             if (v.Confirmed1 and not g._IsAdmin(v)) then
  2546.                 v.Confirmed1 = false
  2547.                 g.ChatAlert(v:Nick() .. " is no longer an admin.")
  2548.             end
  2549.         end
  2550.        
  2551.         if (g.GetValue("Miscellaneous", "Active") and g.GetValue("Miscellaneous", "SpecCheck")) then
  2552.             if (v:GetObserverTarget() == ply and not v.Confirmed2) then
  2553.                 v.Confirmed2 = true
  2554.                 g.ChatAlert(v:Nick() .. " is now spectating you.")
  2555.             end
  2556.            
  2557.             if (v.Confirmed2 and v:GetObserverTarget() ~= ply) then
  2558.                 v.Confirmed2 = false
  2559.                 g.ChatAlert(v:Nick() .. " is no longer spectating you.")
  2560.             end
  2561.         end
  2562.        
  2563.         if (g.IsDev(v) and not v.Confirmed3) then
  2564.             v.Confirmed3 = true
  2565.             g.ChatNotify(v:Nick() .. ", the creator of " .. g.HackName .. ", has been detected.")
  2566.         end
  2567.     end
  2568. end
  2569.  
  2570. function g.NameStealer()
  2571.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2572.     if not (g.GetValue("Miscellaneous", "NameStealer")) then return end
  2573.     if (g.engine.ActiveGamemode() == "terrortown" and GAMEMODE.round_state == ROUND_ACTIVE) then return end
  2574.     if (g.ServerCurTime < g.NameStealTimer) then return end
  2575.     if (#g.player.GetAll() <= 2) then return end
  2576.    
  2577.     ::redo::
  2578.     local v = g.player.GetAll()[g.math.random(#g.player.GetAll())]
  2579.    
  2580.     if (v == ply or g.IsDev(v)) then
  2581.         goto redo
  2582.     end
  2583.    
  2584.     if (g.IsRP()) then
  2585.         if (GAMEMODE.Config.allowrpnames) then         
  2586.             g.NameLen = g.string.len(v:Nick())
  2587.             g.Name = g.string.Left(v:Nick(), g.NameLen - 1)
  2588.            
  2589.             ply:ConCommand("darkrp rpname " .. g.Name)
  2590.             g.NameStealTimer = g.ServerCurTime + 10
  2591.         else
  2592.             if (_Modules["amplify"]) then
  2593.                 g.SetName(v:Nick() .. "​")
  2594.                 g.NameStealTimer = g.ServerCurTime + g.GetConVar("sv_namechange_cooldown_seconds"):GetFloat() + 1
  2595.             else
  2596.                 g.ChatAlert("The server has RPName disabled.")
  2597.                 g.NameStealTimer = g.math.huge
  2598.             end
  2599.         end
  2600.     else
  2601.         if (_Modules["amplify"]) then
  2602.             g.SetName(v:Nick() .. "​")
  2603.             g.NameStealTimer = g.ServerCurTime + g.GetConVar("sv_namechange_cooldown_seconds"):GetFloat() + 1
  2604.         else
  2605.             g.ChatAlert("The name stealer only works on DarkRP without amplify.")
  2606.             g.NameStealTimer = g.math.huge
  2607.         end
  2608.     end
  2609. end
  2610.  
  2611. function g.DuckJump(cmd) -- Credits to Deligit and Cdriza
  2612.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2613.     if not (g.GetValue("Miscellaneous", "DuckJump")) then return end
  2614.     if not (g.CanHop()) then return end
  2615.    
  2616.     local pos = ply:GetPos()
  2617.     local trace = {
  2618.         start = pos,
  2619.         endpos = pos - g.Vector(0, 0, 50),
  2620.         mask = MASK_PLAYERSOLID,
  2621.     }
  2622.     local trace = util.TraceLine(trace)
  2623.     local height = (pos - trace.HitPos).z
  2624.    
  2625.     if (height > 25 and 50 > height) then
  2626.         cmd:SetButtons(cmd:GetButtons() + IN_DUCK)
  2627.     end
  2628. end
  2629.  
  2630. function g.UseSpam(cmd)
  2631.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2632.     if not (g.GetValue("Miscellaneous", "UseSpam")) then return end
  2633.    
  2634.     if (cmd:KeyDown(IN_USE) and ply:Alive()) then
  2635.         if (g.Spamming) then
  2636.             cmd:RemoveKey(IN_USE)
  2637.         end
  2638.        
  2639.         g.Spamming = not g.Spamming
  2640.     end
  2641. end
  2642.  
  2643. function g.TraitorDetector()
  2644.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2645.     if not (g.GetValue("Miscellaneous", "TFinder")) then return end
  2646.     if (g.engine.ActiveGamemode() ~= "terrortown") then return end
  2647.        
  2648.     for k, v in g.ipairs(g.ents.GetAll()) do
  2649.         local _v = v:GetOwner()
  2650.        
  2651.         if (_v == ply or g.IsDev(_v)) then continue end
  2652.        
  2653.         if (g.GetRoundState() == 3 and v:IsWeapon() and _v:IsPlayer() and not _v.Detected and g.table.HasValue(v.CanBuy, 1)) then
  2654.             if (_v:GetRole() ~= 2) then
  2655.                 _v.Detected = true
  2656.                 g.ChatAlert("'" .. _v:Nick() .. "' has posession of a '" .. v:GetPrintName() .. "'.")
  2657.             end
  2658.         elseif (g.GetRoundState() ~= 3) then
  2659.             v.Detected = false
  2660.         end
  2661.     end
  2662. end
  2663.  
  2664. function g.MurdererDetector()
  2665.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2666.     if not (g.GetValue("Miscellaneous", "MFinder")) then return end
  2667.     if (g.engine.ActiveGamemode() ~= "murder") then return end
  2668.    
  2669.     for k, v in g.ipairs(g.player.GetAll()) do
  2670.         if (v == ply or g.IsDev(v)) then continue end
  2671.        
  2672.         if (GAMEMODE.RoundStage == 1 and not v.Detected and not v.Magnum) then
  2673.             if (v:HasWeapon("weapon_mu_knife")) then
  2674.                 v.Detected = true
  2675.                 g.ChatAlert(v:Nick() .. " (" .. v:GetNWString("bystanderName") .. ") is the murderer.")
  2676.             end
  2677.            
  2678.             if (v:HasWeapon("weapon_mu_magnum")) then
  2679.                 v.Magnum = true
  2680.                 g.ChatAlert(v:Nick() .. " (" .. v:GetNWString("bystanderName") .. ") has a magnum.")
  2681.             else
  2682.                 v.Magnum = false
  2683.             end
  2684.         elseif (GAMEMODE.RoundStage ~= 1) then
  2685.             v.Detected = false
  2686.             v.Magnum = false
  2687.         end
  2688.     end
  2689. end
  2690.  
  2691. function g.Spinbot(cmd)
  2692.     if not (g.CanSpin(cmd)) then return end
  2693.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2694.     if not (g.GetValue("Miscellaneous", "Spinbot")) then return end
  2695.    
  2696.     cmd:SetViewAngles(g.Angle(-cmd:GetViewAngles().p, (g.CurTime() * 500) % 360, 0))
  2697. end
  2698.  
  2699. function g.GroupReminder()
  2700.     if (g.CurTime() < g.ReminderTimer) then return end
  2701.     if (g.InGroup) then return end
  2702.    
  2703.     g.ChatNotify(g.Reminders[g.math.random(#g.Reminders)])
  2704.     g.ChatNotify("http://steamcommunity.com/gid/" .. g.GroupID .. "/")
  2705.    
  2706.     g.ReminderTimer = g.CurTime() + (2 * 60)
  2707. end
  2708.  
  2709. --[[
  2710.    
  2711.     HOOKING
  2712.    
  2713. ]]--
  2714. g.AddHook("Think", function()
  2715.     g.Lamp()
  2716.     g.MoveUI()
  2717.     g.ASUSShit()
  2718.     g.ChatSpam()
  2719.     g.MenuToggle()
  2720.     g.Fullbright()
  2721.     g.NameStealer()
  2722.     g.PlayerCheck()
  2723.     g.FreeCamSetup()
  2724.     g.GroupReminder()
  2725.     g.TraitorDetector()
  2726.     g.MurdererDetector()
  2727. end)
  2728.  
  2729. g.AddHook("CreateMove", function(cmd)
  2730.     g.Aimbot(cmd)
  2731.     g.Spinbot(cmd)
  2732.     g.UseSpam(cmd)
  2733.     g.BunnyHop(cmd)
  2734.     g.DuckJump(cmd)
  2735.     g.FakeView(cmd)
  2736.     g.FlashSpam(cmd)
  2737.     g.RapidFire(cmd)
  2738.     g.GetTarget(cmd)
  2739.     g.AutoReload(cmd)
  2740.     g.Triggerbot(cmd)
  2741.     g.AutoStrafe(cmd)
  2742.     g.FreeCamMove(cmd)
  2743.    
  2744.     g.FakeLag(cmd)
  2745.     g.MoveFix(cmd)
  2746. end)
  2747.  
  2748. g.AddHook("HUDPaint", function()
  2749.     g.ESP()
  2750.     g.Radar()
  2751.     g.Laser()
  2752.     g.DrawFOV()
  2753.     g.Crosshair()
  2754.     g.SpyCamera()
  2755.     g.Watermark()
  2756. end)
  2757.  
  2758. g.AddHook("PreDrawHalos", function()
  2759.     g.Halo()
  2760. end)
  2761.  
  2762. g.AddHook("entity_killed", function(data)
  2763.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2764.     if not (g.GetValue("Miscellaneous", "DeathNotify")) then return end
  2765.    
  2766.     local inflictor = g.Entity(data.entindex_inflictor)
  2767.     local killer = g.Entity(data.entindex_attacker)
  2768.     local victim = g.Entity(data.entindex_killed)
  2769.    
  2770.     if (g.IsValid(killer) and g.IsValid(victim) and killer:IsPlayer() and victim:IsPlayer()) then
  2771.         if (killer == victim and victim ~= ply) then
  2772.             g.ChatNotify(victim:Nick() .. " killed themself.")
  2773.         elseif (killer == victim and victim == ply) then
  2774.             g.ChatNotify("You killed yourself.")
  2775.         elseif (killer == ply) then
  2776.             g.ChatNotify("You killed " .. victim:Nick() .. ".")
  2777.         elseif (victim == ply) then
  2778.             g.ChatNotify("You were killed by " .. killer:Nick() .. ".")
  2779.         else
  2780.             g.ChatNotify(killer:Nick() .. " killed " .. victim:Nick() .. ".")
  2781.         end
  2782.     elseif (g.IsValid(victim) and not killer:IsPlayer() and victim:IsPlayer()) then
  2783.         if (g.IsValid(inflictor) and inflictor:GetClass() == "prop_physics") then
  2784.             if (victim == ply) then
  2785.                 g.ChatNotify("You were killed by a prop.")
  2786.             else
  2787.                 g.ChatNotify(victim:Nick() .. " was killed by a prop.")
  2788.             end
  2789.         elseif (victim == ply) then
  2790.             g.ChatNotify("You were killed by life.")
  2791.         else
  2792.             g.ChatNotify(victim:Nick() .. " was killed by life.")
  2793.         end
  2794.     end
  2795. end)
  2796.  
  2797. g.AddHook("CalcView", function(ply, pos, ang, fov)
  2798.     local view = {
  2799.         origin = pos
  2800.     }
  2801.    
  2802.     if (g.GetValue("Miscellaneous", "Active") and g.GetValue("Miscellaneous", "CustomFOV")) then
  2803.         view.fov = fov - (90 - g.GetValue("Miscellaneous", "FOV"))
  2804.     end
  2805.    
  2806.     if (ply:Health() > 0 and ply:GetMoveType() ~= 10 and ply:GetObserverTarget() == nil) then
  2807.         if (g.GetValue("Visuals", "Active") and g.GetValue("Visuals", "NoRecoil")) then
  2808.             view.origin = ply:EyePos()
  2809.             view.angles = ply:EyeAngles()
  2810.         end
  2811.        
  2812.         if (g.GetValue("Miscellaneous", "Active")) then
  2813.             if (g.GetValue("Miscellaneous", "ThirdPerson")) then
  2814.                 view.origin = pos - (g.FakeAng:Forward() * 150)
  2815.             end
  2816.         end
  2817.        
  2818.         if (FreeCam) then
  2819.             view.origin = CamPos
  2820.             view.angles = ply:EyeAngles()
  2821.         end
  2822.     end
  2823.    
  2824.     return view
  2825. end)
  2826.  
  2827. g.AddHook("player_hurt", function(data)
  2828.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2829.     if not (g.GetValue("Miscellaneous", "Hitsound")) then return end
  2830.    
  2831.     local health = data.health
  2832.     local attacker = data.attacker
  2833.    
  2834.     local Hit, Kill
  2835.    
  2836.     if (g.GetValue("Miscellaneous", "HitsoundType") == "Quake") then
  2837.         Hit = "quake/Hit.wav"
  2838.         Kill = "quake/Hit.wav"
  2839.     elseif (g.GetValue("Miscellaneous", "HitsoundType") == "Overwatch") then
  2840.         Hit = "overwatch/Hit.wav"
  2841.         Kill = "overwatch/Kill.wav"
  2842.     elseif (g.GetValue("Miscellaneous", "HitsoundType") == "Dark Souls") then
  2843.         Hit = "darksouls/Hit.wav"
  2844.         Kill = "darksouls/Kill.wav"
  2845.     else
  2846.         Hit = "tf2/Hit.wav"
  2847.         Kill = "tf2/Kill.wav"
  2848.     end
  2849.    
  2850.     if (attacker == ply:UserID()) then
  2851.         if (health > 0) then
  2852.             g.surface.PlaySound(Hit)
  2853.         else
  2854.             g.surface.PlaySound(Kill)
  2855.         end
  2856.     end
  2857. end)
  2858.  
  2859. g.AddHook("OnPlayerChat", function(v, text, team)
  2860.     if not (g.GetValue("Miscellaneous", "Active")) then return end
  2861.     if not (g.GetValue("Miscellaneous", "CopyCat")) then return end
  2862.    
  2863.     if (v ~= ply and not g.IsDev(v)) then
  2864.         if (team) then
  2865.             ply:ConCommand("say_team '" .. text .. "' - " .. v:Nick())
  2866.         else
  2867.             ply:ConCommand("say '" .. text .. "' - " .. v:Nick())
  2868.         end
  2869.     end
  2870. end)
  2871.  
  2872. g.AddHook("PreRender", function()
  2873.     if (g.GetValue("Visuals", "Fullbright") and not (_Modules["cvar3"] or _Modules["amplify"])) then
  2874.         g.render.SetLightingMode(1)
  2875.         g.LightingModeChanged = true
  2876.     end
  2877.    
  2878.     if (g.SiteOpen) then
  2879.         g.gui.HideGameUI()
  2880.     end
  2881. end)
  2882.  
  2883. g.AddHook("PostDraw2DSkyBox", function()
  2884.     if not (g.GetValue("Visuals", "Active")) then return end
  2885.     if not (g.GetValue("Visuals", "NoSky")) then return end
  2886.    
  2887.     if (g.GetValue("Visuals", "SkyType") == "None") then
  2888.         g.render.Clear(0, 0, 0, 0)
  2889.     elseif (g.GetValue("Visuals", "SkyType") == "Rave") then
  2890.         g.render.Clear(g.math.random(255), g.math.random(255), g.math.random(255), 255)
  2891.     else
  2892.         local col = g.HSVToColor(g.RealTime() * 45 % 720, 1, 1)
  2893.         g.render.Clear(col.r, col.g, col.b, 255)
  2894.     end
  2895. end)
  2896.  
  2897. g.AddHook("PostRender", function()
  2898.     if g.LightingModeChanged then
  2899.         g.render.SetLightingMode(0)
  2900.         g.LightingModeChanged = false
  2901.     end
  2902. end)
  2903. g.AddHook("PreDrawHUD", function()
  2904.     if g.LightingModeChanged then
  2905.         g.render.SetLightingMode(0)
  2906.         g.LightingModeChanged = false
  2907.     end
  2908. end)
  2909.  
  2910. g.AddHook("AdjustMouseSensitivity", function()
  2911.     if not (g.GetValue("Triggerbot", "SlowAim")) then return end
  2912.     if not (g.Triggering) then return end
  2913.    
  2914.     return .25
  2915. end)
  2916.  
  2917. g.AddHook("Move", function()
  2918.     if (g.IsFirstTimePredicted()) then
  2919.         g.ServerCurTime = g.CurTime() + g.engine.TickInterval()
  2920.     end
  2921. end)
  2922.  
  2923. g.AddHook("ShouldDrawLocalPlayer", function()
  2924.     return (g.GetValue("Miscellaneous", "Active") and (g.GetValue("Miscellaneous", "ThirdPerson") or g.GetValue("Miscellaneous", "Camera") and g.IsKeyDown(g.Binds["FreeCam"])))
  2925. end)
  2926.  
  2927. g.AddHook("StartChat", function()
  2928.     g.IsTyping = true
  2929. end)
  2930.  
  2931. g.AddHook("FinishChat", function()
  2932.     g.IsTyping = false
  2933. end)
  2934.  
  2935. g.AddHook("ScoreboardShow", function()
  2936.     g.Scoreboard = true
  2937. end)
  2938.  
  2939. g.AddHook("ScoreboardHide", function()
  2940.     g.Scoreboard = false
  2941.     g.SaveConfig()
  2942. end)
  2943.  
  2944. g.AddHook("PhysgunPickup", function(v, ent)
  2945.     if (v == ply) then
  2946.         g.Holding = true
  2947.     end
  2948.    
  2949.     return true
  2950. end)
  2951.  
  2952. g.AddHook("PhysgunDrop", function(v, ent)
  2953.     if (v == ply) then
  2954.         g.Holding = false
  2955.     end
  2956. end)
  2957.  
  2958. g.AddHook("EntityFireBullets", function(ent, data)
  2959.     local wep = ent:GetActiveWeapon():GetClass()
  2960.    
  2961.     if (cones[wep] != -data.Spread) then
  2962.         cones[wep] = -data.Spread
  2963.     end
  2964. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement