Customizable Chat Tags

I run this on my own server, and decided it could be useful to a lot of people out there.

Why use this addon? I already created it for ULX groups, with colors, and you can create your very own chat tags, correlating with a ULX group.


Install: Place chattags.lua in garrysmod/lua/autorun

Creating Your Own Tag:

The code is fairly simple.

[lua]elseif ply:IsSuperAdmin() then
Tag = "(Superadmin) "
R = 255
G = 0
B = 0[/lua]

This code is telling us that if that the player (ply) is SuperAdmin then, the tag will be (Superadmin). R G B are the colors.
R = Red (0 - 255)
G = Green (0 - 255)
B = Blue (0 - 255

Replace ply:Is(ULX GROUP HERE)() and then Edit the tag in the parenthesis.

Place the line of code in between these.

Make sure they are all aligned and exact.

This website might be of some use to you while selecting colors:

If you have any questions, ask away. If I don’t answer you, then message me.

It might be neater if you use ply:GetUserGroup() in conjunction with something like

local Ranks = {
["Owner"] = {color = Color(142, 202, 209), text = "Owner"},
["superadmin"] = {color = Color(193, 83, 237), text = "S. Admin"},
["admin"] = {color = Color(0, 57, 158), text = "Admin"},
["mod"] = {color = Color(0, 141, 160), text = "Mod"},
["Trial-Mod"] = {color = Color(0, 155, 127), text = "Trial Mod"},
["VIPPlus"] = {color = Color(247, 28, 255), text = "VIP +"},
["VIP"] = {color = Color(251, 145, 255), text = "VIP"},
["trusted"] = {color = Color(42, 168, 0), text = "Trusted"},
["regular"] = {color = Color(201, 201, 201), text = "Regular"},

also, people can’t message you, because you have it disabled :stuck_out_tongue:

It would be more efficient to use a table. A whole lot more useful. Don’t just use a bunch of elseifs.


Sniped. Damn you.

Oh ok, let me enable that lol.

[editline]3rd June 2014[/editline]

This was something I dug out of my old server files, something I coded awhile ago. I’m not a professional lua coder at all, so I will try it with tables.

Where does this code go? Like which file.

Do you read? “Install: Place chattags.lua in garrysmod/lua/autorun”

Sorry I am on my phone. I appreciate it though.

Why is there such a big space between the rank and name thats what bothers me.