Vehicle.Explode

From Liberty Unleashed Wiki
Revision as of 05:16, 25 September 2010 by Juppi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function explodes the given vehicle instantly. Note that you need to include 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

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

  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. return 1;
  10. }
  11.  

Notes

The function Player.Vehicle and call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox