It doesn't. I managed to find some code though that is better. It's easy to convert the (IsAdmin) to ply:IsUserGroup()
However, since i'm running an RP server, the chat functions differently and it ends up duplicating the text like it was sandbox but with the tag only appears on the second 1.
Example:
(OOC) Strategos: test
[Owner] Strategos: test
Below, is the raw, unedited code (thanks to "science" for releasing it!)
if SERVER then
hook.Add( "PlayerSay", "Tags", function(ply, text, team)
local rank
if ply:IsSuperAdmin() then
rank = "Superadmin"
elseif ply:IsAdmin() then
rank = "Admin"
else
rank = "User"
end
umsg.Start("_Tagsay")
umsg.String(text)
umsg.String(rank)
umsg.Entity(ply)
umsg.End()
return false
end)
end
if CLIENT then
usermessage.Hook("_Tagsay", function (um)
local text = um:ReadString()
local rank = um:ReadString() or "User"
local ply = um:ReadEntity()
if !rank or !text or !ply then return end
ChatAdd(rank,text, ply)
end)
function ChatAdd(rank, text, ply)
chat.AddText("",Color(255,125,0),"[",Color(125,0,0),rank,Color(255,125,0),"] ",Color(0,125,25),ply:Nick()..": ",Color(255,255,255),text)
end
Maybe you guys would know how to make it affective in /ooc chat (and all) and stop it from duplicating.