Gamemode.ChatTextChanged

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameChatTextChanged
SyntaxGM:ChatTextChanged( String text )
DescriptionCalled whenever the content of the user's chat input box is changed.
ReturnsNil
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.ChatTextChanged]Gamemode.ChatTextChanged [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints the content of the user's chat input box whenever it changes.
Used onNewerClient.png
Code
 
// The event function
function chatTextChangedHook( text )
	print("Your chat input box now contains: '"..text.."'")
end
// Hook the event.
hook.Add( "ChatTextChanged", "ChatTextChangedHook", chatTextChangedHook );
 
OutputPrints the content of the user's chat input box whenever it changes.
 
Your chat input box now contains: ''
Your chat input box now contains: ''
Your chat input box now contains: 'H'
Your chat input box now contains: 'H'
Your chat input box now contains: 'He'
Your chat input box now contains: 'He'
Your chat input box now contains: 'Hel'
Your chat input box now contains: 'Hel'
Your chat input box now contains: 'Hell'
Your chat input box now contains: 'Hell'
Your chat input box now contains: 'Hello'
Your chat input box now contains: 'Hello'
Your chat input box now contains: 'Hello'
Your chat input box now contains: 'Hello!'
Your chat input box now contains: ''
Prometheus: Hello!
 


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox