• Help with making my chat tags
    2 replies, posted
[LUA]function ChatTags () local ply = LocalPlayer() local SUPERADMIN = "" local msg = "" if ply:IsUserGroup("superadmin") and ply:SteamID = "STEAM_0:0:41782485" then chat.AddText ( "(SUPERADMIN)" .. ply:Nick() .. msg ) return true end end hook.Add("OnPlayerChat", "Tags", ChatTags) [/LUA] The thing is it works, it does the SUPERADMIN title but it says my name afterwards but no text like the text I write in chat doesn't come after, and why is it doing it for everybody T_T, I know you guys are gonna tell me go to learn LUA, but please help me out, I tried my best I'm getting a massive headache, so please help me out. Thank you.
You are not using the OnPlayerChat function's arguments. Ply will not be LocalPlayer() on a server. [url]http://wiki.garrysmod.com/page/GM/OnPlayerChat[/url] I don't know why you would expect the message to be added to the chat when you set message to a blank string.
[QUOTE=Bletotum;42028350]You are not using the OnPlayerChat function's arguments. Ply will not be LocalPlayer() on a server. [url]http://wiki.garrysmod.com/page/GM/OnPlayerChat[/url] I don't know why you would expect the message to be added to the chat when you set message to a blank string.[/QUOTE] May you give me an example? I can't figure this out.
Sorry, you need to Log In to post a reply to this thread.