Scripting/Squirrel/Events/Misc/onConsoleInput

From VC-MP Wiki

Jump to: navigation, search

This event is called when someone types to the server console.

Syntax

function onConsoleInput( cmd, text )

Parameters

  • cmd - This is the command typed in
  • text - These are the additional command parameters

Example

This example will change the server weather when someone types 'setweather 4' into the console.

function onConsoleInput( cmd, text )
{
     if ( cmd == "setweather" ) SetWeather( text.tointeger() );
}

Notes

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

Related Events

Personal tools
squirrel scripting