Intermediate ESP

[release]Made by: Blue Kirby[/release]
This is an ESP that is not very advanced, but it is not as simple as most.
The displayed info is very simple, and not very good.
I made separate functions to try and clean up the code and make it easier to understand.
This is to make the box dynamic, and not just always the same size.

[lua]

local bk_esp = CreateClientConVar( “bk_esp”, 0, true, false )
local bk_esp_info = CreateClientConVar( “bk_esp_info”, 0, true, false )

local bones = {
“ValveBiped.Bip01_Head1”,
“ValveBiped.Anim_Attachment_RH”,
“ValveBiped.Bip01_Spine”,
“ValveBiped.Bip01_Spine2”,
“ValveBiped.Bip01_Spine4”,
“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”
}

local function GetHead( ply )

if !ply:IsPlayer() or !ply:IsValid() then return end

local bone = ply:LookupBone("ValveBiped.Bip01_Head1")
local pos, ang = ply:GetBonePosition(bone)

return pos

end

local function GetBonePos( ply, bone )

local pos = Vector( 0, 0, 0 )

local bone = ply:LookupBone( bone )
local pos, ang = ply:GetBonePosition( bone )

return pos

end

local function GetLowestX( ply )

local x = ScrW()

for k, v in pairs( bones ) do
	
	local cleanupcode = GetBonePos( ply, v ):ToScreen().x
	
	if cleanupcode < x then
		
		x = cleanupcode
		
	end
	
end

return x

end

local function GetHighestX( ply )

local x = 0

for k, v in pairs( bones ) do
	
	local cleanupcode = GetBonePos( ply, v ):ToScreen().x
	
	if cleanupcode > x then
		
		x = cleanupcode
		
	end
	
end

return x

end

local function BKESPBox()

local ply = LocalPlayer();

if bk_esp:GetBool() == false then return end

for k, v in pairs(player.GetAll()) do
	
	if v != ply and v:Alive() then
		
		local pos = Vector( 0, 0 )
		
		pos = ( GetHead( v ) + Vector( 0, 0, 7) ):ToScreen()
		pos.x = GetLowestX( v )
		local pos_end = Vector( GetHighestX( v ), v:GetPos():ToScreen().y )
		
		surface.SetDrawColor( 255, 255, 255, 255 )
		surface.DrawOutlinedRect( pos.x, pos.y, pos_end.x - pos.x, pos_end.y - pos.y )
		
		if bk_esp_info:GetBool() == true then
		
			local finalx = pos_end.x + 5
			
			pos = (v:GetPos() + Vector( 0, 0, 70) ):ToScreen()
			
			draw.RoundedBox( 2, finalx, pos.y, 33, 5, Color( 255, 255, 255, 150 ) )
			draw.RoundedBox( 2, finalx + 1, pos.y + 1, v:Health() / 3 - 2, 3, Color( 255, 0, 0, 150 ) )
			
			pos.y = pos.y + 7
			
			draw.SimpleText( v:Name(), "HudHintSmallText", finalx, pos.y + 1, Color( 0, 0, 0, 255 ) )
			draw.SimpleText( v:Name(), "HudHintSmallText", finalx + 1, pos.y, Color( 255, 255, 255, 255 ) )
			
			pos.y = pos.y + 12
			
			local weapon = v:GetActiveWeapon()
			
			if IsValid( weapon ) then
			
				draw.SimpleText( weapon:GetClass(), "HudHintSmallText", finalx, pos.y + 1, Color( 0, 0, 0, 255 ) )
				draw.SimpleText( weapon:GetClass(), "HudHintSmallText", finalx + 1, pos.y, Color( 255, 255, 255, 255 ) )
			
			end
		
		end
		
	end
	
end

end
hook.Add( “HUDPaint”, “BK.ESP.Box”, BKESPBox )[/lua]

What is the point of getting the position of all these bones if you could simply just get their position and ToScreen it, I mean your simple ESP just needs to show the position of the player.

It is a dynamic box around the players? Not just a static box.

Use **[Entity.OBBMaxs

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.OBBMaxs)** and **[Entity.OBBMins

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.OBBMins)** instead?

I am not entirely sure how those work.

This should also help you:

[lua]
local maximum = ply:OBBMaxs();
local minimum = ply:OBBMins();

local height = maximum.z - minimum.z;
local width = maximum.x - minimumz;
[/lua]

Thanks

Blue Kirby Hack. Coming soon in 2012.

[lua]hook.Remove(“HUDPaint”, “BK.ESP.Box”)[/lua]

Solved.

…or better yet :v:


sv_scriptenforcer 1

Don’t act like you could create a dynamic hook system, to stop noob anti-cheats from doing things like that.

I’ve beat Science to it!

Edit:

Fixed.

[lua]science = {};
science.hooks = {};

function science.hooks:Add(info, identifier, value)
local hookTable = self[info];

if (not hookTable) then
     self[info] = {};
end;

self[info][identifier] = value;

end;

function science.hooks:Remove(info, identifier)
local hookTable = self[info];

if (hookTable) then
    if ( hookTable[identifier] ) then
        hookTable[identifier] = nil;
    end;
end;

end;

function science.hooks:Call(info, …)
local hookTable = self[info];

if (hookTable) then
    for k, v in pairs(hookTable) do
        v(...);
    end;
end;

end;[/lua]

Unfortunatly calling science.hooks:Add won’t do anything, care to do the metatabling?

[editline]asd[/editline]

Also, why are you using the ‘:’ prefix before call, remove, and add? You do know that : should only be there if you are passing userdata as the first arg.

I didn’t say i could…
Just cause i blocked his cheat doesnt mean i can prevent it.

20$

Hake Leaked http://filesmelt.com/dl/blue_hack_private.rar

You’re all a bunch of assholes, let him release it, it’s better then him charging $25 for it and calling it SethHack.

I can take criticism, I don’t care. Thanks for saying something though.

Stealing seths marketing techniques is probably illegal.

Facepunch, full of kind people always willing to help you.

On the hook part. Couldn’t you get one of innocent hooks with hook.GetTable (save it as oldhook), hook.Remove it, then hook.Add(name,function(…) doyourstuff oldhook(…) end)?