ghLib - I got bored
ghLib v1
by cdrizzle
like really bored
Features:
(* = required)
Aimbot:
Anti-Anti-Aim:
Miscellaneous:
Drawing:
Source:
Usage:
ghLib.*function*(args)
glhf
by cdrizzle
like really bored
Features:
(* = required)
Aimbot:
- Visible(Player pEntity*, Vector vecStart*, Vector vecEnd*) Function
- GetPosition(Player pEntity*, String strBone*, bool bPredictionOverride = false) Function
- BoneScan(Player pEntity*, Vector vecShootPos = pLocalShootPos, String strBone = head) Function
- CheckValid(Player pEntity*, bool bIgnoreTeam = false, bool bIgnoreFriends = false, bool bCheckVisible = false, bool bBoneScan = false, String strBone = head) Function
Anti-Anti-Aim:
- SetPlayerAngles(Player pEntity*, Angle angAngle*) Function
Miscellaneous:
- FakeLag(UserCmd userCmd*, int iChoke, int iSend) Function
- Print(Color colPrefix*, String strPrefix*, color colMessage*, string strMessage*, bool bInChat = false) Function
Drawing:
- FillRGBA(int iX*, int iY*, int iW*, int iH*, Color colDrawColor*) Function
- OutlineRGBA(int iX*, int iY*, int iW*, int iH*, Color colDrawColor*) Function
- DrawText(String strText*, String strFont*, int iX*, int iY*, Color colDrawColor*, bool bCenterX = false, bool bCenterY = false, bool bShadow = false, int iShadowOffsetX = 2, int iShadowOffsetY = 2, Color colShadowColor = Color(255, 255, 255, 255)) Function
Source:
Code:
/*
[gh]Lib v1
Credits:
cdriza - 100% of the code
*/
require("bsendpacket")
local pLocalPlayer = LocalPlayer()
local ghLib = {}
/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Aimbot Functions
////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
ghLib.Bones = {
"ValveBiped.Bip01_Head1",
"ValveBiped.Anim_Attachment_RH",
"ValveBiped.Bip01_Spine",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_R_Foot",
"ValveBiped.Bip01_R_Thigh",
"ValveBiped.Bip01_R_Calf",
"ValveBiped.Bip01_R_Shoulder",
"ValveBiped.Bip01_R_Elbow",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_L_Foot",
"ValveBiped.Bip01_L_Thigh",
"ValveBiped.Bip01_L_Calf",
"ValveBiped.Bip01_L_Shoulder",
"ValveBiped.Bip01_L_Elbow",
}
function ghLib.Visible(pEntity, vecStart, vecEnd)
local tdData = {
start = vecStart,
endpos = vecend,
filter = {pLocalPlayer, pEntity},
mask = MASK_SHOT,
}
return util.TraceLine(tdData).Fraction == 1
end
function ghLib.GetPosition(pEntity, strBone, bPredictionOverride)
local vecPos = pEntity:GetBonePosition(pEntity:LookupBone(strBone))
if (!bPredictionOverride) then
local vecVelocity = pEntity:GetVelocity()
vecPos = vecPos + (vecVelocity * engine.TickInterval())
vecVelocity = pLocalPlayer:GetVelocity()
vecVelocity.z = 0
vecPos = vecPos - (vecVelocity * engine.TickInterval())
end
return vecPos
end
function ghLib.BoneScan(pEntity, vecShootPos, strBone)
local vecShootPos = vecShootPos && vecShootPos || pLocalPlayer:GetShootPos()
local strDefaultBone = strBone && strBone || "ValveBiped.Bip01_Head1"
local vecPos = ghLib.GetPosition(pEntity, strDefaultBone)
if (ghLib.Visible(pEntity, vecShootPos, vecPos)) then
return true, vecPos
else
for iIndex = 1, #ghLib.Bones do
local strBoneID = ghLib.Bones[iIndex]
if (strBoneID == strDefaultBone) then
continue
end
vecPos = ghLib.GetPosition(pEntity, strBoneID)
if (!ghLib.Visible(pEntity, vecShootPos, vecPos)) then
if (iIndex == #ghLib.Bones) then
return false
end
continue
else
return true, vecPos
end
end
end
return false
end
function ghLib.CheckValid(pEntity, bIgnoreTeam, bIgnoreFriends, bCheckVisible, bBoneScan, strBone)
local vecShootPos = pLocalPlayer:GetShootPos()
if (!pEntity) then return false end
if (pEntity == pLocalPlayer) then return false end
if (!pEntity:IsPlayer()) then return false end
if (pEntity:IsDormant()) then return false end
if (0 >= pEntity:Health()) then return false end
if (bIgnoreTeam && pEntity:Team() == pLocalPlayer:Team()) then return false end
if (bIgnoreFriends && pEntity:GetFriendStatus() == "friend") then return false end
if (bCheckVisible) then
local strDefaultBone = strBone && strBone || "ValveBiped.Bip01_Head1"
local vecPos = ghLib.GetPosition(pEntity, strDefaultBone)
if (bBoneScan) then
local bFound, vecBonePos = ghLib.BoneScan(pEntity, vecShootPos, strDefaultBone)
return bFound, vecBonePos
else
return ghLib.Visible(pEntity, vecShootPos, vecPos), vecPos
end
end
return true
end
/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Anti-Anti-Aim {SetAngles}
////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
ghLib.Angles = {}
function ghLib.SetPlayerAngles(pEntity, angAngle)
angAngle.y =
ghLib.Angles[pEntity] = angAngle
end
/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Miscellaneous
////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
ghLib.FakeLagTick = 0
function ghLib.FakeLag(userCmd, iChoke, iSend)
if (userCmd:CommandNumber() == 0) then
return true
end
if (!iChoke) then
iChoke = 10
end
if (!iSend) then
iSend = math["Round"](iChoke / 2, 0)
end
if (iChoke >= 15 || 1 >= iChoke || 0 >= iSend) then
bSendPacket = true
return false
end
ghLib.FakeLagTick = ghLib.FakeLagTick + 1
if (ghLib.FakeLagTick > (iChoke + iSend)) then
ghLib.FakeLagTick = 1
end
if (iSend >= ghLib.FakeLagTick) then
bSendPacket = true
else
bSendPacket = false
end
return true
end
function ghLib.Print(colPrefix, strPrefix, colMessage, strMessage, bChat)
local fPrint = bChat && chat.AddText || MsgC
strMessage = strMessage .. bChat && "" || "\n"
fPrint(colPrefix, "[" .. strPrefix .. "]", colMessage, strMessage)
end
/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Drawing
////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
function ghLib.FillRGBA(iX, iY, iW, iH, colDrawColor)
surface.SetDrawColor(colDrawColor.r, colDrawColor.g, colDrawColor.b, colDrawColor.a && colDrawColor.a || 255)
surface.DrawRect(iX, iY, iW, iH)
end
function ghLib.OutlineRGBA(iX, iY, iW, iH, colDrawColor)
surface.SetDrawColor(colDrawColor.r, colDrawColor.g, colDrawColor.b, colDrawColor.a && colDrawColor.a || 255)
surface.DrawOutlinedRect(iX, iY, iW, iH)
end
function ghLib.DrawText(strText, strFont, iX, iY, colDrawColor, bCenterX, bCenterY, bShadow, iShadowOffsetX, iShadowOffsetY, colShadowColor)
surface.SetFont(strFont)
local iW, iH = surface.GetTextSize(strText)
surface.SetTextPos(math["Round"](iX - (bCenterX && iW / 2 || 0), 0), math["Round"](iY - (bCenterY && iH / 2 || 0), 0))
surface.SetTextColor(colDrawColor.r, colDrawColor.g, colDrawColor.b, colDrawColor.a && colDrawColor.a || 255)
surface.DrawText(strText)
if (bShadow) then
iShadowOffsetX = iShadowOffsetX && iShadowOffsetX || 2
iShadowOffsetY = iShadowOffsetY && iShadowOffsetY || 2
colShadowColor = colShadowColor && colShadowColor || Color(255, 255, 255)
ghLib.DrawText(strText, strFont, iX + iShadowOffsetX, iY + iShadowOffsetY, colShadowColor, bCenterX, bCenterY)
end
end
/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Hooks
////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
function ghLib._SetAngles()
for pEntity, angAngle in next, ghLib.Angles do
pEntity:SetPoseParameter("aim_pitch", angAngle.x)
pEntity:SetRenderAngles(Angle(0, angAngle.y, 0))
end
end
hook.Add("PreDrawOpaqueRenderables", "{ghLib} SetAngles", ghLib._SetAngles)
/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Cheat
////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
// Your cheat goes here!
ghLib.*function*(args)
glhf

