Player Title - Displays text above player heads

I was bored and decided to fulfil someones request. So I give you “Player Title”. With this you can set your title(description or what ever) and it will display above your head for other players. It also displays your name.

Your title is saved to a file on the server, so you don’t have to set your title every time you join. Administrators have the ability to set other players title.

You can set your own title with “!settitle text” in chat and “!settitleadmin playername text” to set it for others, if you are an admin in the server.

http://www.garrysmod.org/img/dl/47890_1.jpg

http://www.garrysmod.org/img/dl/47890_2.jpg

http://www.garrysmod.org/img/?t=dll&id=47890

Enjoy!

simple :slight_smile:

It is simple, actually. :slight_smile:

Can you set your own title?

This idea was from SAT right?

Yeah SAT/Citrus has something like this, too. It’s from a request.

You can set your own title with “!settitle” in chat. And “!settitleadmin playername” for other players.

Looks good. I’ll ask about adding it to a couple of servers I like.

Nice job, I tried doing this myself but failed :4chan:

Could you add this ?

“The title of a player is displayed in front of it’s name in chat, <title>Playername”

I would have to remake the chat box. And it would look shitty if the player had a long title.

Simple, but pretty nice. Might I suggest added a “shadow” to the text so it’s easier to read against certain backgrounds?

You’ll be surprised when you see my somewhat overcomplicated code.

Hm yes, the shadow is a good idea.

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]

And I said this is complicated when…? Seriously… Atleast give a working example before braging…

Is this admin only or can players set their own title? I want to be a dick with this. :v:

Edit:

Calm down, dude, he said it was simple. All he meant was that he could have simplified it even more if he tried. He said over-complicated. Not complicated.

Players can change their own title. But admins can change other players title. I’m going to make the first bit optional when I feel like working on it.

If an admin sets an players title, can the player just change it again?
The title the admin set should override, imo.

Good idea. I’ll add that.

But fun, hopefully he didn’t implement this atrociously.

I use the ‘Name Tag’ addon on my build server. It displays name, player status, avatar and team color. Very useful.

However, you cannot display your own message. So this thing is pretty cool.

where did you get the bots from?