Squirrel/Server/Functions/Effects/CreateExplosion
From Liberty Unleashed Wiki
(Difference between revisions)
(→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
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
function onPlayerCommand( player, cmd, text ) { if ( cmd == "explosion" ) { local pos = player.Pos; CreateExplosion( Vector( pos.x + 5, pos.y, pos.z ), 1 ); } }
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
- CreateExplosion
- CreateFire
- ExtinguishFire
- ExtinguishAllFires