Squirrel/Server/Functions/Effects/ExtinguishFire
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
|||
Line 1: | Line 1: | ||
− | + | {{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" ) | |
− | + | { | |
− | + | local pos = player.Pos; | |
− | + | ExtinguishFire( pos, 5.0 ); | |
− | + | } | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
− | |||
− | |||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] | + | 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
This function extinguishes fire at the given coordinates.
[edit] Syntax
bool ExtinguishFire( Vector vPos, float fRadius )
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'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "extinguish2" ) { local pos = player.Pos; ExtinguishFire( pos, 5.0 ); } return 1; }
[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
- CreateExplosion
- CreateFire
- ExtinguishFire
- ExtinguishAllFires