Yeah this is so complicated.
[lua]
self = LocalPlayer()
surface.CreateFont( “Arial”, 14, 400, true, false, “ESPSmall” )
function DoESP( )
for _, pl in pairs(player.GetAll()) do
local pos = pl:GetPos()
local mypos = self:GetPos()
local size = ScrW() * 0.02
pos.z = pos.z + 80
pos = pos:ToScreen()
if pl:Team() == self:Team() then
if pl:Alive() then
if (math.floor(pl:GetPos():Distance(mypos)) <= 1500) then
draw.SimpleText(pl:Name(), “ESPSmall”, pos.x, pos.y + size + 10, Color(50,255,50,150), TEXT_ALIGN_CENTER)
draw.SimpleText("Health: "…pl:Health(), “ESPSmall”, pos.x, pos.y-10 + size + 30, Color(50,255,255,150), TEXT_ALIGN_CENTER)
end
end
end
if pl:Team() != self:Team() then
if pl:Alive() then
if (math.floor(pl:GetPos():Distance(mypos)) <= 1500) then
draw.SimpleText(pl:Name(), “ESPSmall”, pos.x, pos.y + size + 10, Color(255,50,50,150), TEXT_ALIGN_CENTER)
draw.SimpleText("Health: "…pl:Health(), “ESPSmall”, pos.x, pos.y-10 + size + 30, Color(50,255,255,150), TEXT_ALIGN_CENTER)
end
end
end
end
end
hook.Add(“HUDPaint”,“ESP”,DoESP)
[/lua]
Also it looks nicer…
Oh, and here’s how you find them druglabs in RP Mods
[lua]
self = LocalPlayer()
surface.CreateFont( “Arial Bold”, 35, 400, true, false, “PropESP” )
function PropESP()
for _, ent in pairs(ents.GetAll()) do
local pos = ent:GetPos()
local model = ent:GetModel()
local mypos = self:GetPos()
if (ent:GetModel()==“models/props_combine/combine_mine01.mdl”) then
pos = pos:ToScreen()
draw.SimpleText("+" , “PropESP”, pos.x, pos.y, Color(255,255,255,200), TEXT_ALIGN_CENTER)
draw.SimpleText(""…math.floor(ent:GetPos():Distance(mypos)), “ESPSmall”, pos.x, pos.y-5, Color(255,255,255,200), TEXT_ALIGN_CENTER)
end
end
end
hook.Add(“HUDPaint”,“PropESP”,PropESP)
[/lua]