Squirrel/Server/Functions/Effects/CreateExplosion

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
Line 25: Line 25:
 
}
 
}
 
</code>
 
</code>
 +
 +
This will create an explosion 5 x co-ordinates away from the player, the type will be type 1.
  
 
=== Notes ===
 
=== Notes ===

Revision as of 01:21, 8 March 2010

This function creates an explosion in the given coordinates.

Syntax

  1. bool CreateExplosion( Vector vPos, int iExplosionType )
  1. bool CreateExplosion( float x, float y, float z, int iExplosionType )

Arguments

  • vPos - The position of the explosion as a vector
  • x, y, z - The coordinates of the wanted explosion as separate float values
  • iExplosionType - The explosion type

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "explosion" )
  5. {
  6. local pos = player.Pos;
  7. CreateExplosion( Vector( pos.x + 5, pos.y, pos.z ), 1 );
  8. }
  9. }
  10.  

This will create an explosion 5 x co-ordinates away from the player, the type will be type 1.

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