Garry's Mod Wiki

GM:ChatText

boolean GM:ChatText( number index, string name, string text, string type )

Description

Called when a message is printed to the chat box. Note, that this isn't working with player messages even though there are arguments for it.

For player messages see GM:PlayerSay and GM:OnPlayerChat

Arguments

1 number index
The index of the player.
2 string name
The name of the player.
3 string text
The text that is being sent.
4 string type
Chat filter type. Possible values are:

  • joinleave - Player join and leave messages
  • namechange - Player name change messages
  • servermsg - Server messages such as convar changes
  • teamchange - Team changes?
  • chat - (Obsolete?) Player chat?
  • none - A fallback value

Returns

1 boolean
Return true to suppress the chat message

Example

Hides default join and leave messages in chat.

hook.Add( "ChatText", "hide_joinleave", function( index, name, text, typ ) if ( typ == "joinleave" ) then return true end end )

Page Links


Special Pages


Wikis

?

Render Time: 25ms

Session 0
DB GetPage 3
Generate Html 2
SaveChanges 12
Render Body 0
Render Sidebar 6