Squirrel/Server/Functions/Effects/CreateExplosion

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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 ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
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 ===
  
-- Example notes here
+
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

  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.  

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