Squirrel/Server/Functions/Effects/CreateExplosion

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 27: Line 27:
 
            
 
            
 
           CreateExplosion( pos, 1 );
 
           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 );
 
     }
 
     }
 
      
 
      

Latest revision as of 14:46, 10 August 2013

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function creates an explosion in the given coordinates.

[edit] Syntax

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

[edit] 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

[edit] Example

This will create a type-1 explosion 5 x co-ordinate units away from the player.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "explosion" )
  5. {
  6. local pos = player.Pos;
  7. pos.x += 5.0;
  8. CreateExplosion( pos, 1 );
  9. CreateExplosion( pos, 2 );
  10. CreateExplosion( pos, 3 );
  11. CreateExplosion( pos, 4 );
  12. CreateExplosion( pos, 5 );
  13. CreateExplosion( pos, 6 );
  14. CreateExplosion( pos, 7 );
  15. CreateExplosion( pos, 8 );
  16. CreateExplosion( pos, 9 );
  17. CreateExplosion( pos, 10 );
  18. }
  19. return 1;
  20. }
  21.  

[edit] Notes

The function Player.Pos and call onPlayerCommand were used in this example. More info about them in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox