General > Developers Corner
"Grabbing" the ulib groups
MrPresident:
You don't need to parse the ulib groups to do this. ULib automatically assigns groups to teams (or that might be ULX) either way, just try this...
--- Code: ---function ChatTags(ply, strText)
chat.AddText(Color(0,0,0,255), "[", team.GetName(ply:Team()), "]", team.GetColor(ply:Team()), ply:Nick(), Color(255,255,255,255), ": ", strText)
return true
end
hook.Add("OnPlayerChat", "Tags", ChatTags)
--- End code ---
my only concern is that since you are intercepting chat and returning another value with true will this not break all other chat hooks?
nevermind. This is the client version not the serverside version. The above code should work fine for what you need.
Bite That Apple:
Thank you Mr. President.
Also, thank you as well JamminR. :)
Karma for both of you.
Navigation
[0] Message Index
[*] Previous page
Go to full version