Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local user = surface.GetTextureID("gui/silkicons/user")
- local admin = surface.GetTextureID("gui/silkicons/shield")
- surface.CreateFont ( "ChatFont", 60, 700, true, false, "Playername", true )
- surface.CreateFont ( "ChatFont", 30, 700, true, false, "Playerjob", true )
- hook.Add("PostPlayerDraw", "RP Player Names", function (ply)
- if !ply:Alive() then return end
- if ply:Team() == TEAM_CONNECTING or
- ply:Team() == TEAM_SPECTATOR then return end
- local offset = Vector( 0, 0, 20 )
- local ang = LocalPlayer():EyeAngles()
- local pos = ply:EyePos() + offset + ang:Up()
- ang:RotateAroundAxis( ang:Forward(), 90 )
- ang:RotateAroundAxis( ang:Right(), 90 )
- cam.Start3D2D( pos, Angle( 0, ang.y, 90 ), 0.1 )
- surface.SetFont("Playername")
- local tw, th = surface.GetTextSize(ply:GetName() or "?")
- if ply:IsAdmin() then
- surface.SetTexture(admin)
- else
- surface.SetTexture(user)
- end
- surface.SetDrawColor(255, 255, 255, 255)
- surface.DrawTexturedRect(tw * -0.5 - 50, 16, 32, 32)
- draw.DrawText( ply:GetName() or "?", "Playername", 0, 0, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- draw.DrawText( ply.DarkRPVars.job or "?", "Playerjob", 0, 68, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
- local health = math.Clamp(ply:Health() / 100, 0, 1)
- health = 200 * health
- surface.SetDrawColor(0, 0, 0, 150)
- surface.DrawRect(-101, 62, 202, 4)
- surface.SetDrawColor(200, 0, 0, 255)
- surface.DrawRect(-100, 63, health, 2)
- cam.End3D2D()
- end)
Add Comment
Please, Sign In to add comment