Gamemode.ChatText

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameChatText
SyntaxGM:ChatText( Integer playerindex, String playername, String text, String messagetype )
DescriptionCalled when a message is printed to the chat box.
ReturnsNil
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.ChatText]Gamemode.ChatText [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionTells the player what a player said
Used onNewerClient.png
Code
 
// The event function
function chatTextHook( playerindex, playername, text, messagetype )
	print(playername .. " said: '" .. text .. "'.");
end
// Hook the event.
hook.Add( "ChatText", "ChatTextHook", chatTextHook );
OutputPrints what a player said to their console.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox