I run this on my own server, and decided it could be useful to a lot of people out there.
[U]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. [/U]
[IMG]http://puu.sh/9dQq5/e49005d030.jpg[/IMG]
[URL="https://www.dropbox.com/s/ewle7lw0o7o5nba/simple_chattags.zip"]CLICK TO DOWNLOAD[/URL]
[B]Install[/B]: Place chattags.lua in garrysmod/lua/autorun
[B]Creating Your Own Tag[/B]:
The code is fairly simple.
[IMG]http://puu.sh/9dQCr/140447abda.png[/IMG]
[lua]elseif ply:IsSuperAdmin() then
Tag = "(Superadmin)\t"
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.
[IMG]http://puu.sh/9dQX0/a43f15730d.png[/IMG]
Make sure they are all aligned and exact.
This website might be of some use to you while selecting colors: [url]http://www.colorcombos.com/colors/FFFFFF[/url]
MAKE SURE THE COLORS ARE IN RGB FORMAT.
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 [code]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"},
}[/code]
also, people can't message you, because you have it disabled :P
It would be more efficient to use a table. A whole lot more useful. Don't just use a bunch of elseifs.
[B]Edit:[/b]
Sniped. Damn you.
[QUOTE=Domos;44993400]It might be neater if you use ply:GetUserGroup() in conjunction with something like [code]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"},
}[/code]
also, people can't message you, because you have it disabled :P[/QUOTE]
Oh ok, let me enable that lol.
[editline]3rd June 2014[/editline]
[QUOTE=Nookyava;44993404]It would be more efficient to use a table. A whole lot more useful. Don't just use a bunch of elseifs.
[B]Edit:[/b]
Sniped. Damn you.[/QUOTE]
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.
[QUOTE=LoGiCKzZ;45159403]Where does this code go? Like which file.[/QUOTE]
Do you read? "Install: Place chattags.lua in garrysmod/lua/autorun"
[QUOTE=ds;45170055]Do you read? "Install: Place chattags.lua in garrysmod/lua/autorun"[/QUOTE]
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.
Sorry, you need to Log In to post a reply to this thread.