Code:
-- just a font
surface.CreateFont( "TheDefaultSettings", {
font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
extended = false,
size = 13,
weight = 800,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
})
--main part
function esp()
red = Color(255,0,0)
green = Color(51,255,0)
local dist = 40000^2
for k, v in pairs(player.GetAll()) do
local waypoint = v:GetPos()
if LocalPlayer():GetPos():DistToSqr(waypoint) < dist and v:Alive() then
waypoint = waypoint:ToScreen()
surface.SetDrawColor(color_transparent)
surface.DrawRect(waypoint.x - 32,waypoint.y -32,60,60)
draw.SimpleText(v:Name(), "TheDefaultSettings", waypoint.x, waypoint.y, red, TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText(v:Health(), "TheDefaultSettings", waypoint.x - 5, waypoint.y + 10, green, TEXT_ALIGN_BOTTOM, TEXT_ALIGN_CENTER)
end
end
end
hook.Add("HUDPaint", "ESP", esp)