-- fonts
surface.CreateFont("arial",12,200,true,false,"Testfont1")
surface.CreateFont("arial",12,250,true,false,"Testfont2")
surface.CreateFont("arial",12,300,true,false,"Testfont3")
surface.CreateFont("arial",12,350,true,false,"Testfont4")
local font = "Testfont1"
function DrawPlayerName()
for _,ply in pairs(player.GetAll()) do
local pos = ply:GetShootPos() -- höhe sollte passen
local screen_pos = pos:ToScreen()
if (LocalPlayer() ~= ply) then
local dist = pos:Distance(LocalPlayer():GetPos())
if dist < 500 then
font = "Testfont4"
elseif dist >= 500 and dist < 1000 then
font = "Testfont3"
elseif dist >= 1000 and dist < 2000 then
font = "TestFont2"
end
draw.DrawText(ply:Nick(),font,screen_pos.x + 45,screen_pos.y -20,Color(255,255,255,255),1)
end
end
end