• Paint a Name over a player?
    2 replies, posted
Hey. I want to ask, how i can paint the name of the player at his Head? I know the Drawing things. But not how to draw it at a player.. Please help :)
I would normally [url=http://wiki.garrysmod.com/?title=Vector.ToScreen]ToScreen[/url] the players position. You could also use a [url=http://wiki.garrysmod.com/?title=Cam]cam[/url] function (not sure which though).
Thank you :D Edit: For People who wants to know how: [lua] function render_square(pl) for k, v in pairs(player.GetAll()) do local TargetPos = (v:GetPos() + Vector( 0, 0, 90 ) ):ToScreen() x = TargetPos.x y = TargetPos.y local pos = Vector(0, 0, 128):ToScreen() surface.SetTextPos( x,y ) surface.SetFont("TargetID") surface.SetTextColor(255,255,255,255) surface.DrawText(v:Name()) end end hook.Add( "HUDPaint", "square", render_square ) [/lua]
Sorry, you need to Log In to post a reply to this thread.