Squirrel/Server/Functions/Effects/CreateExplosion
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function creates an explosion in the given coordinates. == Syntax == <code>bool CreateExplosion( Vector vPos, int iExplosionType )</code> <code>bool CreateExplosion( float...) |
|||
Line 15: | Line 15: | ||
== Example == | == Example == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( player, cmd, text ) | |
+ | { | ||
+ | if ( cmd == "explosion" ) | ||
+ | { | ||
+ | local pos = player.Pos; | ||
+ | CreateExplosion( Vector( pos.x + 5, pos.y, pos.z ), 1 ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Effects}} | {{Squirrel/Server/Functions/Effects}} |
Revision as of 01:10, 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 ); } }
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
Related Functions
- CreateExplosion
- CreateFire
- ExtinguishFire
- ExtinguishAllFires