Squirrel/Server/Functions/Effects/ExtinguishFire

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|ExtinguishFire}}
 
This function extinguishes fire at the given coordinates.
 
This function extinguishes fire at the given coordinates.
  
Line 11: Line 11:
 
* '''vPos''' - The position where the fire should be extinguished
 
* '''vPos''' - The position where the fire should be extinguished
 
* '''x''', '''y''', '''z''' -  The coordinates of the position to be extinguished as separate float values
 
* '''x''', '''y''', '''z''' -  The coordinates of the position to be extinguished as separate float values
* '''fRadius''' - The radius which should be extinguished
+
* '''fRadius''' - The radius of the area which should be extinguished
  
 
== Example ==
 
== Example ==
 +
 +
This will extinguish all fires within a 5.0 radius from the player when they type '/extinguish2'.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( player, cmd, text )
 
function onPlayerCommand( player, cmd, text )
 
{
 
{
if ( cmd == "extinguish2" )  
+
    if ( cmd == "extinguish2" )  
{
+
    {
local pos = player.Pos;
+
          local pos = player.Pos;
ExtinguishFire( Vector( pos.x + 5, pos.y, pos.z, 5.00 )
+
          ExtinguishFire( pos, 5.0 );
}
+
    }
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
 
This will extinguish all fires that are 5 x co-ordinates away from the player, with a 5.00 radius.
 
  
 
=== Notes ===
 
=== Notes ===
  
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page.
+
The function [[Squirrel/Server/Functions/Players/Pos|Player.Pos]] and call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Effects}}
 
{{Squirrel/Server/Functions/Effects}}

Latest revision as of 04:17, 25 September 2010

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

This function extinguishes fire at the given coordinates.

[edit] Syntax

  1. bool ExtinguishFire( Vector vPos, float fRadius )
  1. bool ExtinguishFire( float x, float y, float z, float fRadius )

[edit] Arguments

  • vPos - The position where the fire should be extinguished
  • x, y, z - The coordinates of the position to be extinguished as separate float values
  • fRadius - The radius of the area which should be extinguished

[edit] Example

This will extinguish all fires within a 5.0 radius from the player when they type '/extinguish2'.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "extinguish2" )
  5. {
  6. local pos = player.Pos;
  7. ExtinguishFire( pos, 5.0 );
  8. }
  9. return 1;
  10. }
  11.  

[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