GM:ChatText

From Garry's Mod
Jump to: navigation, search
 GM:ChatText( )

Contents

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

number index

The index of the player.

Arguments

string name

The name of the player.

Arguments

string text

The text that is being sent.

Arguments

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

boolean

Return true to suppress the chat message

Examples

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 )


Personal tools
Navigation