Chat Tags For Admins

I Want to add chat tags for admins
example:


[ADMIN]DaRkWoRlD: 1234

I want to learn lua :eng101:

Use this: http://wiki.garrysmod.com/page/GM/OnPlayerChat obviously with a hook

This should work:
[lua]
function RankBeforeChat( player, strText, bTeamOnly, bPlayerIsDead )
chat.AddText( “[”…player:GetNWString(“usergroup”)…"]",player, Color( 255, 255, 255 ), ": ", strText )
return true
end
hook.Add(“OnPlayerChat”, “RankBeforeChat”, RankBeforeChat)
[/lua]

Thanks!

Where do I put this code in? I put it in garrysmod -> lua -> autorun -> server
And it’s not wroking…

It’s a client side hook, so guess where you need to place it.

its clientside :smiley:
place in
garrysmod/lua/autorun/client