//just gonna post this because idc anymore XD but i wanna fix but will fix detection issues later
function PredictSpread( cmd, ang )
local w = LocalPlayer():GetActiveWeapon()
local vecCone, valCone = Vector( 0, 0, 0 )
if ( w && w:IsValid() && ( type( w.Initialize ) == "function" ) ) then
valCone = adgeru:GetCone( w )
if ( type( valCone ) == "number" ) then
vecCone = Vector( -valCone, -valCone, -valCone )
elseif ( type( valCone ) == "Vector" ) then
vecCone = valCone * -1
elseif bit.band( cmd:GetButtons(), IN_SPEED ) or bit.band( cmd:GetButtons(), IN_JUMP ) then
vecCone = valCone + (cone * 2 )
end
else
if ( w:IsValid() ) then
local class = w:GetClass()
if ( adgeru.HL2Cones[ class ] ) then
vecCone = adgeru.HL2Cones[ class ]
end
if ( adgeru.CustomCones[ class ] ) then
vecCone = adgeru.CustomCones[ class ]
end
end
end
return DS_manipulateShot( DS_md5PseudoRandom( DS_getUCMDCommandNumber( cmd ) ), ang:Forward(), vecCone ):Angle()
end
local function PredictSpread( cmd, ang )
local w = g.LocalPlayer():GetActiveWeapon()
local vecCone, valCone = g.Vector( 0, 0, 0 )
if w && w:IsValid() then
if g.type( w.Initialize ) == "function" then
valCone = GetCone( w )
if g.type( valCone ) == "number" then
vecCone = g.Vector( -valCone, -valCone, -valCone )
elseif g.type( valCone ) == "Vector" then
vecCone = valCone * -1
end
else
local class = w:GetClass()
if (adgeru.HL2Cones[class]) then
vecCone = adgeru.HL2Cones[class]
end
end
end
return DS_manipulateShot( DS_md5PseudoRandom( DS_getUCMDCommandNumber( cmd ) ), ang:Forward(), vecCone ):Angle()
end
local angles = Angle( 0, 0, 0 )
function GetAngles()
if ( !ValidEntity( g.LocalPlayer() ) ) then return end
angles = LocalPlayer():EyeAngles()
end
function adgeru:GetTarget()
local target
if target == nil then
target = g.LocalPlayer()
else
target = target
end
local ply = g.LocalPlayer()
local angA, angB = 0
local x, y = ScrW(), ScrH()
local distance = math.huge
for k, e in g.pairs( g.player.GetAll() ) do
if ( e != g.LocalPlayer() && e:Alive() && adgeru:IsVisible( e ) && adgeru:ValidTarget( e ) && adgeru:InFov( e ) ) then
local ePos, oldPos, myAngV = e:EyePos():ToScreen(), target:EyePos():ToScreen(), ply:GetAngles()
local thedist = e:GetPos()

istToSqr( LocalPlayer():GetPos() )
angA = math.Dist( x / 2, y / 2, oldPos.x, oldPos.y )
angB = math.Dist( x / 2, y / 2, ePos.x, ePos.y )
if (thedist < distance) then
distance = thedist;
target = e;
end
end
end
return target
end
function adgeru:GetPos( ent )
local Eyes = ent:LookupAttachment( "eyes" )
local Pos
if ( adgeru:GetBool( "aim_obbcenter" ) or ent:EyeAngles().p < -89 ) then
Pos = ent:LocalToWorld( ent:OBBCenter() )
elseif ent:GetModel() == "models/error.mdl" or table.HasValue( adgeru.BrokenModels, ent:GetModel() ) then
Pos = ent:LocalToWorld( ent:OBBCenter() )
elseif Eyes ~= 0 then
Eyes = ent:GetAttachment( Eyes )
if ( Eyes && Eyes.Pos ) then
Pos = Eyes.Pos, Eyes.Ang
end
else
//Pos = ent:LookupBone( "ValveBiped.Bip01_Neck1" )
Pos = adgeru:GetVar( "aimbot_bones_type" )
end
return Pos
end
function adgeru:Prediction( pos , pl )
if g.IsValid( pl ) and g.type( pl:GetVelocity() ) == "Vector" and pl.GetPos and g.type( pl:GetPos() ) == "Vector" then
local distance = LocalPlayer():GetPos()

istance( pl:GetPos() )
local weapon = ( LocalPlayer().GetActiveWeapon and ( g.IsValid( LocalPlayer():GetActiveWeapon() ) and LocalPlayer():GetActiveWeapon():GetClass() ) )
/*
if weapon and adgeru.Prediction[ weapon ] then
local time = distance / [ weapon ]
return pos + pl:GetVelocity() * time
end
*/
end
return pos
end
function adgeru:IsVisible( e )
local trace = util.TraceLine( {
start = LocalPlayer():GetShootPos(),
endpos = adgeru:GetPos( e ),
filter = { LocalPlayer(), e },
mask = MASK_SHOT + CONTENTS_WINDOW
} )
if (( trace.Fraction >= 0.99 )) then return true end
return false
end
function adgeru:InFov( e )
if( adgeru:GetVar( "aim_fov" ) != 180 ) then
local lpang = LocalPlayer():GetAngles()
local ang = ( e:GetPos() - LocalPlayer():EyePos() ):Angle()
local ady = math.abs( g.math.NormalizeAngle( lpang.y - ang.y ) )
local adp = math.abs( g.math.NormalizeAngle( lpang.p - ang.p ) )
if( ady > adgeru:GetVar( "aim_fov" ) || adp > adgeru:GetVar( "aim_fov" ) ) then return false end
end
return true
end
function adgeru:ValidTarget( e )
local ply = g.LocalPlayer()
if ( !g.IsValid( e ) ) then return false end
if ( !e:IsValid() || ( !e:IsPlayer() && !e:IsNPC() ) || e == ply ) then return false end
if ( e:IsPlayer() && e:InVehicle() ) then return false end
if ( e:IsPlayer() && !e:Alive() || e:IsPlayer() && e:Health() <= 0 ) then return false end
if ( e:IsNPC() ) then return false end
if ( adgeru:GetBool( "aim_ignorebots" ) && e:IsBot() ) then return false end
if ( !adgeru:InFov( e ) ) then return false end
if ( e:GetMoveType() == MOVETYPE_OBSERVER ) then return false end
if g.string.find( g.string.lower( team.GetName( e:Team() ) ), "spec" ) then return false end
if ( !adgeru:GetBool( "aim_targetfriends" ) && table.HasValue( adgeru.Friends, e:Nick() ) ) then return false end
if ( adgeru:GetBool( "aim_targetfriends" ) && !table.HasValue( adgeru.Friends, e:Nick() ) ) then return false end
if ( !adgeru:GetBool( "aim_friendly" ) && e:Team() == LocalPlayer():Team()) then return false end
if ( adgeru:GetBool( "aim_ignoreadmins" ) && adgeru:IsAdmin( e ) ) then return false end
if ( adgeru:GetBool( "aim_spawnprotection" ) && e:GetColor( r, g, b, a ).a < 255 or LocalPlayer():GetColor( r, g, b, a ).a < 255 ) then return false end
if ( adgeru:GetBool( "aim_ignorefriends" ) && e:GetFriendStatus() == "friend" ) then return false end
if ( adgeru:IsTTT() && adgeru:GetBool( "aim_ignoreinnocents" ) && !table.HasValue( adgeru.Traitors, e:Nick() ) ) then return false end
if ( adgeru:IsTTT() && adgeru:GetBool( "aim_ignorefriendlytraitors" ) && LocalPlayer():IsTraitor() && adgeru:IsTraitor( e ) ) then return false end
if ( adgeru:IsTTT() && adgeru:IsTraitor( e ) && adgeru:GetBool( "aim_ignoretraitors" ) ) then return false end
return true
end
function adgeru:ShouldAim()
if adgeru:IsDown( "+aimbot" ) then
return true
elseif adgeru:GetBool( "aim_toggle" ) then
return true
else
return false
end
end
adgeru.HasTarget = false
adgeru.NoSpreadAngle = Angle( 0, 0, 0 )
local shooting = false
function adgeru.Aimbot( ucmd )
adgeru.NoSpreadAngle = ucmd:GetViewAngles()
adgeru.Target = adgeru:GetTarget()
adgeru.Angles = ucmd:GetViewAngles()
local ply = g.LocalPlayer()
if ( adgeru:ShouldAim() && adgeru.Target != ply && adgeru.Target != nil ) then
local Aimspot
adgeru.HasTarget = true
if adgeru:GetBool( "aim_prediction" ) then
Aimspot = adgeru:Prediction( adgeru:GetPos( adgeru.Target ) ) - Vector( 0, 0, adgeru:GetVar( "aim_offset" ) )
Aimspot = Aimspot + adgeru.Target:GetVelocity() * ( 1 / 66 ) - LocalPlayer():GetVelocity() * ( 1 / 66 )
else
Aimspot = ( adgeru:GetPos( adgeru.Target ) ) - Vector( 0, 0, adgeru:GetVar( "aim_offset" ) )
Aimspot = Aimspot + adgeru.Target:GetVelocity() / 50 - LocalPlayer():GetVelocity() / 50
end
adgeru.Angles = ( Aimspot - LocalPlayer():GetShootPos() ):GetNormal():Angle()
if adgeru:GetBool( "aim_noshake" ) then
adgeru.NoSpreadAngle = adgeru.Angles
else
adgeru.NoSpreadAngle = ucmd:GetViewAngles()
end
if adgeru:GetBool( "aim_nospread" ) then
adgeru.Spread = PredictSpread( ucmd, Angle( adgeru.Angles.p, adgeru.Angles.y, 0 ) )
else
adgeru.Spread = Angle( adgeru.Angles.p, adgeru.Angles.y, 0 )
end
adgeru.Angles.p = g.math.NormalizeAngle( adgeru.Angles.p )
adgeru.Angles.y = g.math.NormalizeAngle( adgeru.Angles.y )
if adgeru:GetBool( "aim_anti" ) then
ucmd:SetViewAngles( Angle( -adgeru.Spread.p + 900, adgeru.Spread.y + 180, 0 ) )
else //-180,-186.49999
adgeru:SetViewAngles( ucmd, adgeru.Spread )
end
local w = LocalPlayer():GetActiveWeapon()
if ( adgeru:GetBool( "aim_auto" ) && !shooting ) then
//g.timer.Simple( 0.01, function() LocalPlayer():ConCommand( "+attack" ) shooting = true end )
end
//g.timer.Simple( 0.01, function() LocalPlayer():ConCommand( "-attack" ) shooting = false end )
else
adgeru.HasTarget = false
end
end
function adgeru.AntiAim( cmd, u )
adgeru.ViewAngles = cmd:GetViewAngles()
if ( adgeru:GetBool( "aim_anti" ) && !LocalPlayer():KeyDown( IN_ATTACK ) && adgeru.Target == g.LocalPlayer() ) then
cmd:SetViewAngles( Angle( -181, cmd:GetViewAngles().y, 0 ) )
end
end
function adgeru.hjkl( cmd, u )
if adgeru:GetBool( "misc_hjkl" ) then
if !LocalPlayer():IsOnGround() then
cmd:SetButtons( bit.band( cmd:GetButtons(), bit.bnot( IN_JUMP ) ) )
end
end
end