Squirrel/Server/Events/Misc/onConsoleInput
From Liberty Unleashed Wiki
(Difference between revisions)
m |
(→Example) |
||
Line 25: | Line 25: | ||
return 1; | return 1; | ||
− | } | + | }</code> |
− | </code> | + | |
=== Notes === | === Notes === |
Latest revision as of 14:18, 27 July 2012
This is called when text is typed to the server console.
[edit] Syntax
function onConsoleInput( string cmd, string text )
[edit] Arguments
- cmd - This is the command typed to the console
- text - These are the additional parameters for the command
[edit] Returns
This event does not handle return values.
[edit] Example
This example changes the server's gravity setting when someone types 'setgrav 0.001' into the server console.
function onConsoleInput( cmd, text ) { if ( cmd == "setgrav" ) SetGravity( text.tofloat() ); return 1; }
[edit] Notes
The function SetGravity was used in this example. More info about this in the corresponding page.
[edit] Related Events
- onConsoleInput
- onScriptLoad
- onScriptUnload
- onServerStart