Squirrel/Server/Events/Misc/onConsoleInput

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Added argument types)
m
Line 30: Line 30:
 
=== Notes ===
 
=== Notes ===
  
The function [[Squirrel/Server/Functions/Game/SetGravity|SetGravity]] was used in in this example. More info about this in the corresponding page.
+
The function [[Squirrel/Server/Functions/Game/SetGravity|SetGravity]] was used in this example. More info about this in the corresponding page.
  
 
== Related Events ==
 
== Related Events ==
  
 
{{Squirrel/Server/Events/Misc}}
 
{{Squirrel/Server/Events/Misc}}

Revision as of 12:43, 11 November 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This is called when text is typed to the server console.

Syntax

  1. function onConsoleInput( string cmd, string text )

Arguments

  • cmd - This is the command typed to the console
  • text - These are the additional parameters for the command

Returns

This event does not handle return values.

Example

This example changes the server's gravity setting when someone types 'setgrav 0.001' into the server console.

  1.  
  2. function onConsoleInput( cmd, text )
  3. {
  4. if ( cmd == "setgrav" ) SetGravity( text.tofloat() );
  5. return 1;
  6. }
  7.  

Notes

The function SetGravity was used in this example. More info about this in the corresponding page.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox