Advertisement
Guest User

Untitled

a guest
Aug 7th, 2012
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 36.16 KB | None | 0 0
  1. /*Hemi Hacks by: Hemirox*/
  2. if( SERVER ) then return end
  3.  
  4.  
  5. /*---------Variables---------*/
  6.  
  7. require ( "gamemode" )
  8. include("includes/enum/teams.lua")
  9. require ( "team" )
  10. require ( "vehicles" )
  11. require ( "usermessage" )
  12. require ( "list" )
  13. require ( "datastream" )
  14. require ( "markup" )
  15. require ( "undo" )
  16. require ( "cleanup" )
  17. require ( "duplicator" )
  18. require ( "constraint" )
  19. require ( "weapons" )
  20. require ( "timer" )
  21. require ( "schedule" )
  22. require ( "scripted_ents" )
  23. require ( "player_manager" )
  24. require ( "construct" )
  25. require ( "effects" )
  26. require ( "killicon" )
  27. require ( "spawnmenu" )
  28. require ( "controlpanel" )
  29. require ( "presets" )
  30. require ( "cookie" )
  31. require ( "glon" )
  32.  
  33. local hook = require ( "hook" )
  34. local draw = require ( "draw" )
  35. local cvars = require ( "cvars" )
  36. local concommand = require ( "concommand" )
  37.  
  38. HH = {}
  39. HH.BH = {}
  40.  
  41. /*Static Variables*/
  42. HH.AimbotIsOn = false
  43. HH.IsLocked = false
  44. HH.LockedPlayer = nil
  45. HH.BHop = false
  46. HH.Me = LocalPlayer
  47. HH.LastReload = 0
  48. HH.Friends = ( file.Exists("hh_friends.txt") and glon.decode(file.Read("hh_friends.txt")) or {} )
  49. HH.Teams = ( file.Exists("hh_teams.txt") and glon.decode(file.Read("hh_teams.txt")) or {} )
  50. HH.CustomEnts = ( file.Exists("hh_ents.txt") and glon.decode(file.Read("hh_ents.txt")) or {} )
  51. HH.TargetBone = ( file.Exists("hh_bone.txt") and file.Read("hh_bone.txt") or "ValveBiped.Bip01_Head1" )
  52. HH.CNPos = HH.Me():EyePos()
  53. HH.BH.Hops = 0
  54. HH.BH.MaxSpeed = 0
  55. HH.SpeedOn = false
  56. HH.PerpEnabled = false
  57. HH.MenuCreated = false
  58. HH.CanDoSteamStuff = false
  59. HH.Loaded = false
  60.  
  61. /*Client Changeable Vars*/
  62. HH.AutoShoot = CreateClientConVar( "hh_autoshoot", "1", true, false )
  63. HH.MaxAimAngle = CreateClientConVar( "hh_maxangle", "90", true, false )
  64. HH.CheckLos = CreateClientConVar( "hh_checklos", "1", true, false )
  65. HH.IgnoreSteamFriends = CreateClientConVar( "hh_ignoresteamfriends", "1", true, false )
  66. HH.ESPEnabled = CreateClientConVar( "hh_espenabled", "1", true, false )
  67. HH.ShowPlayers = CreateClientConVar( "hh_showplayers", "1", false, false )
  68. HH.ShowEnts = CreateClientConVar( "hh_showents", "1", false, false )
  69. HH.ESPDist = CreateClientConVar( "hh_espdist", "2500", true, false )
  70. HH.CustomBone = CreateClientConVar( "hh_custombone", "0", true, false )
  71. HH.DrawCrosshair = CreateClientConVar( "hh_crosshair", "1", true, false )
  72. HH.ShowAdmins = CreateClientConVar( "hh_showadmins", "1", true, false )
  73. HH.AutoReload = CreateClientConVar( "hh_autoreload", "1", true, false )
  74. HH.ShowLaserEyes = CreateClientConVar( "hh_lasereyes", "1", true, false )
  75. HH.FriendsBlackList = CreateClientConVar( "hh_friendsblacklist", "0", true, false )
  76. HH.TeamsBlackList = CreateClientConVar( "hh_teamsblacklist", "1", true, false )
  77. HH.IgnoreFriends = CreateClientConVar( "hh_ignorefriends", "0", true, false )
  78. HH.IgnoreTeams = CreateClientConVar( "hh_ignoreteams", "0", true, false )
  79. HH.IgnoreOwnTeam = CreateClientConVar( "hh_ignoreownteam", "0", true, false )
  80. HH.NoRecoil = CreateClientConVar( "hh_norecoil", "1", true, false )
  81. HH.WallHackEnabled = CreateClientConVar( "hh_wallhack", "0", true, false )
  82. HH.WallHackSolid = CreateClientConVar( "hh_solidwallhack", "1", true, false )
  83. HH.Chams = CreateClientConVar( "hh_chams", "1", true, false )
  84. HH.IgnoreAdmins = CreateClientConVar( "hh_ignoreadmins", "0", true, false )
  85. HH.ClientNoclip = CreateClientConVar( "hh_clientnoclip", "0", true, false )
  86. HH.CNSpeed = CreateClientConVar( "hh_clientnoclipspeed", "10", true, false )
  87. HH.ThirdPerson = CreateClientConVar( "hh_thirdperson", "0", true, false )
  88. HH.ThirdDist = CreateClientConVar( "hh_thirdpersondist", "10", true, false )
  89. HH.SpeedHackSpeed = CreateClientConVar( "hh_speedhackspeed", "5.0", true, false )
  90. HH.AntiAfkEnabled = CreateClientConVar( "hh_antiafkkicker", "0", false, false )
  91. HH.NoSpreadEnabled = CreateClientConVar( "hh_nospread", "1", false, false )
  92. HH.LogIps = CreateClientConVar( "hh_logips", "1", true, false )
  93. HH.NameChanger = CreateClientConVar( "hh_namechanger", "0", false, false )
  94. HH.ShowTraitors = CreateClientConVar( "hh_showtraitors", "1", false, false )
  95. HH.OnlyTargetTraitors = CreateClientConVar( "hh_targettraitors", "0", false, false )
  96. RunConsoleCommand( "hh_namechanger", "0" )
  97. HH.HostTimeScale = GetConVar( "host_timescale" )
  98.  
  99. /*Valid Bones*/
  100. HH.ValidBones = {
  101. "ValveBiped.Bip01_Head1",
  102. "ValveBiped.Bip01_Spine",
  103. "ValveBiped.Bip01_Spine2",
  104. "ValveBiped.Bip01_Pelvis",
  105. "ValveBiped.Bip01_L_Hand",
  106. "ValveBiped.Bip01_R_Hand",
  107. "ValveBiped.Bip01_L_Thigh",
  108. "ValveBiped.Bip01_R_Thigh",
  109. "ValveBiped.Bip01_L_Calf",
  110. "ValveBiped.Bip01_R_Calf",
  111. "ValveBiped.Bip01_L_Foot",
  112. "ValveBiped.Bip01_R_Foot",
  113. }
  114.  
  115. HH.InvalidEnts = {
  116. "player",
  117. "prop_physics",
  118. "viewmodel",
  119. }
  120.  
  121. surface.CreateFont ( "ScoreboardText", 15, 700, true, false, "HHScoreboardText" )
  122.  
  123. timer.Simple(1, function()
  124.     HH.Notify( "Loading Modules..." )
  125.     HH.ModLoaded = require( "hh" )
  126.     if( HH.ModLoaded ) then
  127.         HH_ForceCvar( GetConVar("sv_cheats"), "1" )
  128.     end
  129. end )
  130.  
  131. timer.Simple(2, function()
  132.     HH.CanNospread = require( "hhns" )
  133.     if( HH.CanNospread ) then
  134.         HH.hl2_ucmd_getprediciton = hl2_ucmd_getprediciton
  135.         HH.hl2_shotmanip = hl2_shotmanip
  136.     end
  137. end )
  138.  
  139.  
  140. /*---------Functions---------*/
  141.  
  142.  
  143. /*Get Target*/
  144. function HH.GetNextTarget()
  145.     if( HH.IsLocked and HH.IsValidPlayer( HH.LockedPlayer ) ) then return end
  146.     local trace = HH.Me():GetEyeTrace()
  147.     local aimpos = ( trace.HitPos - HH.Me():GetShootPos() ):Angle()
  148.     local pls = {}
  149.     for k, v in pairs( player.GetAll() ) do
  150.         if( HH.IsValidPlayer( v ) ) then
  151.             local td = {}
  152.             local targethead = v:LookupBone( HH.GetBone() )
  153.             td.start = HH.Me():EyePos()
  154.             td.endpos = v:GetBonePosition( targethead )
  155.             local angle = HH.Me():GetAimVector()
  156.             local difference = ( td.endpos - td.start ):Normalize()
  157.             difference = difference - angle
  158.             difference = difference:Length()
  159.             difference = math.abs( difference * 90 )
  160.             if( HH.InFov( v ) ) then
  161.                 table.insert( pls, v )
  162.             end
  163.         end
  164.     end
  165.    
  166.     if( #pls > 1 ) then
  167.         HH.LockedPlayer = HH.GetClosest( pls )
  168.         HH.IsLocked = true
  169.     elseif( #pls == 1 ) then
  170.         HH.LockedPlayer = pls[1]
  171.         HH.IsLocked = true
  172.     else
  173.         HH.IsLocked = false
  174.     end
  175. end
  176.  
  177. /*Fov Check*/
  178. function HH.InFov( ent )
  179.     local fov = HH.MaxAimAngle:GetInt() --Convar
  180.     if( fov != 180 ) then
  181.         local lpang = HH.Me():GetAngles()
  182.         local ang = ( ent:GetBonePosition( ent:LookupBone( HH.GetBone() ) ) - HH.Me():EyePos() ):Angle()
  183.         local ady = math.abs( math.NormalizeAngle( lpang.y - ang.y ) )
  184.         local adp = math.abs( math.NormalizeAngle( lpang.p - ang.p ) )
  185.         if( ady > fov || adp > fov ) then return false end
  186.     end
  187.     return true
  188. end
  189.  
  190. /*Los Check*/
  191. function HH.HasLos( ply )
  192.     local td = {}
  193.     td.start = HH.Me():GetShootPos()
  194.     td.endpos = ply:GetBonePosition( ply:LookupBone( HH.GetBone() ) )
  195.     td.mask = 1174421507
  196.     td.filter = { HH.Me(), ply }
  197.    
  198.     local trace = util.TraceLine( td )
  199.     if( trace.Fraction == 1 ) then
  200.         return true
  201.     end
  202.     return false
  203. end
  204.  
  205. /*Get Closest Target*/
  206. function HH.GetClosest( pls )
  207.     local pos = HH.Me():EyePos()
  208.     local ang = HH.Me():GetAimVector()
  209.     local returnply = { 0, 0 }
  210.     for k, v in ipairs( pls ) do
  211.         if( HH.IsValidPlayer( v ) ) then
  212.             local plypos = v:GetBonePosition( v:LookupBone( HH.GetBone() ) )
  213.             local difr = ( plypos - pos ):Normalize()
  214.             difr = difr - ang
  215.             difr = difr:Length()
  216.             difr = math.abs( difr )
  217.             if( difr < returnply[2] || returnply[1] == 0 ) then
  218.                 returnply = { v, difr }
  219.             end
  220.         end
  221.     end
  222.     return returnply[1]
  223. end
  224.  
  225. /*Check Valid Players*/
  226. function HH.IsValidPlayer( ply )
  227.     if( !ply or !ply:IsValid() ) then return false end --Check if player is valid
  228.     if( ply == HH.Me() ) then return false end --Don't target self
  229.     if( HH.CheckLos:GetBool() and !HH.HasLos( ply ) ) then return false end --Check for Line of Sight
  230.     if( ply:GetFriendStatus() == "friend" and HH.IgnoreSteamFriends:GetBool() ) then return false end --Ignore Steam friends
  231.     if( !HH.AliveCheck( ply ) or ply:InVehicle() or HH.Me():InVehicle() or !HH.AliveCheck( HH.Me() ) ) then return false end
  232.     if( HH.IgnoreOwnTeam:GetBool() and ply:Team() == HH.Me():Team() ) then return false end
  233.     if( ply:GetMoveType() == MOVETYPE_NONE ) then return false end
  234.     if( ply:IsPlayer() and ply:GetMoveType() == MOVETYPE_OBSERVER ) then return false end
  235.     if( HH.IgnoreAdmins:GetBool() and ply:IsAdmin() ) then return false end
  236.     if( HH.OnlyTargetTraitors:GetBool() and !HH.IsTraitor( ply ) ) then return false end
  237.        
  238.     if( HH.FriendsBlackList:GetBool() ) then
  239.         if( !table.HasValue( HH.Friends, ply:SteamID() )  and !HH.IgnoreFriends:GetBool() ) then
  240.             return false
  241.         end
  242.     else
  243.         if( table.HasValue( HH.Friends, ply:SteamID() ) and !HH.IgnoreFriends:GetBool() ) then
  244.             return false
  245.         end
  246.     end
  247.    
  248.     if( HH.TeamsBlackList:GetBool() ) then
  249.         if( !HH.IsGoodTeam( team.GetName( ply:Team() ) ) and !HH.IgnoreTeams:GetBool() ) then
  250.             return false
  251.         end
  252.     else
  253.         if( HH.IsGoodTeam( team.GetName( ply:Team() ) ) and !HH.IgnoreTeams:GetBool() ) then
  254.             return false
  255.         end
  256.     end
  257.    
  258.     return true
  259. end
  260.  
  261. /*Add Friend*/
  262. function HH.AddFriend( ply )
  263.     if( ply:IsPlayer() and ply:IsValid() and ply != HH.Me() and !table.HasValue (HH.Friends, ply:SteamID() ) ) then
  264.         table.insert( HH.Friends, ply:SteamID() )
  265.         file.Write( "hh_friends.txt", glon.encode( HH.Friends ) )
  266.     end
  267. end
  268.  
  269. /*Remove Friend*/
  270. function HH.RemoveFriend( ply )
  271.     if( ply:IsPlayer() and ply:IsValid() and ply != HH.Me() ) then
  272.         for k, v in pairs( HH.Friends ) do
  273.             if( string.Trim( v ) == ply:SteamID() ) then
  274.                 HH.Friends[k] = nil
  275.             end
  276.         end
  277.         file.Write( "hh_friends.txt", glon.encode( HH.Friends ) )
  278.     end
  279. end
  280.  
  281. /*Clear Friends*/
  282. function HH.ClearFriendsList()
  283.     HH.Friends = {}
  284.     file.Write( "hh_friends.txt", glon.encode( HH.Friends ) )
  285. end
  286.  
  287. function HH.IsFriend( ply )
  288.     return table.HasValue( HH.Friends, ply:SteamID() )
  289. end
  290.  
  291. /*Add Ent*/
  292. function HH.AddEnt( entclass )
  293.     if( !table.HasValue( HH.CustomEnts, entclass ) ) then
  294.         table.insert( HH.CustomEnts, entclass )
  295.         file.Write( "hh_ents.txt", glon.encode( HH.CustomEnts ) )
  296.     end
  297. end
  298.  
  299. /*Remove Ent*/
  300. function HH.RemoveEnt( entclass )
  301.     for k, v in pairs( HH.CustomEnts ) do
  302.         if( string.Trim( v ) == entclass ) then
  303.             HH.CustomEnts[k] = nil
  304.         end
  305.     end
  306.     file.Write( "hh_ents.txt", glon.encode( HH.CustomEnts ) )
  307. end
  308.  
  309. /*Clear Ents*/
  310. function HH.ClearEnts()
  311.     HH.CustomEnts = {}
  312.     file.Write( "hh_ents.txt", glon.encode( HH.CustomEnts ) )
  313. end
  314.  
  315. function HH.IsCustomEnt( entclass )
  316.     return table.HasValue( HH.CustomEnts, entclass )
  317. end
  318.  
  319. /*Add Team*/
  320. function HH.AddTeam( teamname )
  321.     table.insert( HH.Teams, teamname )
  322.     file.Write( "hh_teams.txt", glon.encode( HH.Teams ) )
  323. end
  324.  
  325. /*Remove Team*/
  326. function HH.RemoveTeam( teamname )
  327.     for k, v in pairs( HH.Teams ) do
  328.         if( string.Trim( v ) == teamname ) then
  329.             HH.Teams[k] = nil
  330.         end
  331.     end
  332.     file.Write( "hh_teams.txt", glon.encode( HH.Teams ) )
  333. end
  334.  
  335. function HH.IsGoodTeam( teamname )
  336.     return table.HasValue( HH.Teams, teamname )
  337. end
  338.  
  339. /*Clear Teams*/
  340. function HH.ClearTeams()
  341.     HH.Teams = {}
  342.     file.Write( "hh_teams.txt", glon.encode( HH.Teams ) )
  343. end
  344.  
  345. /*Get Target Bone*/
  346. function HH.GetBone()
  347.     if HH.CustomBone:GetBool() then
  348.         return HH.TargetBone
  349.     else
  350.         return "ValveBiped.Bip01_Head1"
  351.     end
  352. end
  353.  
  354. /*Set Target Bone*/
  355. function HH.SetBone( bone )
  356.     if table.HasValue( HH.ValidBones, bone ) then
  357.         HH.TargetBone = bone
  358.         file.Write( "hh_bone.txt", HH.TargetBone )
  359.     end
  360. end
  361.  
  362. /*Get Wallhack material*/
  363. function HH:CreateMaterial()
  364.     local BaseInfo = {
  365.         ["$basetexture"] = "models/debug/debugwhite",
  366.         ["$model"]       = 1,
  367.         ["$translucent"] = 1,
  368.         ["$alpha"]       = 1,
  369.         ["$nocull"]      = 1,
  370.         ["$ignorez"]     = 1
  371.     }
  372.    
  373.     local mat
  374.     if( HH.WallHackSolid:GetBool() ) then
  375.         mat = CreateMaterial( "pb_solid_mat", "VertexLitGeneric", BaseInfo )
  376.     else
  377.         mat = CreateMaterial( "pb_wireframemat", "Wireframe", BaseInfo )
  378.     end  
  379.    return mat
  380. end
  381.  
  382. /*Esp Distance Check*/
  383. function HH.IsCloseEnough( ent )
  384.     local dist = ent:GetPos():Distance( HH.Me():GetPos() )
  385.     if( dist <= HH.ESPDist:GetInt() and ent:GetPos() != Vector( 0, 0, 0 ) ) then
  386.         return true
  387.     end
  388.     return false   
  389. end
  390.  
  391. /*Notify*/
  392. function HH.Notify( msg, sound )
  393.     HH.Me():ChatPrint( "[HH] " .. msg )
  394.     if( sound ) then
  395.         local beep = Sound( "/buttons/button17.wav" )
  396.         local mysound = CreateSound( HH.Me(), beep )
  397.         mysound:Play()
  398.     end
  399. end
  400.  
  401. /*No Spread*/
  402. HH.CustomCones = {}
  403. HH.CustomCones["#HL2_SMG1"]        = Vector( -0.04362, -0.04362, -0.04362 )
  404. HH.CustomCones["#HL2_Pistol"]      = Vector( -0.0100, -0.0100, -0.0100 )
  405. HH.CustomCones["#HL2_Pulse_Rifle"] = Vector( -0.02618, -0.02618, -0.02618 )
  406.  
  407. function HH.PredictSpread( cmd, aimAngle )
  408.         local cmd2, seed = HH.hl2_ucmd_getprediciton( cmd )
  409.         local currentseed = 0, 0, 0
  410.         if( cmd2 != 0 ) then currentseed = seed end
  411.         local wep = HH.Me():GetActiveWeapon()
  412.         local vecCone, valCone = Vector( 0, 0, 0 )
  413.         if( ValidEntity( wep ) ) then
  414.                 if( wep.Initialize ) then
  415.                         valCone = wep.Primary && wep.Primary.Cone || 0
  416.                         if( tonumber( valCone ) ) then
  417.                                 vecCone = Vector( -valCone, -valCone, -valCone )
  418.                         elseif( type( valCone ) == "Vector" ) then
  419.                                 vecCone = -1 * valCone
  420.                         end
  421.                 else
  422.                         local pn = wep:GetPrintName()
  423.                         if( HH.CustomCones[pn] ) then vecCone = HH.CustomCones[pn] end
  424.                 end
  425.         end
  426.         return HH.hl2_shotmanip( currentseed || 0, ( aimAngle || HH.Me():GetAimVector():Angle() ):Forward(), vecCone ):Angle()
  427. end
  428.  
  429. /*Ip Logging*/
  430. HH.IPS = {}
  431. function HH.SaveIPs()
  432.     local s = ""
  433.     for k,v in pairs( HH.IPS ) do
  434.         s = s..k.."="..v.."\n"
  435.     end
  436.    
  437.     if HH.LogIps:GetBool() then
  438.         file.Write( "hh_loggedips.txt", s )
  439.     end
  440. end
  441.  
  442. function HH.LoadIPs()
  443.     if !file.Read( "hh_loggedips.txt" ) then
  444.         file.Write( "hh_loggedips.txt", "" )
  445.     end
  446.     local tbl = string.Explode( "\n", file.Read( "hh_loggedips.txt" ) )
  447.     HH.IPS = {}
  448.     for k,v  in pairs(tbl) do
  449.         local sep = string.Explode( "=", v )
  450.         if sep and table.getn( sep ) == 2 then
  451.             HH.IPS[ sep[ 1 ] ] = sep[ 2 ]
  452.         end
  453.     end
  454. end
  455. HH.LoadIPs()
  456.  
  457. /*Load Steamworks*/
  458. function HH.IsSteamOk()
  459.     local loaded = require( "steamworks" )
  460.     if( !loaded ) then return false end
  461.     local steamClient007 = steamworks.ISteamClient( 7 )
  462.     if ( !steamClient007 ) then return false end
  463.     local hSteamPipe = steamClient007:CreateSteamPipe()
  464.     if ( !hSteamPipe ) then return false end
  465.     local hSteamUser = steamClient007:ConnectToGlobalUser( hSteamPipe )
  466.     if ( !hSteamUser ) then return false end
  467.     local steamUser012 = steamClient007:GetISteamUser( hSteamUser, hSteamPipe, 12 )
  468.     if ( !steamUser012 ) then return false end
  469.     if ( !steamUser012:LoggedOn() ) then return false end
  470.     HH.SteamUser = steamClient007:GetISteamFriends( hSteamUser, hSteamPipe, 5 )
  471.     if ( !HH.SteamUser ) then return false end
  472.     return true
  473. end
  474.  
  475. HH.TGuns = { "weapon_ttt_c4", "weapon_ttt_knife", "weapon_ttt_phammer", "weapon_ttt_sipistol", "weapon_ttt_flaregun", "weapon_ttt_push", "weapon_ttt_radio", "weapon_ttt_teleport" }
  476. HH.Traitors = {}
  477. local allocatedweapons = {}
  478. local cleared = false
  479.  
  480. function HH.PrintTraitors()
  481.     MsgN( "----------------Traitors----------------------")
  482.     for k , v in pairs( HH.Traitors ) do
  483.         print( v:Nick() )
  484.     end
  485.     print( #HH.Traitors.." of total ".. math.floor( #player.GetAll() / 4 ).." traitors detected." )
  486.     MsgN("-----------------------------------------------")
  487. end
  488. concommand.Add( "hh_printtraitors" , HH.PrintTraitors )
  489.  
  490. function HH.IsTraitor(pl)
  491.     return table.HasValue( HH.Traitors , pl )
  492. end
  493.  
  494. local umsg = usermessage.IncomingMessage
  495.  
  496. function usermessage.IncomingMessage( name , um , ... )
  497.     if name == "ttt_role" and HH.ShowTraitors:GetBool() then
  498.         print( "[HH] Clearing traitors - round end." )
  499.         for k , v in pairs( HH.Traitors ) do
  500.             if ValidEntity( v ) then
  501.                 Msg( string.format( "Removing traitor %s - the round has ended." , v:Nick() ), false )
  502.             end
  503.             HH.Traitors[k] = nil
  504.         end
  505.     end
  506.    
  507.     return umsg( name , um , ... )
  508. end
  509.  
  510. function HH.CheckTraitors()
  511.     if not GAMEMODE or not GAMEMODE.Name or not string.find( GAMEMODE.Name , "Trouble in Terror" ) or !HH.ShowTraitors then return end
  512.     for _, pl in pairs( player.GetAll() ) do
  513.         for k, wep in pairs( ents.GetAll() ) do
  514.             if( ValidEntity( wep ) and wep:IsWeapon() and table.HasValue( HH.TGuns , wep:GetClass() ) ) then   
  515.                 if pl:GetPos():Distance( wep:GetPos() ) <= 36 and not table.HasValue( HH.Traitors , pl ) and !table.HasValue( allocatedweapons , wep ) and not pl:IsDetective() and pl:Alive() then
  516.                     HH.Notify( string.format( "Player %s has traitor weapon %s" , pl:Nick() , wep:GetClass() ), true )
  517.                     table.insert( HH.Traitors,  pl )
  518.                     table.insert( allocatedweapons , wep )
  519.                     cleared = false
  520.                 end
  521.             end
  522.         end
  523.         if table.HasValue( HH.Traitors , pl ) and (!HH.AliveCheck( pl ) or pl:GetMoveType() == MOVETYPE_OBSERVER ) then
  524.             HH.Notify( string.format( "Traitor %s has died" , pl:Nick()  ), true )
  525.             for a , b in pairs( HH.Traitors ) do
  526.                 if b == pl then
  527.                     HH.Traitors[a] = nil
  528.                 end
  529.             end
  530.         end
  531.     end
  532. end
  533.  
  534. function HH.AliveCheck( ply )
  535.     return ply:IsPlayer() and ply:Alive() and ply:Health() > 0
  536. end
  537.  
  538.  
  539. /*---------Hooks---------*/
  540.  
  541.  
  542.  /*Player Connect*/
  543.  function HH.PConnect( name, ip )
  544.     if !HH.ModLoaded then return end
  545.     if ip != "none" and string.Left( ip, 2 ) != "0." then HH.IPS[ string.gsub( name,"=", "" ) ] = ip end
  546.     HH.SaveIPs()
  547.     if HH.MenuCreated then
  548.         HH.RefreshIpMenu()
  549.     end
  550.    
  551.     if !HH.LogIps:GetBool() then return end
  552.     print("")
  553.     print( "[HH] " .. name .. " Connected from ip: " .. ip )
  554.     print("")
  555. end
  556. hook.Add( "HHPlayerConnect", "HH_LogIps", HH.PConnect )
  557.  
  558.  /*TriggerBot*/
  559. function HH.TriggerBot()
  560.     if HH.AliveCheck( HH.Me() ) and HH.Me():GetActiveWeapon():IsValid() and HH.AimbotIsOn and !HH.Me():InVehicle() and HH.AutoShoot:GetBool() then
  561.         if ( !Firing and HH.IsLocked and HH.IsValidPlayer( HH.LockedPlayer ) ) then
  562.             RunConsoleCommand( "+attack" )
  563.             HH.Me():GetActiveWeapon().SetNextPrimaryFire( HH.Me():GetActiveWeapon() )
  564.             Firing = true
  565.         else
  566.             RunConsoleCommand( "-attack" )
  567.             Firing = false
  568.         end
  569.     end
  570. end
  571.  
  572. /*AimBot*/
  573. function HH.AimBot( cmd )
  574.     if( HH.AimbotIsOn ) then
  575.         if( !HH.IsLocked or !HH.IsValidPlayer( HH.LockedPlayer ) ) then
  576.             HH.GetNextTarget()
  577.             return
  578.         end
  579.        
  580.         local ply = HH.LockedPlayer
  581.         local targethead = ply:LookupBone( HH.GetBone() )
  582.         local mepos = HH.Me():EyePos()
  583.         local hepos = ply:GetBonePosition( targethead )
  584.         ang = ( hepos-mepos ):Angle()
  585.         ang.p = math.NormalizeAngle( ang.p )
  586.         ang.y = math.NormalizeAngle( ang.y )
  587.         ang.r = math.NormalizeAngle( ang.r )
  588.         if( HH.NoSpreadEnabled:GetBool() and HH.CanNospread ) then
  589.             ang = HH.PredictSpread( cmd, ang )
  590.         end
  591.         //HH.Me():SetEyeAngles( ang )
  592.         cmd:SetViewAngles( ang )
  593.     end
  594. end
  595.  
  596. /*Name Changer*/
  597. timer.Create( "HH_NameChanger", 0.2, 0, function()
  598.     if( !HH.CanDoSteamStuff ) then return end
  599.     if( !HH.NameChanger:GetBool() ) then return end
  600.     if( !HH.SteamUser ) then return end
  601.  
  602.     HH.SteamUser:SetPersonaName( player.GetAll()[ math.random( 1, #player.GetAll() ) ]:Nick() .. " ~" )
  603. end )
  604.  
  605. /*SpeedHack*/
  606. function HH.SpeedHack()
  607.     if !HH.ModLoaded then return end
  608.     if( HH.Speed and HH.HostTimeScale:GetFloat() == 1) then
  609.         HH_ForceCvar( GetConVar( "host_timescale" ),  tostring( HH.SpeedHackSpeed:GetFloat() ) )
  610.     elseif( !HH.Speed and HH.HostTimeScale:GetFloat() != 1 ) then
  611.         HH_ForceCvar( GetConVar( "host_timescale" ),  "1" )
  612.     end
  613. end
  614.  
  615. local nonreloaders = {"weapon_physgun" , "gmod_tool" , "weapon_gravgun"}
  616. /*Auto Reload*/
  617. function HH.DoAutoReload()
  618.     if( HH.AutoReload:GetBool() and HH.AliveCheck( HH.Me() ) and HH.Me():GetActiveWeapon() and ValidEntity( HH.Me():GetActiveWeapon() ) ) then
  619.         if( HH.Me():GetActiveWeapon():Clip1() <= 0 and CurTime() > ( HH.LastReload + 5 ) and !table.HasValue( nonreloaders, HH.Me():GetActiveWeapon():GetClass() ) ) then
  620.             RunConsoleCommand("+reload")
  621.             timer.Simple( 1, function()
  622.                 RunConsoleCommand("-reload")
  623.             end )
  624.             HH.LastReload = CurTime()
  625.         end
  626.     end
  627. end
  628.  
  629. /*BHop*/
  630. HH.BH.LastHop = 0
  631. function HH.DoBhop( cmd )
  632.     if( HH.BHop ) then
  633.         if( HH.Me():OnGround() and HH.AliveCheck( HH.Me() ) ) then
  634.             cmd:SetButtons( cmd:GetButtons() | IN_JUMP )
  635.            
  636.             if( CurTime() > HH.BH.LastHop + 0.3 ) then
  637.                 HH.BH.LastHop = CurTime()
  638.                 HH.BH.Hops = HH.BH.Hops + 1
  639.             end
  640.         end
  641.     end
  642. end
  643.    
  644. /*No Recoil*/
  645. function HH.DoNoRecoil()
  646.     if HH.NoRecoil:GetBool() and HH.Me():GetActiveWeapon():IsValid() and HH.Me():GetActiveWeapon().Primary then
  647.         HH.Me():GetActiveWeapon().Primary.Recoil = 0
  648.     end
  649. end
  650.    
  651. /*Client Noclip*/
  652. function HH.DoClientNoclip( cmd )
  653.     if( HH.ClientNoclip:GetBool() ) then
  654.         cmd:SetForwardMove( 0 )
  655.         cmd:SetUpMove( 0 )
  656.         cmd:SetSideMove( 0 )
  657.     end
  658. end
  659.  
  660. /*Aimbot Hud*/
  661. function HH.PaintAimbot()
  662.     if( !HH.IsLocked and HH.AimbotIsOn ) then
  663.         draw.SimpleText( "Looking for Player...", "HHScoreboardText", ScrW()/2, ScrH()/2 + 100, Color(255, 0, 0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  664.     elseif( HH.IsLocked and HH.AimbotIsOn ) then
  665.         draw.SimpleText( "Locked On: " .. HH.LockedPlayer:Nick() .. " (" .. HH.LockedPlayer:Health() .. " HP)", "HHScoreboardText", ScrW()/2, ScrH()/2 + 100, Color(0, 255, 0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
  666.     end
  667. end
  668.  
  669. /*ESP*/
  670. function HH.ESP()
  671.     for k, v in ipairs( player.GetAll() ) do
  672.         if( HH.AliveCheck( v ) && v != HH.Me() && HH.IsCloseEnough( v ) ) then
  673.             local pos = v:EyePos():ToScreen()
  674.             local astatus = ""
  675.             local weaponp = ""
  676.             local rank = ""
  677.             local wep = ""
  678.             if( v:IsAdmin() ) then rank = " [A]" end
  679.             if( v:IsSuperAdmin() ) then rank = " [SA]" end
  680.             local name = v:Nick() .. rank
  681.            
  682.             if( ValidEntity( v:GetActiveWeapon() ) ) then
  683.                 wep = v:GetActiveWeapon():GetPrintName().." | "
  684.                 wep = string.gsub( wep, "#HL2_", "" )
  685.                 wep = string.gsub( wep, "#GMOD_", "" )
  686.             end
  687.            
  688.             local color = team.GetColor(v:Team())
  689.             local dist = math.floor( v:GetPos():Distance( HH.Me():GetPos() ) )
  690.             if( HH.ShowPlayers:GetBool() and HH.IsCloseEnough( v ) ) then
  691.                 draw.SimpleTextOutlined( wep .. " Dist: " .. dist , "DefaultSmall", pos.x, pos.y, color, TEXT_ALIGN_CENTER, TEXT_ALIGN_LEFT, .6, Color( 30, 30, 30, 165 ) )
  692.                 draw.SimpleTextOutlined( name .. " | HP: " .. v:Health() .. " A: " .. v:Armor(), "DefaultSmall", pos.x, pos.y - 12, color, TEXT_ALIGN_CENTER, TEXT_ALIGN_LEFT, .6, Color( 30, 30, 30, 165 ) )
  693.                 if( HH.ShowTraitors:GetBool() and HH.IsTraitor( v ) ) then
  694.                     draw.SimpleTextOutlined( "TRAITOR!", "DefaultSmall", pos.x, pos.y - 24, Color( 255, 0, 0 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_LEFT, .6, Color( 255, 120, 30, 165 ) )
  695.                 end
  696.             end
  697.         end
  698.     end
  699.    
  700.     for _, v in ipairs( ents.GetAll() ) do
  701.         if( v:IsValid() and ValidEntity( v ) and HH.IsCustomEnt( v:GetClass() ) ) then
  702.             if( HH.IsCloseEnough( v ) and HH.ShowEnts:GetBool() ) then
  703.                 local entpos = ( v:GetPos() + Vector( 0, 0, 50 ) ):ToScreen()
  704.                 draw.SimpleTextOutlined( v:GetClass(), "DefaultSmall", entpos.x, entpos.y - 8, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_LEFT, .6, Color( 30, 30, 30, 165 ) )
  705.             end
  706.         end                    
  707.     end
  708. end
  709.  
  710. /*Admins and Spectators*/
  711. HH.Admins = {}
  712. HH.Specs = {}
  713. function HH.Info()
  714.     if !HH.ShowAdmins:GetBool() then return end
  715.     HH.AdminsTemp = HH.Admins
  716.     HH.Admins = {}
  717.    
  718.     local int = 0
  719.     for k, v in ipairs( player.GetAll() ) do
  720.         if( v:IsAdmin() or HH.IsHG and v:GetLevel() < 99 ) then
  721.             table.insert( HH.Admins, v )
  722.         end
  723.     end
  724.    
  725.     if( #HH.Admins > #HH.AdminsTemp ) then
  726.         local pl = {}
  727.         for k, v in ipairs( HH.Admins ) do
  728.             if( !table.HasValue( HH.AdminsTemp, v ) ) then
  729.                 table.insert( pl, v )
  730.             end
  731.         end
  732.        
  733.         for k, v in pairs( pl ) do
  734.             if( v and v:IsValid() and v != HH.Me() ) then
  735.                 timer.Simple( 0.5, function()
  736.                     HH.Notify( "Admin " .. v:Nick() .. " Joined!", true )
  737.                 end )
  738.             end
  739.         end
  740.     end
  741.    
  742.     local txtsize = #HH.Admins * 16
  743.     local posx = ScrW() - 200
  744.     local posy = ScrH() - ScrH() + 15
  745.    
  746.     if ( #HH.Admins != 0 ) then
  747.         draw.RoundedBoxEx( 2, posx, posy, 180, 20, Color( 0, 150, 255, 250 ), true, true, false, false )
  748.         draw.RoundedBoxEx( 2, posx, posy + 20, 180, (txtsize + 1) + 4, Color( 0, 0, 0, 170 ), false, false, true, true )
  749.         surface.SetDrawColor( 255, 255, 255, 255 )
  750.         surface.DrawLine( posx, posy + 20, posx + 180, posy + 20)
  751.         draw.SimpleText( "Admins", "HHScoreboardText", posx + 90, posy + 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  752.         for k, v in pairs( HH.Admins ) do
  753.             if( v:IsAdmin() and !v:IsSuperAdmin() ) then
  754.                 draw.SimpleText(v:Nick() .. " (A)", "Default", posx + 10, posy + 25 + int, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
  755.             elseif( v:IsSuperAdmin() ) then
  756.                 draw.SimpleText(v:Nick() .. " (SA)", "Default", posx + 10, posy + 25 + int, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
  757.             elseif( HH.IsHG and v:GetLevel() < 99 ) then
  758.                 draw.SimpleText(v:Nick() .. " (MOD)", "Default", posx + 10, posy + 25 + int, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
  759.             end
  760.             int = int + 15
  761.         end
  762.     end
  763.    
  764.     HH.TempSpecs =  HH.Specs
  765.     HH.Specs = {}
  766.     for k, v in ipairs( player.GetAll() ) do
  767.         if( v:GetObserverTarget() == HH.Me() ) then
  768.             table.insert( HH.Specs, v )
  769.         end        
  770.     end
  771.    
  772.     if( #HH.Specs > #HH.TempSpecs ) then
  773.         local spl = {}
  774.         for k, v in ipairs( HH.Specs ) do
  775.             if( !table.HasValue( HH.TempSpecs, v ) ) then
  776.                 table.insert( spl, v )
  777.             end
  778.         end
  779.        
  780.         for k, v in pairs( spl ) do
  781.             if( v and v:IsValid() ) then
  782.                 HH.Notify( v:Nick() .. " Started Spectating you!", true )
  783.             end
  784.         end
  785.     end
  786.    
  787.     if( #HH.Specs < #HH.TempSpecs ) then
  788.         local saf = {}
  789.         for k, v in ipairs( HH.TempSpecs ) do
  790.             if( !table.HasValue( HH.Specs, v ) ) then
  791.                 table.insert( saf, v )
  792.             end
  793.         end
  794.        
  795.         for k, v in pairs( saf ) do
  796.             if( v and v:IsValid() ) then
  797.                 HH.Notify( v:Nick() .. " Stopped Spectating you!", false )
  798.             end
  799.         end
  800.     end
  801.    
  802.     local add = 0
  803.     if( #HH.Specs != 0 ) then
  804.         surface.SetFont( "Default" )
  805.         local size = #HH.Specs * 16
  806.         local poy = posy + txtsize + 35
  807.         draw.RoundedBoxEx( 2, posx, poy, 180, 20, Color( 0, 150, 255, 250 ), true, true, false, false )
  808.         draw.RoundedBoxEx( 2, posx, poy + 20, 180, (size + 1) + 4, Color( 0, 0, 0, 170 ), false, false, true, true )
  809.         surface.SetDrawColor( 255, 255, 255, 255 )
  810.         surface.DrawLine( posx, poy + 20, posx + 180, poy + 20)
  811.         draw.SimpleText( "Spectators", "HHScoreboardText", posx + 90, poy + 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  812.         for k, v in pairs( HH.Specs ) do
  813.             draw.SimpleText(v:Nick(), "Default", posx + 10, poy + 25 + add, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
  814.             add = add + 15
  815.         end
  816.     end
  817.    
  818.     /*Bhop Info*/
  819.     if( HH.BHop ) then
  820.         local posx = ScrW() - 200
  821.         local posy = ScrH() - ScrH()/2
  822.         local curspeed = math.Round( HH.Me():GetVelocity():Length() )
  823.         if( curspeed > HH.BH.MaxSpeed and HH.AliveCheck( HH.Me() ) ) then HH.BH.MaxSpeed = curspeed end
  824.         draw.RoundedBoxEx( 2, posx, posy, 150, 20, Color( 0, 150, 255, 250 ), true, true, false, false )
  825.         draw.RoundedBoxEx( 2, posx, posy + 20, 150, 70, Color( 0, 0, 0, 170 ), false, false, true, true )
  826.         surface.SetDrawColor( 255, 255, 255, 255 )
  827.         surface.DrawLine( posx, posy + 20, posx + 150, posy + 20)
  828.         draw.SimpleText( "Bunny Hop", "HHScoreboardText", posx + 75, posy + 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  829.         draw.SimpleText( "Speed: " .. curspeed, "HHScoreboardText", posx + 75, posy + 27, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  830.         draw.SimpleText( "Max Speed: " .. HH.BH.MaxSpeed, "HHScoreboardText", posx + 75, posy + 47, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  831.         draw.SimpleText( "Hops: " .. math.Round( HH.BH.Hops ), "HHScoreboardText", posx + 75, posy + 67, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  832.     end
  833. end
  834.  
  835. /*Crosshair*/
  836. function HH.CrossHair()
  837.     if !HH.DrawCrosshair:GetBool() then return end
  838.     local x = ScrW() / 2
  839.     local y = ScrH() / 2
  840.     surface.SetDrawColor( 255, 0, 0, 255 )
  841.     local length = 15
  842.     if( !HH.Me():InVehicle() and HH.AliveCheck( HH.Me() ) ) then
  843.         surface.DrawLine( x - length, y, x , y )
  844.         surface.DrawLine( x + length, y, x, y )
  845.         surface.DrawLine( x, y - length, x, y )
  846.         surface.DrawLine( x, y + length, x, y )
  847.     end
  848. end
  849.  
  850. /*Laser Eyes*/
  851. local mat = Material("tripmine_laser")
  852. function HH.LaserEyes()
  853.     if( !HH.ShowLaserEyes:GetBool() ) then return end
  854.     for k, v in pairs( player.GetAll() ) do
  855.         if v:IsValid() then
  856.             if HH.AliveCheck( v ) then
  857.                 cam.Start3D( EyePos(), EyeAngles() )
  858.                     render.SetMaterial( mat )
  859.                     if( v != HH.Me() and !vgui.CursorVisible() ) then
  860.                         local pos = v:EyePos()
  861.                         local dist = pos:Distance( HH.Me():EyePos() )
  862.                         if( HH.IsCloseEnough( v ) ) then
  863.                             render.DrawBeam( pos, v:GetEyeTrace().HitPos, 30, 1, 1, Color( 255, 0, 0, 255 ) )
  864.                         end
  865.                     end
  866.                 cam.End3D()
  867.             end
  868.         end
  869.     end
  870. end
  871.  
  872. /*Wallhack*/
  873. local function OnScreen( e )
  874.     local a, f = self():GetAimVector():Angle() - (e:GetPos() - self():GetShootPos()):Angle(), self():GetFOV()
  875.     return ( math.NormalizeAngle(a.y) < f + 2 && math.NormalizeAngle(a.p) < f + 2 )
  876. end
  877.  
  878. function HH.Wallhack()
  879.     if HH.WallHackEnabled:GetBool() then
  880.         cam.Start3D( EyePos(), EyeAngles() )
  881.             if( HH.Chams:GetBool() ) then
  882.                 for k, v in pairs ( player.GetAll() ) do
  883.                     if( HH.AliveCheck( v ) and v != HH.Me() and HH.IsCloseEnough( v ) ) then
  884.                         local mat = HH.CreateMaterial()
  885.                         local col = team.GetColor( v:Team() )
  886.                         if( HH.ShowTraitors:GetBool() and table.HasValue( HH.Traitors , v ) ) then
  887.                             col = Color( 255, 120, 0 )
  888.                         end
  889.                         render.SuppressEngineLighting( true )
  890.                         render.SetColorModulation( ( col.r * ( 1 / 255 ) ), ( col.g * ( 1 / 255 ) ), ( col.b * ( 1 / 255 ) ) )
  891.                         SetMaterialOverride( mat )
  892.                         v:DrawModel()
  893.                         render.SuppressEngineLighting( false )
  894.                         render.SetColorModulation( 1, 1, 1 )
  895.                         SetMaterialOverride( )
  896.                         v:DrawModel()
  897.                        
  898.                         if( v:GetActiveWeapon() and v:GetActiveWeapon():IsValid() ) then
  899.                             local wep = v:GetActiveWeapon()
  900.                             local wcol = Color( 255, 0, 0 )
  901.                             render.SuppressEngineLighting( true )
  902.                             render.SetColorModulation( ( wcol.r * ( 1 / 255 ) ), ( wcol.g * ( 1 / 255 ) ), ( wcol.b * ( 1 / 255 ) ) )
  903.                             SetMaterialOverride( mat )
  904.                             wep:DrawModel()
  905.                             render.SuppressEngineLighting( false )
  906.                             render.SetColorModulation( 1, 1, 1 )
  907.                             SetMaterialOverride()
  908.                             wep:DrawModel()
  909.                         end
  910.                     end
  911.                 end
  912.             end
  913.         cam.End3D()
  914.     end
  915. end
  916. hook.Add("RenderScreenspaceEffects", "HH_WallHack", HH.Wallhack )
  917.  
  918. function HH.WallhackHelper()
  919.     if HH.WallHackEnabled:GetBool() then
  920.         cam.Start3D( EyePos(), EyeAngles() )
  921.             for k, v in pairs ( player.GetAll() ) do
  922.                 if( HH.AliveCheck( v ) and v != HH.Me() and HH.IsCloseEnough( v ) ) then
  923.                     if !HH.Chams:GetBool() then
  924.                         v:DrawModel()                  
  925.                         if( v:GetActiveWeapon() and v:GetActiveWeapon():IsValid() ) then
  926.                             local wep = v:GetActiveWeapon()
  927.                             wep:DrawModel()
  928.                         end
  929.                     end
  930.                 end
  931.             end
  932.         cam.End3D()
  933.     end
  934. end
  935.  
  936. local speed = HH.CNSpeed:GetInt() * ( FrameTime() / 2 ) * 100
  937. /*Client Noclip / Thirdperson*/
  938. function HH.CustomView( ply, pos, angles, fov )
  939.     if( HH.ClientNoclip:GetBool() ) then
  940.         local ang = angles:Forward()
  941.         if HH.Me():KeyDown( IN_FORWARD ) and HH.ClientNoclip:GetBool() then
  942.         HH.CNPos = HH.CNPos + HH.Me():GetAimVector() * speed
  943.         end
  944.         if HH.Me():KeyDown( IN_BACK ) and HH.ClientNoclip:GetBool() then
  945.             HH.CNPos = HH.CNPos - HH.Me():GetAimVector() * speed
  946.         end
  947.         if HH.Me():KeyDown( IN_MOVERIGHT ) and HH.ClientNoclip:GetBool() then
  948.             HH.CNPos = HH.CNPos + ang:Angle():Right() * speed
  949.         end
  950.         if HH.Me():KeyDown( IN_MOVELEFT ) and HH.ClientNoclip:GetBool() then
  951.             HH.CNPos = HH.CNPos - ang:Angle():Right() * speed
  952.         end
  953.         if HH.Me():KeyDown( IN_JUMP ) and HH.ClientNoclip:GetBool() then
  954.             HH.CNPos = HH.CNPos + Vector( 0, 0, speed )
  955.         end
  956.         if HH.Me():KeyDown( IN_SPEED ) and HH.ClientNoclip:GetBool() then
  957.             speed = ( HH.CNSpeed:GetInt() * 3 * ( FrameTime() / 2 ) ) * 100
  958.         elseif HH.Me():KeyDown( IN_DUCK ) and HH.ClientNoclip:GetBool() then
  959.             speed = ( HH.CNSpeed:GetInt() / 3 * ( FrameTime() / 2 ) ) * 100
  960.         else
  961.             speed = ( HH.CNSpeed:GetInt() * ( FrameTime() / 2 ) ) * 100
  962.         end
  963.        
  964.         local view = {}
  965.         view.origin = HH.CNPos
  966.         view.angles = angles
  967.         view.fov = fov
  968.         return view
  969.     elseif( HH.ThirdPerson:GetBool() ) then
  970.         HH.CNPos = HH.Me():EyePos()
  971.         local view = {}
  972.         view.origin = pos - ( angles:Forward() * ( 30 + HH.ThirdDist:GetInt() ) )
  973.         return view
  974.     else
  975.         HH.CNPos = HH.Me():EyePos()
  976.         return GAMEMODE:CalcView( ply, pos, angles, fov )
  977.     end
  978. end
  979. hook.Add( "CalcView", "hh_CustomViews", HH.CustomView )
  980.  
  981. /*Show Yourself*/
  982. function HH.ShowYourSelf()
  983.     if ( HH.ThirdPerson:GetBool() and !HH.ClientNoclip:GetBool() ) then
  984.         return true
  985.     end
  986. end
  987. hook.Add( "ShouldDrawLocalPlayer", "hh_ShowYourSelf", HH.ShowYourSelf )
  988.  
  989. /*Anti Afk*/
  990. local commands = { "forward" , "back" , "jump" , "moveleft" , "moveright", "right", "left", "duck" }
  991. function HH.AntiAfk()
  992.     if( HH.AntiAfkEnabled:GetBool() and #HH.Specs == 0 ) then
  993.         local command1 = table.Random( commands )
  994.         local command2 = table.Random( commands )
  995.         timer.Simple(1 , function()
  996.             RunConsoleCommand( "+"..command1 )
  997.             RunConsoleCommand( "+"..command2 )
  998.         end )
  999.         timer.Simple(2 , function()
  1000.             RunConsoleCommand("-"..command1 )
  1001.             RunConsoleCommand("-"..command2 )
  1002.         end )
  1003.     end
  1004. end
  1005. timer.Create( "hh_antiafk", 10 , 0 , function() HH.AntiAfk() end )
  1006.  
  1007. hook.Add( "CreateMove", "HH_CreateMove", function( uc )
  1008.     HH.AimBot( uc )
  1009.     HH.DoBhop( uc )
  1010.     HH.DoNoRecoil()
  1011.     HH.DoClientNoclip( uc )
  1012. end )
  1013.  
  1014. hook.Add( "Think", "HH_ThinkHook", function()
  1015.     HH.TriggerBot()
  1016.     //HH.AimBot()
  1017.     HH.SpeedHack()
  1018.     HH.DoAutoReload()
  1019.     HH.CheckTraitors()
  1020. end )
  1021.  
  1022. hook.Add( "PostDrawHUD", "HH_ESPHUD", function()
  1023.     if( !HH.ESPEnabled:GetBool() ) then return end
  1024.     HH.ESP()
  1025.     HH.Info()
  1026.     HH.CrossHair()
  1027.     HH.PaintAimbot()
  1028. end )
  1029.  
  1030. hook.Add( "HUDPaint", "HH_ESP", function()
  1031.     if( !HH.ESPEnabled:GetBool() ) then return end
  1032.     HH.LaserEyes()
  1033.     HH.WallhackHelper()
  1034. end )
  1035.  
  1036.  
  1037. /*---------Console Commands---------*/
  1038.  
  1039.  
  1040. /*Aimbot*/
  1041. concommand.Add( "+hh_aim", function()
  1042.     if !HH.Loaded then return end
  1043.     HH.AimbotIsOn =  true
  1044. end )
  1045.  
  1046. concommand.Add( "-hh_aim", function()
  1047.     if !HH.Loaded then return end
  1048.     HH.AimbotIsOn =  false
  1049.     HH.IsLocked = false
  1050.     RunConsoleCommand("-attack")
  1051. end )
  1052.  
  1053. /*Bhop*/
  1054. concommand.Add( "+hh_bhop", function()
  1055.     if !HH.Loaded then return end
  1056.     HH.BHop = true
  1057. end )
  1058.  
  1059. concommand.Add( "-hh_bhop", function()
  1060.     if !HH.Loaded then return end
  1061.     HH.BHop = false
  1062. end )
  1063.  
  1064. concommand.Add( "hh_resetbhop", function()
  1065.     if !HH.Loaded then return end
  1066.     HH.BH.MaxSpeed = 0
  1067.     HH.BH.Hops = 0
  1068.     HH.Notify( "BHop Info Reset!", false )
  1069. end )
  1070.  
  1071. concommand.Add( "+hh_speed", function()
  1072.     if !HH.Loaded then return end
  1073.     if !HH.ModLoaded then HH.Notify( "Module not loaded, can't speedhack!", false ) end
  1074.     HH.Speed = true
  1075. end )
  1076.  
  1077. concommand.Add( "-hh_speed", function()
  1078.     if !HH.Loaded then return end
  1079.     HH.Speed = false
  1080. end )
  1081.  
  1082. /*---------Utilities---------*/
  1083.  
  1084. function HH.CommaValue(amount)
  1085.     local formatted = amount
  1086.     while true do  
  1087.         formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
  1088.         if (k==0) then
  1089.             break
  1090.         end
  1091.     end
  1092.     return formatted
  1093. end
  1094.  
  1095. function HH.RoundNum(val, decimal)
  1096.     if (decimal) then
  1097.         return math.floor( (val * 10^decimal) + 0.5) / (10^decimal)
  1098.     else
  1099.         return math.floor(val+0.5)
  1100.     end
  1101. end
  1102.  
  1103. function HH.FormatNum(amount, decimal, prefix, neg_prefix)
  1104.     local str_amount,  formatted, famount, remain
  1105.  
  1106.     decimal = decimal or 2
  1107.     neg_prefix = neg_prefix or "-"
  1108.  
  1109.     famount = math.abs(HH.RoundNum(amount,decimal))
  1110.     famount = math.floor(famount)
  1111.  
  1112.     remain = HH.RoundNum(math.abs(amount) - famount, decimal)
  1113.  
  1114.     formatted = HH.CommaValue(famount)
  1115.  
  1116.     if (decimal > 0) then
  1117.         remain = string.sub(tostring(remain),3)
  1118.         formatted = formatted .. "." .. remain .. string.rep("0", decimal - string.len(remain))
  1119.     end
  1120.  
  1121.     formatted = (prefix or "") .. formatted
  1122.  
  1123.     if (amount<0) then
  1124.         if (neg_prefix=="()") then
  1125.             formatted = "("..formatted ..")"
  1126.         else
  1127.             formatted = neg_prefix .. formatted
  1128.         end
  1129.     end
  1130.  
  1131.     return formatted
  1132. end
  1133.  
  1134. timer.Simple(3, function()
  1135.     HH.CanDoSteamStuff = HH.IsSteamOk()
  1136.     HH.Notify( "Succesfully Loaded!", true)
  1137.     HH.Loaded = true
  1138. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement