Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Hemi Hacks by: Hemirox*/
- if( SERVER ) then return end
- /*---------Variables---------*/
- require ( "gamemode" )
- include("includes/enum/teams.lua")
- require ( "team" )
- require ( "vehicles" )
- require ( "usermessage" )
- require ( "list" )
- require ( "datastream" )
- require ( "markup" )
- require ( "undo" )
- require ( "cleanup" )
- require ( "duplicator" )
- require ( "constraint" )
- require ( "weapons" )
- require ( "timer" )
- require ( "schedule" )
- require ( "scripted_ents" )
- require ( "player_manager" )
- require ( "construct" )
- require ( "effects" )
- require ( "killicon" )
- require ( "spawnmenu" )
- require ( "controlpanel" )
- require ( "presets" )
- require ( "cookie" )
- require ( "glon" )
- local hook = require ( "hook" )
- local draw = require ( "draw" )
- local cvars = require ( "cvars" )
- local concommand = require ( "concommand" )
- HH = {}
- HH.BH = {}
- /*Static Variables*/
- HH.AimbotIsOn = false
- HH.IsLocked = false
- HH.LockedPlayer = nil
- HH.BHop = false
- HH.Me = LocalPlayer
- HH.LastReload = 0
- HH.Friends = ( file.Exists("hh_friends.txt") and glon.decode(file.Read("hh_friends.txt")) or {} )
- HH.Teams = ( file.Exists("hh_teams.txt") and glon.decode(file.Read("hh_teams.txt")) or {} )
- HH.CustomEnts = ( file.Exists("hh_ents.txt") and glon.decode(file.Read("hh_ents.txt")) or {} )
- HH.TargetBone = ( file.Exists("hh_bone.txt") and file.Read("hh_bone.txt") or "ValveBiped.Bip01_Head1" )
- HH.CNPos = HH.Me():EyePos()
- HH.BH.Hops = 0
- HH.BH.MaxSpeed = 0
- HH.SpeedOn = false
- HH.PerpEnabled = false
- HH.MenuCreated = false
- HH.CanDoSteamStuff = false
- HH.Loaded = false
- /*Client Changeable Vars*/
- HH.AutoShoot = CreateClientConVar( "hh_autoshoot", "1", true, false )
- HH.MaxAimAngle = CreateClientConVar( "hh_maxangle", "90", true, false )
- HH.CheckLos = CreateClientConVar( "hh_checklos", "1", true, false )
- HH.IgnoreSteamFriends = CreateClientConVar( "hh_ignoresteamfriends", "1", true, false )
- HH.ESPEnabled = CreateClientConVar( "hh_espenabled", "1", true, false )
- HH.ShowPlayers = CreateClientConVar( "hh_showplayers", "1", false, false )
- HH.ShowEnts = CreateClientConVar( "hh_showents", "1", false, false )
- HH.ESPDist = CreateClientConVar( "hh_espdist", "2500", true, false )
- HH.CustomBone = CreateClientConVar( "hh_custombone", "0", true, false )
- HH.DrawCrosshair = CreateClientConVar( "hh_crosshair", "1", true, false )
- HH.ShowAdmins = CreateClientConVar( "hh_showadmins", "1", true, false )
- HH.AutoReload = CreateClientConVar( "hh_autoreload", "1", true, false )
- HH.ShowLaserEyes = CreateClientConVar( "hh_lasereyes", "1", true, false )
- HH.FriendsBlackList = CreateClientConVar( "hh_friendsblacklist", "0", true, false )
- HH.TeamsBlackList = CreateClientConVar( "hh_teamsblacklist", "1", true, false )
- HH.IgnoreFriends = CreateClientConVar( "hh_ignorefriends", "0", true, false )
- HH.IgnoreTeams = CreateClientConVar( "hh_ignoreteams", "0", true, false )
- HH.IgnoreOwnTeam = CreateClientConVar( "hh_ignoreownteam", "0", true, false )
- HH.NoRecoil = CreateClientConVar( "hh_norecoil", "1", true, false )
- HH.WallHackEnabled = CreateClientConVar( "hh_wallhack", "0", true, false )
- HH.WallHackSolid = CreateClientConVar( "hh_solidwallhack", "1", true, false )
- HH.Chams = CreateClientConVar( "hh_chams", "1", true, false )
- HH.IgnoreAdmins = CreateClientConVar( "hh_ignoreadmins", "0", true, false )
- HH.ClientNoclip = CreateClientConVar( "hh_clientnoclip", "0", true, false )
- HH.CNSpeed = CreateClientConVar( "hh_clientnoclipspeed", "10", true, false )
- HH.ThirdPerson = CreateClientConVar( "hh_thirdperson", "0", true, false )
- HH.ThirdDist = CreateClientConVar( "hh_thirdpersondist", "10", true, false )
- HH.SpeedHackSpeed = CreateClientConVar( "hh_speedhackspeed", "5.0", true, false )
- HH.AntiAfkEnabled = CreateClientConVar( "hh_antiafkkicker", "0", false, false )
- HH.NoSpreadEnabled = CreateClientConVar( "hh_nospread", "1", false, false )
- HH.LogIps = CreateClientConVar( "hh_logips", "1", true, false )
- HH.NameChanger = CreateClientConVar( "hh_namechanger", "0", false, false )
- HH.ShowTraitors = CreateClientConVar( "hh_showtraitors", "1", false, false )
- HH.OnlyTargetTraitors = CreateClientConVar( "hh_targettraitors", "0", false, false )
- RunConsoleCommand( "hh_namechanger", "0" )
- HH.HostTimeScale = GetConVar( "host_timescale" )
- /*Valid Bones*/
- HH.ValidBones = {
- "ValveBiped.Bip01_Head1",
- "ValveBiped.Bip01_Spine",
- "ValveBiped.Bip01_Spine2",
- "ValveBiped.Bip01_Pelvis",
- "ValveBiped.Bip01_L_Hand",
- "ValveBiped.Bip01_R_Hand",
- "ValveBiped.Bip01_L_Thigh",
- "ValveBiped.Bip01_R_Thigh",
- "ValveBiped.Bip01_L_Calf",
- "ValveBiped.Bip01_R_Calf",
- "ValveBiped.Bip01_L_Foot",
- "ValveBiped.Bip01_R_Foot",
- }
- HH.InvalidEnts = {
- "player",
- "prop_physics",
- "viewmodel",
- }
- surface.CreateFont ( "ScoreboardText", 15, 700, true, false, "HHScoreboardText" )
- timer.Simple(1, function()
- HH.Notify( "Loading Modules..." )
- HH.ModLoaded = require( "hh" )
- if( HH.ModLoaded ) then
- HH_ForceCvar( GetConVar("sv_cheats"), "1" )
- end
- end )
- timer.Simple(2, function()
- HH.CanNospread = require( "hhns" )
- if( HH.CanNospread ) then
- HH.hl2_ucmd_getprediciton = hl2_ucmd_getprediciton
- HH.hl2_shotmanip = hl2_shotmanip
- end
- end )
- /*---------Functions---------*/
- /*Get Target*/
- function HH.GetNextTarget()
- if( HH.IsLocked and HH.IsValidPlayer( HH.LockedPlayer ) ) then return end
- local trace = HH.Me():GetEyeTrace()
- local aimpos = ( trace.HitPos - HH.Me():GetShootPos() ):Angle()
- local pls = {}
- for k, v in pairs( player.GetAll() ) do
- if( HH.IsValidPlayer( v ) ) then
- local td = {}
- local targethead = v:LookupBone( HH.GetBone() )
- td.start = HH.Me():EyePos()
- td.endpos = v:GetBonePosition( targethead )
- local angle = HH.Me():GetAimVector()
- local difference = ( td.endpos - td.start ):Normalize()
- difference = difference - angle
- difference = difference:Length()
- difference = math.abs( difference * 90 )
- if( HH.InFov( v ) ) then
- table.insert( pls, v )
- end
- end
- end
- if( #pls > 1 ) then
- HH.LockedPlayer = HH.GetClosest( pls )
- HH.IsLocked = true
- elseif( #pls == 1 ) then
- HH.LockedPlayer = pls[1]
- HH.IsLocked = true
- else
- HH.IsLocked = false
- end
- end
- /*Fov Check*/
- function HH.InFov( ent )
- local fov = HH.MaxAimAngle:GetInt() --Convar
- if( fov != 180 ) then
- local lpang = HH.Me():GetAngles()
- local ang = ( ent:GetBonePosition( ent:LookupBone( HH.GetBone() ) ) - HH.Me():EyePos() ):Angle()
- local ady = math.abs( math.NormalizeAngle( lpang.y - ang.y ) )
- local adp = math.abs( math.NormalizeAngle( lpang.p - ang.p ) )
- if( ady > fov || adp > fov ) then return false end
- end
- return true
- end
- /*Los Check*/
- function HH.HasLos( ply )
- local td = {}
- td.start = HH.Me():GetShootPos()
- td.endpos = ply:GetBonePosition( ply:LookupBone( HH.GetBone() ) )
- td.mask = 1174421507
- td.filter = { HH.Me(), ply }
- local trace = util.TraceLine( td )
- if( trace.Fraction == 1 ) then
- return true
- end
- return false
- end
- /*Get Closest Target*/
- function HH.GetClosest( pls )
- local pos = HH.Me():EyePos()
- local ang = HH.Me():GetAimVector()
- local returnply = { 0, 0 }
- for k, v in ipairs( pls ) do
- if( HH.IsValidPlayer( v ) ) then
- local plypos = v:GetBonePosition( v:LookupBone( HH.GetBone() ) )
- local difr = ( plypos - pos ):Normalize()
- difr = difr - ang
- difr = difr:Length()
- difr = math.abs( difr )
- if( difr < returnply[2] || returnply[1] == 0 ) then
- returnply = { v, difr }
- end
- end
- end
- return returnply[1]
- end
- /*Check Valid Players*/
- function HH.IsValidPlayer( ply )
- if( !ply or !ply:IsValid() ) then return false end --Check if player is valid
- if( ply == HH.Me() ) then return false end --Don't target self
- if( HH.CheckLos:GetBool() and !HH.HasLos( ply ) ) then return false end --Check for Line of Sight
- if( ply:GetFriendStatus() == "friend" and HH.IgnoreSteamFriends:GetBool() ) then return false end --Ignore Steam friends
- if( !HH.AliveCheck( ply ) or ply:InVehicle() or HH.Me():InVehicle() or !HH.AliveCheck( HH.Me() ) ) then return false end
- if( HH.IgnoreOwnTeam:GetBool() and ply:Team() == HH.Me():Team() ) then return false end
- if( ply:GetMoveType() == MOVETYPE_NONE ) then return false end
- if( ply:IsPlayer() and ply:GetMoveType() == MOVETYPE_OBSERVER ) then return false end
- if( HH.IgnoreAdmins:GetBool() and ply:IsAdmin() ) then return false end
- if( HH.OnlyTargetTraitors:GetBool() and !HH.IsTraitor( ply ) ) then return false end
- if( HH.FriendsBlackList:GetBool() ) then
- if( !table.HasValue( HH.Friends, ply:SteamID() ) and !HH.IgnoreFriends:GetBool() ) then
- return false
- end
- else
- if( table.HasValue( HH.Friends, ply:SteamID() ) and !HH.IgnoreFriends:GetBool() ) then
- return false
- end
- end
- if( HH.TeamsBlackList:GetBool() ) then
- if( !HH.IsGoodTeam( team.GetName( ply:Team() ) ) and !HH.IgnoreTeams:GetBool() ) then
- return false
- end
- else
- if( HH.IsGoodTeam( team.GetName( ply:Team() ) ) and !HH.IgnoreTeams:GetBool() ) then
- return false
- end
- end
- return true
- end
- /*Add Friend*/
- function HH.AddFriend( ply )
- if( ply:IsPlayer() and ply:IsValid() and ply != HH.Me() and !table.HasValue (HH.Friends, ply:SteamID() ) ) then
- table.insert( HH.Friends, ply:SteamID() )
- file.Write( "hh_friends.txt", glon.encode( HH.Friends ) )
- end
- end
- /*Remove Friend*/
- function HH.RemoveFriend( ply )
- if( ply:IsPlayer() and ply:IsValid() and ply != HH.Me() ) then
- for k, v in pairs( HH.Friends ) do
- if( string.Trim( v ) == ply:SteamID() ) then
- HH.Friends[k] = nil
- end
- end
- file.Write( "hh_friends.txt", glon.encode( HH.Friends ) )
- end
- end
- /*Clear Friends*/
- function HH.ClearFriendsList()
- HH.Friends = {}
- file.Write( "hh_friends.txt", glon.encode( HH.Friends ) )
- end
- function HH.IsFriend( ply )
- return table.HasValue( HH.Friends, ply:SteamID() )
- end
- /*Add Ent*/
- function HH.AddEnt( entclass )
- if( !table.HasValue( HH.CustomEnts, entclass ) ) then
- table.insert( HH.CustomEnts, entclass )
- file.Write( "hh_ents.txt", glon.encode( HH.CustomEnts ) )
- end
- end
- /*Remove Ent*/
- function HH.RemoveEnt( entclass )
- for k, v in pairs( HH.CustomEnts ) do
- if( string.Trim( v ) == entclass ) then
- HH.CustomEnts[k] = nil
- end
- end
- file.Write( "hh_ents.txt", glon.encode( HH.CustomEnts ) )
- end
- /*Clear Ents*/
- function HH.ClearEnts()
- HH.CustomEnts = {}
- file.Write( "hh_ents.txt", glon.encode( HH.CustomEnts ) )
- end
- function HH.IsCustomEnt( entclass )
- return table.HasValue( HH.CustomEnts, entclass )
- end
- /*Add Team*/
- function HH.AddTeam( teamname )
- table.insert( HH.Teams, teamname )
- file.Write( "hh_teams.txt", glon.encode( HH.Teams ) )
- end
- /*Remove Team*/
- function HH.RemoveTeam( teamname )
- for k, v in pairs( HH.Teams ) do
- if( string.Trim( v ) == teamname ) then
- HH.Teams[k] = nil
- end
- end
- file.Write( "hh_teams.txt", glon.encode( HH.Teams ) )
- end
- function HH.IsGoodTeam( teamname )
- return table.HasValue( HH.Teams, teamname )
- end
- /*Clear Teams*/
- function HH.ClearTeams()
- HH.Teams = {}
- file.Write( "hh_teams.txt", glon.encode( HH.Teams ) )
- end
- /*Get Target Bone*/
- function HH.GetBone()
- if HH.CustomBone:GetBool() then
- return HH.TargetBone
- else
- return "ValveBiped.Bip01_Head1"
- end
- end
- /*Set Target Bone*/
- function HH.SetBone( bone )
- if table.HasValue( HH.ValidBones, bone ) then
- HH.TargetBone = bone
- file.Write( "hh_bone.txt", HH.TargetBone )
- end
- end
- /*Get Wallhack material*/
- function HH:CreateMaterial()
- local BaseInfo = {
- ["$basetexture"] = "models/debug/debugwhite",
- ["$model"] = 1,
- ["$translucent"] = 1,
- ["$alpha"] = 1,
- ["$nocull"] = 1,
- ["$ignorez"] = 1
- }
- local mat
- if( HH.WallHackSolid:GetBool() ) then
- mat = CreateMaterial( "pb_solid_mat", "VertexLitGeneric", BaseInfo )
- else
- mat = CreateMaterial( "pb_wireframemat", "Wireframe", BaseInfo )
- end
- return mat
- end
- /*Esp Distance Check*/
- function HH.IsCloseEnough( ent )
- local dist = ent:GetPos():Distance( HH.Me():GetPos() )
- if( dist <= HH.ESPDist:GetInt() and ent:GetPos() != Vector( 0, 0, 0 ) ) then
- return true
- end
- return false
- end
- /*Notify*/
- function HH.Notify( msg, sound )
- HH.Me():ChatPrint( "[HH] " .. msg )
- if( sound ) then
- local beep = Sound( "/buttons/button17.wav" )
- local mysound = CreateSound( HH.Me(), beep )
- mysound:Play()
- end
- end
- /*No Spread*/
- HH.CustomCones = {}
- HH.CustomCones["#HL2_SMG1"] = Vector( -0.04362, -0.04362, -0.04362 )
- HH.CustomCones["#HL2_Pistol"] = Vector( -0.0100, -0.0100, -0.0100 )
- HH.CustomCones["#HL2_Pulse_Rifle"] = Vector( -0.02618, -0.02618, -0.02618 )
- function HH.PredictSpread( cmd, aimAngle )
- local cmd2, seed = HH.hl2_ucmd_getprediciton( cmd )
- local currentseed = 0, 0, 0
- if( cmd2 != 0 ) then currentseed = seed end
- local wep = HH.Me():GetActiveWeapon()
- local vecCone, valCone = Vector( 0, 0, 0 )
- if( ValidEntity( wep ) ) then
- if( wep.Initialize ) then
- valCone = wep.Primary && wep.Primary.Cone || 0
- if( tonumber( valCone ) ) then
- vecCone = Vector( -valCone, -valCone, -valCone )
- elseif( type( valCone ) == "Vector" ) then
- vecCone = -1 * valCone
- end
- else
- local pn = wep:GetPrintName()
- if( HH.CustomCones[pn] ) then vecCone = HH.CustomCones[pn] end
- end
- end
- return HH.hl2_shotmanip( currentseed || 0, ( aimAngle || HH.Me():GetAimVector():Angle() ):Forward(), vecCone ):Angle()
- end
- /*Ip Logging*/
- HH.IPS = {}
- function HH.SaveIPs()
- local s = ""
- for k,v in pairs( HH.IPS ) do
- s = s..k.."="..v.."\n"
- end
- if HH.LogIps:GetBool() then
- file.Write( "hh_loggedips.txt", s )
- end
- end
- function HH.LoadIPs()
- if !file.Read( "hh_loggedips.txt" ) then
- file.Write( "hh_loggedips.txt", "" )
- end
- local tbl = string.Explode( "\n", file.Read( "hh_loggedips.txt" ) )
- HH.IPS = {}
- for k,v in pairs(tbl) do
- local sep = string.Explode( "=", v )
- if sep and table.getn( sep ) == 2 then
- HH.IPS[ sep[ 1 ] ] = sep[ 2 ]
- end
- end
- end
- HH.LoadIPs()
- /*Load Steamworks*/
- function HH.IsSteamOk()
- local loaded = require( "steamworks" )
- if( !loaded ) then return false end
- local steamClient007 = steamworks.ISteamClient( 7 )
- if ( !steamClient007 ) then return false end
- local hSteamPipe = steamClient007:CreateSteamPipe()
- if ( !hSteamPipe ) then return false end
- local hSteamUser = steamClient007:ConnectToGlobalUser( hSteamPipe )
- if ( !hSteamUser ) then return false end
- local steamUser012 = steamClient007:GetISteamUser( hSteamUser, hSteamPipe, 12 )
- if ( !steamUser012 ) then return false end
- if ( !steamUser012:LoggedOn() ) then return false end
- HH.SteamUser = steamClient007:GetISteamFriends( hSteamUser, hSteamPipe, 5 )
- if ( !HH.SteamUser ) then return false end
- return true
- end
- 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" }
- HH.Traitors = {}
- local allocatedweapons = {}
- local cleared = false
- function HH.PrintTraitors()
- MsgN( "----------------Traitors----------------------")
- for k , v in pairs( HH.Traitors ) do
- print( v:Nick() )
- end
- print( #HH.Traitors.." of total ".. math.floor( #player.GetAll() / 4 ).." traitors detected." )
- MsgN("-----------------------------------------------")
- end
- concommand.Add( "hh_printtraitors" , HH.PrintTraitors )
- function HH.IsTraitor(pl)
- return table.HasValue( HH.Traitors , pl )
- end
- local umsg = usermessage.IncomingMessage
- function usermessage.IncomingMessage( name , um , ... )
- if name == "ttt_role" and HH.ShowTraitors:GetBool() then
- print( "[HH] Clearing traitors - round end." )
- for k , v in pairs( HH.Traitors ) do
- if ValidEntity( v ) then
- Msg( string.format( "Removing traitor %s - the round has ended." , v:Nick() ), false )
- end
- HH.Traitors[k] = nil
- end
- end
- return umsg( name , um , ... )
- end
- function HH.CheckTraitors()
- if not GAMEMODE or not GAMEMODE.Name or not string.find( GAMEMODE.Name , "Trouble in Terror" ) or !HH.ShowTraitors then return end
- for _, pl in pairs( player.GetAll() ) do
- for k, wep in pairs( ents.GetAll() ) do
- if( ValidEntity( wep ) and wep:IsWeapon() and table.HasValue( HH.TGuns , wep:GetClass() ) ) then
- 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
- HH.Notify( string.format( "Player %s has traitor weapon %s" , pl:Nick() , wep:GetClass() ), true )
- table.insert( HH.Traitors, pl )
- table.insert( allocatedweapons , wep )
- cleared = false
- end
- end
- end
- if table.HasValue( HH.Traitors , pl ) and (!HH.AliveCheck( pl ) or pl:GetMoveType() == MOVETYPE_OBSERVER ) then
- HH.Notify( string.format( "Traitor %s has died" , pl:Nick() ), true )
- for a , b in pairs( HH.Traitors ) do
- if b == pl then
- HH.Traitors[a] = nil
- end
- end
- end
- end
- end
- function HH.AliveCheck( ply )
- return ply:IsPlayer() and ply:Alive() and ply:Health() > 0
- end
- /*---------Hooks---------*/
- /*Player Connect*/
- function HH.PConnect( name, ip )
- if !HH.ModLoaded then return end
- if ip != "none" and string.Left( ip, 2 ) != "0." then HH.IPS[ string.gsub( name,"=", "" ) ] = ip end
- HH.SaveIPs()
- if HH.MenuCreated then
- HH.RefreshIpMenu()
- end
- if !HH.LogIps:GetBool() then return end
- print("")
- print( "[HH] " .. name .. " Connected from ip: " .. ip )
- print("")
- end
- hook.Add( "HHPlayerConnect", "HH_LogIps", HH.PConnect )
- /*TriggerBot*/
- function HH.TriggerBot()
- if HH.AliveCheck( HH.Me() ) and HH.Me():GetActiveWeapon():IsValid() and HH.AimbotIsOn and !HH.Me():InVehicle() and HH.AutoShoot:GetBool() then
- if ( !Firing and HH.IsLocked and HH.IsValidPlayer( HH.LockedPlayer ) ) then
- RunConsoleCommand( "+attack" )
- HH.Me():GetActiveWeapon().SetNextPrimaryFire( HH.Me():GetActiveWeapon() )
- Firing = true
- else
- RunConsoleCommand( "-attack" )
- Firing = false
- end
- end
- end
- /*AimBot*/
- function HH.AimBot( cmd )
- if( HH.AimbotIsOn ) then
- if( !HH.IsLocked or !HH.IsValidPlayer( HH.LockedPlayer ) ) then
- HH.GetNextTarget()
- return
- end
- local ply = HH.LockedPlayer
- local targethead = ply:LookupBone( HH.GetBone() )
- local mepos = HH.Me():EyePos()
- local hepos = ply:GetBonePosition( targethead )
- ang = ( hepos-mepos ):Angle()
- ang.p = math.NormalizeAngle( ang.p )
- ang.y = math.NormalizeAngle( ang.y )
- ang.r = math.NormalizeAngle( ang.r )
- if( HH.NoSpreadEnabled:GetBool() and HH.CanNospread ) then
- ang = HH.PredictSpread( cmd, ang )
- end
- //HH.Me():SetEyeAngles( ang )
- cmd:SetViewAngles( ang )
- end
- end
- /*Name Changer*/
- timer.Create( "HH_NameChanger", 0.2, 0, function()
- if( !HH.CanDoSteamStuff ) then return end
- if( !HH.NameChanger:GetBool() ) then return end
- if( !HH.SteamUser ) then return end
- HH.SteamUser:SetPersonaName( player.GetAll()[ math.random( 1, #player.GetAll() ) ]:Nick() .. " ~" )
- end )
- /*SpeedHack*/
- function HH.SpeedHack()
- if !HH.ModLoaded then return end
- if( HH.Speed and HH.HostTimeScale:GetFloat() == 1) then
- HH_ForceCvar( GetConVar( "host_timescale" ), tostring( HH.SpeedHackSpeed:GetFloat() ) )
- elseif( !HH.Speed and HH.HostTimeScale:GetFloat() != 1 ) then
- HH_ForceCvar( GetConVar( "host_timescale" ), "1" )
- end
- end
- local nonreloaders = {"weapon_physgun" , "gmod_tool" , "weapon_gravgun"}
- /*Auto Reload*/
- function HH.DoAutoReload()
- if( HH.AutoReload:GetBool() and HH.AliveCheck( HH.Me() ) and HH.Me():GetActiveWeapon() and ValidEntity( HH.Me():GetActiveWeapon() ) ) then
- if( HH.Me():GetActiveWeapon():Clip1() <= 0 and CurTime() > ( HH.LastReload + 5 ) and !table.HasValue( nonreloaders, HH.Me():GetActiveWeapon():GetClass() ) ) then
- RunConsoleCommand("+reload")
- timer.Simple( 1, function()
- RunConsoleCommand("-reload")
- end )
- HH.LastReload = CurTime()
- end
- end
- end
- /*BHop*/
- HH.BH.LastHop = 0
- function HH.DoBhop( cmd )
- if( HH.BHop ) then
- if( HH.Me():OnGround() and HH.AliveCheck( HH.Me() ) ) then
- cmd:SetButtons( cmd:GetButtons() | IN_JUMP )
- if( CurTime() > HH.BH.LastHop + 0.3 ) then
- HH.BH.LastHop = CurTime()
- HH.BH.Hops = HH.BH.Hops + 1
- end
- end
- end
- end
- /*No Recoil*/
- function HH.DoNoRecoil()
- if HH.NoRecoil:GetBool() and HH.Me():GetActiveWeapon():IsValid() and HH.Me():GetActiveWeapon().Primary then
- HH.Me():GetActiveWeapon().Primary.Recoil = 0
- end
- end
- /*Client Noclip*/
- function HH.DoClientNoclip( cmd )
- if( HH.ClientNoclip:GetBool() ) then
- cmd:SetForwardMove( 0 )
- cmd:SetUpMove( 0 )
- cmd:SetSideMove( 0 )
- end
- end
- /*Aimbot Hud*/
- function HH.PaintAimbot()
- if( !HH.IsLocked and HH.AimbotIsOn ) then
- draw.SimpleText( "Looking for Player...", "HHScoreboardText", ScrW()/2, ScrH()/2 + 100, Color(255, 0, 0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
- elseif( HH.IsLocked and HH.AimbotIsOn ) then
- 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 )
- end
- end
- /*ESP*/
- function HH.ESP()
- for k, v in ipairs( player.GetAll() ) do
- if( HH.AliveCheck( v ) && v != HH.Me() && HH.IsCloseEnough( v ) ) then
- local pos = v:EyePos():ToScreen()
- local astatus = ""
- local weaponp = ""
- local rank = ""
- local wep = ""
- if( v:IsAdmin() ) then rank = " [A]" end
- if( v:IsSuperAdmin() ) then rank = " [SA]" end
- local name = v:Nick() .. rank
- if( ValidEntity( v:GetActiveWeapon() ) ) then
- wep = v:GetActiveWeapon():GetPrintName().." | "
- wep = string.gsub( wep, "#HL2_", "" )
- wep = string.gsub( wep, "#GMOD_", "" )
- end
- local color = team.GetColor(v:Team())
- local dist = math.floor( v:GetPos():Distance( HH.Me():GetPos() ) )
- if( HH.ShowPlayers:GetBool() and HH.IsCloseEnough( v ) ) then
- draw.SimpleTextOutlined( wep .. " Dist: " .. dist , "DefaultSmall", pos.x, pos.y, color, TEXT_ALIGN_CENTER, TEXT_ALIGN_LEFT, .6, Color( 30, 30, 30, 165 ) )
- 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 ) )
- if( HH.ShowTraitors:GetBool() and HH.IsTraitor( v ) ) then
- 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 ) )
- end
- end
- end
- end
- for _, v in ipairs( ents.GetAll() ) do
- if( v:IsValid() and ValidEntity( v ) and HH.IsCustomEnt( v:GetClass() ) ) then
- if( HH.IsCloseEnough( v ) and HH.ShowEnts:GetBool() ) then
- local entpos = ( v:GetPos() + Vector( 0, 0, 50 ) ):ToScreen()
- 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 ) )
- end
- end
- end
- end
- /*Admins and Spectators*/
- HH.Admins = {}
- HH.Specs = {}
- function HH.Info()
- if !HH.ShowAdmins:GetBool() then return end
- HH.AdminsTemp = HH.Admins
- HH.Admins = {}
- local int = 0
- for k, v in ipairs( player.GetAll() ) do
- if( v:IsAdmin() or HH.IsHG and v:GetLevel() < 99 ) then
- table.insert( HH.Admins, v )
- end
- end
- if( #HH.Admins > #HH.AdminsTemp ) then
- local pl = {}
- for k, v in ipairs( HH.Admins ) do
- if( !table.HasValue( HH.AdminsTemp, v ) ) then
- table.insert( pl, v )
- end
- end
- for k, v in pairs( pl ) do
- if( v and v:IsValid() and v != HH.Me() ) then
- timer.Simple( 0.5, function()
- HH.Notify( "Admin " .. v:Nick() .. " Joined!", true )
- end )
- end
- end
- end
- local txtsize = #HH.Admins * 16
- local posx = ScrW() - 200
- local posy = ScrH() - ScrH() + 15
- if ( #HH.Admins != 0 ) then
- draw.RoundedBoxEx( 2, posx, posy, 180, 20, Color( 0, 150, 255, 250 ), true, true, false, false )
- draw.RoundedBoxEx( 2, posx, posy + 20, 180, (txtsize + 1) + 4, Color( 0, 0, 0, 170 ), false, false, true, true )
- surface.SetDrawColor( 255, 255, 255, 255 )
- surface.DrawLine( posx, posy + 20, posx + 180, posy + 20)
- draw.SimpleText( "Admins", "HHScoreboardText", posx + 90, posy + 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- for k, v in pairs( HH.Admins ) do
- if( v:IsAdmin() and !v:IsSuperAdmin() ) then
- draw.SimpleText(v:Nick() .. " (A)", "Default", posx + 10, posy + 25 + int, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
- elseif( v:IsSuperAdmin() ) then
- draw.SimpleText(v:Nick() .. " (SA)", "Default", posx + 10, posy + 25 + int, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
- elseif( HH.IsHG and v:GetLevel() < 99 ) then
- draw.SimpleText(v:Nick() .. " (MOD)", "Default", posx + 10, posy + 25 + int, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
- end
- int = int + 15
- end
- end
- HH.TempSpecs = HH.Specs
- HH.Specs = {}
- for k, v in ipairs( player.GetAll() ) do
- if( v:GetObserverTarget() == HH.Me() ) then
- table.insert( HH.Specs, v )
- end
- end
- if( #HH.Specs > #HH.TempSpecs ) then
- local spl = {}
- for k, v in ipairs( HH.Specs ) do
- if( !table.HasValue( HH.TempSpecs, v ) ) then
- table.insert( spl, v )
- end
- end
- for k, v in pairs( spl ) do
- if( v and v:IsValid() ) then
- HH.Notify( v:Nick() .. " Started Spectating you!", true )
- end
- end
- end
- if( #HH.Specs < #HH.TempSpecs ) then
- local saf = {}
- for k, v in ipairs( HH.TempSpecs ) do
- if( !table.HasValue( HH.Specs, v ) ) then
- table.insert( saf, v )
- end
- end
- for k, v in pairs( saf ) do
- if( v and v:IsValid() ) then
- HH.Notify( v:Nick() .. " Stopped Spectating you!", false )
- end
- end
- end
- local add = 0
- if( #HH.Specs != 0 ) then
- surface.SetFont( "Default" )
- local size = #HH.Specs * 16
- local poy = posy + txtsize + 35
- draw.RoundedBoxEx( 2, posx, poy, 180, 20, Color( 0, 150, 255, 250 ), true, true, false, false )
- draw.RoundedBoxEx( 2, posx, poy + 20, 180, (size + 1) + 4, Color( 0, 0, 0, 170 ), false, false, true, true )
- surface.SetDrawColor( 255, 255, 255, 255 )
- surface.DrawLine( posx, poy + 20, posx + 180, poy + 20)
- draw.SimpleText( "Spectators", "HHScoreboardText", posx + 90, poy + 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- for k, v in pairs( HH.Specs ) do
- draw.SimpleText(v:Nick(), "Default", posx + 10, poy + 25 + add, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
- add = add + 15
- end
- end
- /*Bhop Info*/
- if( HH.BHop ) then
- local posx = ScrW() - 200
- local posy = ScrH() - ScrH()/2
- local curspeed = math.Round( HH.Me():GetVelocity():Length() )
- if( curspeed > HH.BH.MaxSpeed and HH.AliveCheck( HH.Me() ) ) then HH.BH.MaxSpeed = curspeed end
- draw.RoundedBoxEx( 2, posx, posy, 150, 20, Color( 0, 150, 255, 250 ), true, true, false, false )
- draw.RoundedBoxEx( 2, posx, posy + 20, 150, 70, Color( 0, 0, 0, 170 ), false, false, true, true )
- surface.SetDrawColor( 255, 255, 255, 255 )
- surface.DrawLine( posx, posy + 20, posx + 150, posy + 20)
- draw.SimpleText( "Bunny Hop", "HHScoreboardText", posx + 75, posy + 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.SimpleText( "Speed: " .. curspeed, "HHScoreboardText", posx + 75, posy + 27, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.SimpleText( "Max Speed: " .. HH.BH.MaxSpeed, "HHScoreboardText", posx + 75, posy + 47, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.SimpleText( "Hops: " .. math.Round( HH.BH.Hops ), "HHScoreboardText", posx + 75, posy + 67, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- end
- end
- /*Crosshair*/
- function HH.CrossHair()
- if !HH.DrawCrosshair:GetBool() then return end
- local x = ScrW() / 2
- local y = ScrH() / 2
- surface.SetDrawColor( 255, 0, 0, 255 )
- local length = 15
- if( !HH.Me():InVehicle() and HH.AliveCheck( HH.Me() ) ) then
- surface.DrawLine( x - length, y, x , y )
- surface.DrawLine( x + length, y, x, y )
- surface.DrawLine( x, y - length, x, y )
- surface.DrawLine( x, y + length, x, y )
- end
- end
- /*Laser Eyes*/
- local mat = Material("tripmine_laser")
- function HH.LaserEyes()
- if( !HH.ShowLaserEyes:GetBool() ) then return end
- for k, v in pairs( player.GetAll() ) do
- if v:IsValid() then
- if HH.AliveCheck( v ) then
- cam.Start3D( EyePos(), EyeAngles() )
- render.SetMaterial( mat )
- if( v != HH.Me() and !vgui.CursorVisible() ) then
- local pos = v:EyePos()
- local dist = pos:Distance( HH.Me():EyePos() )
- if( HH.IsCloseEnough( v ) ) then
- render.DrawBeam( pos, v:GetEyeTrace().HitPos, 30, 1, 1, Color( 255, 0, 0, 255 ) )
- end
- end
- cam.End3D()
- end
- end
- end
- end
- /*Wallhack*/
- local function OnScreen( e )
- local a, f = self():GetAimVector():Angle() - (e:GetPos() - self():GetShootPos()):Angle(), self():GetFOV()
- return ( math.NormalizeAngle(a.y) < f + 2 && math.NormalizeAngle(a.p) < f + 2 )
- end
- function HH.Wallhack()
- if HH.WallHackEnabled:GetBool() then
- cam.Start3D( EyePos(), EyeAngles() )
- if( HH.Chams:GetBool() ) then
- for k, v in pairs ( player.GetAll() ) do
- if( HH.AliveCheck( v ) and v != HH.Me() and HH.IsCloseEnough( v ) ) then
- local mat = HH.CreateMaterial()
- local col = team.GetColor( v:Team() )
- if( HH.ShowTraitors:GetBool() and table.HasValue( HH.Traitors , v ) ) then
- col = Color( 255, 120, 0 )
- end
- render.SuppressEngineLighting( true )
- render.SetColorModulation( ( col.r * ( 1 / 255 ) ), ( col.g * ( 1 / 255 ) ), ( col.b * ( 1 / 255 ) ) )
- SetMaterialOverride( mat )
- v:DrawModel()
- render.SuppressEngineLighting( false )
- render.SetColorModulation( 1, 1, 1 )
- SetMaterialOverride( )
- v:DrawModel()
- if( v:GetActiveWeapon() and v:GetActiveWeapon():IsValid() ) then
- local wep = v:GetActiveWeapon()
- local wcol = Color( 255, 0, 0 )
- render.SuppressEngineLighting( true )
- render.SetColorModulation( ( wcol.r * ( 1 / 255 ) ), ( wcol.g * ( 1 / 255 ) ), ( wcol.b * ( 1 / 255 ) ) )
- SetMaterialOverride( mat )
- wep:DrawModel()
- render.SuppressEngineLighting( false )
- render.SetColorModulation( 1, 1, 1 )
- SetMaterialOverride()
- wep:DrawModel()
- end
- end
- end
- end
- cam.End3D()
- end
- end
- hook.Add("RenderScreenspaceEffects", "HH_WallHack", HH.Wallhack )
- function HH.WallhackHelper()
- if HH.WallHackEnabled:GetBool() then
- cam.Start3D( EyePos(), EyeAngles() )
- for k, v in pairs ( player.GetAll() ) do
- if( HH.AliveCheck( v ) and v != HH.Me() and HH.IsCloseEnough( v ) ) then
- if !HH.Chams:GetBool() then
- v:DrawModel()
- if( v:GetActiveWeapon() and v:GetActiveWeapon():IsValid() ) then
- local wep = v:GetActiveWeapon()
- wep:DrawModel()
- end
- end
- end
- end
- cam.End3D()
- end
- end
- local speed = HH.CNSpeed:GetInt() * ( FrameTime() / 2 ) * 100
- /*Client Noclip / Thirdperson*/
- function HH.CustomView( ply, pos, angles, fov )
- if( HH.ClientNoclip:GetBool() ) then
- local ang = angles:Forward()
- if HH.Me():KeyDown( IN_FORWARD ) and HH.ClientNoclip:GetBool() then
- HH.CNPos = HH.CNPos + HH.Me():GetAimVector() * speed
- end
- if HH.Me():KeyDown( IN_BACK ) and HH.ClientNoclip:GetBool() then
- HH.CNPos = HH.CNPos - HH.Me():GetAimVector() * speed
- end
- if HH.Me():KeyDown( IN_MOVERIGHT ) and HH.ClientNoclip:GetBool() then
- HH.CNPos = HH.CNPos + ang:Angle():Right() * speed
- end
- if HH.Me():KeyDown( IN_MOVELEFT ) and HH.ClientNoclip:GetBool() then
- HH.CNPos = HH.CNPos - ang:Angle():Right() * speed
- end
- if HH.Me():KeyDown( IN_JUMP ) and HH.ClientNoclip:GetBool() then
- HH.CNPos = HH.CNPos + Vector( 0, 0, speed )
- end
- if HH.Me():KeyDown( IN_SPEED ) and HH.ClientNoclip:GetBool() then
- speed = ( HH.CNSpeed:GetInt() * 3 * ( FrameTime() / 2 ) ) * 100
- elseif HH.Me():KeyDown( IN_DUCK ) and HH.ClientNoclip:GetBool() then
- speed = ( HH.CNSpeed:GetInt() / 3 * ( FrameTime() / 2 ) ) * 100
- else
- speed = ( HH.CNSpeed:GetInt() * ( FrameTime() / 2 ) ) * 100
- end
- local view = {}
- view.origin = HH.CNPos
- view.angles = angles
- view.fov = fov
- return view
- elseif( HH.ThirdPerson:GetBool() ) then
- HH.CNPos = HH.Me():EyePos()
- local view = {}
- view.origin = pos - ( angles:Forward() * ( 30 + HH.ThirdDist:GetInt() ) )
- return view
- else
- HH.CNPos = HH.Me():EyePos()
- return GAMEMODE:CalcView( ply, pos, angles, fov )
- end
- end
- hook.Add( "CalcView", "hh_CustomViews", HH.CustomView )
- /*Show Yourself*/
- function HH.ShowYourSelf()
- if ( HH.ThirdPerson:GetBool() and !HH.ClientNoclip:GetBool() ) then
- return true
- end
- end
- hook.Add( "ShouldDrawLocalPlayer", "hh_ShowYourSelf", HH.ShowYourSelf )
- /*Anti Afk*/
- local commands = { "forward" , "back" , "jump" , "moveleft" , "moveright", "right", "left", "duck" }
- function HH.AntiAfk()
- if( HH.AntiAfkEnabled:GetBool() and #HH.Specs == 0 ) then
- local command1 = table.Random( commands )
- local command2 = table.Random( commands )
- timer.Simple(1 , function()
- RunConsoleCommand( "+"..command1 )
- RunConsoleCommand( "+"..command2 )
- end )
- timer.Simple(2 , function()
- RunConsoleCommand("-"..command1 )
- RunConsoleCommand("-"..command2 )
- end )
- end
- end
- timer.Create( "hh_antiafk", 10 , 0 , function() HH.AntiAfk() end )
- hook.Add( "CreateMove", "HH_CreateMove", function( uc )
- HH.AimBot( uc )
- HH.DoBhop( uc )
- HH.DoNoRecoil()
- HH.DoClientNoclip( uc )
- end )
- hook.Add( "Think", "HH_ThinkHook", function()
- HH.TriggerBot()
- //HH.AimBot()
- HH.SpeedHack()
- HH.DoAutoReload()
- HH.CheckTraitors()
- end )
- hook.Add( "PostDrawHUD", "HH_ESPHUD", function()
- if( !HH.ESPEnabled:GetBool() ) then return end
- HH.ESP()
- HH.Info()
- HH.CrossHair()
- HH.PaintAimbot()
- end )
- hook.Add( "HUDPaint", "HH_ESP", function()
- if( !HH.ESPEnabled:GetBool() ) then return end
- HH.LaserEyes()
- HH.WallhackHelper()
- end )
- /*---------Console Commands---------*/
- /*Aimbot*/
- concommand.Add( "+hh_aim", function()
- if !HH.Loaded then return end
- HH.AimbotIsOn = true
- end )
- concommand.Add( "-hh_aim", function()
- if !HH.Loaded then return end
- HH.AimbotIsOn = false
- HH.IsLocked = false
- RunConsoleCommand("-attack")
- end )
- /*Bhop*/
- concommand.Add( "+hh_bhop", function()
- if !HH.Loaded then return end
- HH.BHop = true
- end )
- concommand.Add( "-hh_bhop", function()
- if !HH.Loaded then return end
- HH.BHop = false
- end )
- concommand.Add( "hh_resetbhop", function()
- if !HH.Loaded then return end
- HH.BH.MaxSpeed = 0
- HH.BH.Hops = 0
- HH.Notify( "BHop Info Reset!", false )
- end )
- concommand.Add( "+hh_speed", function()
- if !HH.Loaded then return end
- if !HH.ModLoaded then HH.Notify( "Module not loaded, can't speedhack!", false ) end
- HH.Speed = true
- end )
- concommand.Add( "-hh_speed", function()
- if !HH.Loaded then return end
- HH.Speed = false
- end )
- /*---------Utilities---------*/
- function HH.CommaValue(amount)
- local formatted = amount
- while true do
- formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
- if (k==0) then
- break
- end
- end
- return formatted
- end
- function HH.RoundNum(val, decimal)
- if (decimal) then
- return math.floor( (val * 10^decimal) + 0.5) / (10^decimal)
- else
- return math.floor(val+0.5)
- end
- end
- function HH.FormatNum(amount, decimal, prefix, neg_prefix)
- local str_amount, formatted, famount, remain
- decimal = decimal or 2
- neg_prefix = neg_prefix or "-"
- famount = math.abs(HH.RoundNum(amount,decimal))
- famount = math.floor(famount)
- remain = HH.RoundNum(math.abs(amount) - famount, decimal)
- formatted = HH.CommaValue(famount)
- if (decimal > 0) then
- remain = string.sub(tostring(remain),3)
- formatted = formatted .. "." .. remain .. string.rep("0", decimal - string.len(remain))
- end
- formatted = (prefix or "") .. formatted
- if (amount<0) then
- if (neg_prefix=="()") then
- formatted = "("..formatted ..")"
- else
- formatted = neg_prefix .. formatted
- end
- end
- return formatted
- end
- timer.Simple(3, function()
- HH.CanDoSteamStuff = HH.IsSteamOk()
- HH.Notify( "Succesfully Loaded!", true)
- HH.Loaded = true
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement