OutputConsole: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 10: | Line 10: | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
*'''visibleTo:''' This specifies who the chat is visible to. Any players in this element will see the chat message. See [[visibility]]. | *'''visibleTo:''' This specifies who the chat is visible to. Any players in this element will see the chat message. See [[visibility]]. | ||
Note: '''visibleTo''' can also be a Team object, in this case, the text will be visible to all the players of that team. | |||
==Example== | ==Example== |
Revision as of 14:26, 16 August 2006
This outputs the specified text string to the console window (accessed with F8 or ~ key). It can be specified as a message to certain player(s) or all players.
Syntax
bool outputConsole ( string text, [ element visibleTo=getrootelement() ] )
Required Arguments
- text: The text string that you wish to send to the console window
Optional Arguments
- visibleTo: This specifies who the chat is visible to. Any players in this element will see the chat message. See visibility.
Note: visibleTo can also be a Team object, in this case, the text will be visible to all the players of that team.
Example
root = getRootElement () addCommandHandler ( "onPlayerConsole", root, "onConsole" ) function onConsole ( message ) local command = gettok(message, 1, 32) --The varible "command" equals text a player types in the console if (command == "!public") then --If players typed text equals !public outputChatBox ( "Public console message" ) --Display console message to all players elseif (command == "!private") then --If players typed text equals !private outputChatBox ( "Private console message", source ) --Send message to whoever entered the text !private end end
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown