Vehicle.SetEngineState

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function starts or stops the engine of the given vehicle.

Syntax

  1. bool Vehicle.SetEngineState( bool started )

Arguments

  • started - A bool representing whether the engine should be started or stopped

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "stopengine" )
  5. {
  6. if ( player.Vehicle ) player.Vehicle.SetEngineState( false );
  7. }
  8. }
  9.  

This command will stop the vehicle the player is currently driving.

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox