how to add tags to chat?

how to add tags to chat?


(Owner) Victi: hello

You need to use the PlayerSay hook, then a usermessage to send the text, player and rank to clients. When the usermessage is recieved, use chat.AddText to display it in the chat.

It’s how I did it anyway :slight_smile:

You can do it completely client side as well.

I got it working but…

i will have it like the picture shows

The code

function Said( ply, text, toall )
if ply:IsSuperAdmin() then
return "(Owner)" .. text

hook.Add( "PlayerSay", "Said", Said )

local function OnPlayerChat( pl, text )

if( !pl:IsSuperAdmin( ) ) then return; end

local clr = team.GetColor( pl:Team( ) );
chat.AddText( clr, pl:Name( ), clr, " (Owner)", color_white, ": "..text );

return true;

hook.Add( “OnPlayerChat”, “AddOwnerTag”, OnPlayerChat );

Is returning true necessary Nevec? If he had any other stuff using OnPlayerChat it would break it, if you return anything with that hook.

To override the original message, yes.

it don’t works

i just get a normal chat tag :confused:


Got it Working :wink:


Oh, duh.

Works perfectly for me. Thanks Nevec.

How did you get it too work? I get the time when i change it to what nevec said.

I got it, wonder if you could also draw an image instead of some text.

can you paste the code you used?

Mine is just a time.

Broke for me, when I tried adding more then one group. Hehe.

Gonna figure this out.


Can’t really get clients to see it, maybe I just gotta slap it in the gamemode lua.


Only works with the person who is actually in that group (Admin, SuperAdmin) however regular clients or people below that class can not see that next to the actual persons name.