CreateExplosion
From Liberty Unleashed Wiki
This function creates an explosion in the given coordinates.
Syntax
bool CreateExplosion( Vector vPos, int iExplosionType )
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
This will create a type-1 explosion 5 x co-ordinate units away from the player.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "explosion" ) { local pos = player.Pos; pos.x += 5.0; CreateExplosion( pos, 1 ); CreateExplosion( pos, 2 ); CreateExplosion( pos, 3 ); CreateExplosion( pos, 4 ); CreateExplosion( pos, 5 ); CreateExplosion( pos, 6 ); CreateExplosion( pos, 7 ); CreateExplosion( pos, 8 ); CreateExplosion( pos, 9 ); CreateExplosion( pos, 10 ); } return 1; }
Notes
The function Player.Pos and call onPlayerCommand were used in this example. More info about them in the corresponding pages.
Related Functions
- CreateExplosion
- CreateFire
- ExtinguishFire
- ExtinguishAllFires