Squirrel/Server/Functions/Effects/CreateFire
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function creates an scripted fire at the given coordinates. == Syntax == <code>bool CreateFire( Vector vPos, float fRadius )</code> <code>bool CreateFire( float x, float y...) |
|||
Line 14: | Line 14: | ||
== Example == | == Example == | ||
− | |||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( player, cmd, text ) | |
+ | { | ||
+ | if ( cmd == "fire" ) | ||
+ | { | ||
+ | local pos = player.Pos; | ||
+ | CreateFire( Vector( pos.x + 5, pos.y, pos.z ), 5.00 ); | ||
+ | } | ||
+ | } | ||
</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:11, 8 March 2010
This function creates an scripted fire at the given coordinates.
Syntax
bool CreateFire( Vector vPos, float fRadius )
bool CreateFire( float x, float y, float z, float fRadius )
Arguments
- vPos - The position of the script fire as a vector
- x, y, z - The coordinates of the fire as separate float values
- fRadius - The radius of the fire
Example
function onPlayerCommand( player, cmd, text ) { if ( cmd == "fire" ) { local pos = player.Pos; CreateFire( Vector( pos.x + 5, pos.y, pos.z ), 5.00 ); } }
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
Related Functions
- CreateExplosion
- CreateFire
- ExtinguishFire
- ExtinguishAllFires