Squirrel/Server/Functions/Vehicles/Explode

From Liberty Unleashed Wiki
Revision as of 14:32, 8 March 2010 by Force (Talk | contribs)

Jump to: navigation, search

This function explodes the given vehicle instantly. Note that you need to input a player who 'caused' the explosion.

Syntax

  1. bool Vehicle.Explode( Player responsible )

Arguments

  • responsible - This is a pointer to the player who was responsible for the destruction of the vehicle

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "explode" )
  5. {
  6. local veh = player.Vehicle;
  7. if ( veh ) veh.Explode( player );
  8. }
  9. }
  10.  

This command will explode the vehicle that the player is currently in, they will be the cause of the explosion.

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