Fire::startScriptFire: Difference between revisions
m ("TODO: Example" category no longer needed.) |
|||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
Starts a fire:<br><br>xyz: Location of fire<br>maxChildren: The max amount of times a fire can spread to other objects. Must be 25 or less, or the function will do nothing.<br>isGasFire: Whether or not the fire is powered by gasoline. | Starts a fire:<br><br>xyz: Location of fire<br>maxChildren: The max amount of times a fire can spread to other objects. Must be 25 or less, or the function will do nothing.<br>isGasFire: Whether or not the fire is powered by gasoline. | ||
==Syntax== | ==Syntax== | ||
< | <pre> | ||
mp.game.fire.startScriptFire(X, Y, Z, maxChildren, isGasFire); | |||
</pre> | |||
=== Required Arguments === | === Required Arguments === | ||
*'''X:''' float | *'''X:''' float | ||
| Line 8: | Line 12: | ||
*'''maxChildren:''' int | *'''maxChildren:''' int | ||
*'''isGasFire:''' Boolean | *'''isGasFire:''' Boolean | ||
===Return value=== | ===Return value=== | ||
*'''int''' | *'''int''' | ||
==Example== | ==Example== | ||
< | {{ClientsideCode| | ||
<pre> | |||
mp.events.add('StartFire', (posX, posY, posZ, maxChildren, isGasFire) => { | |||
mp.events.add('StartFire', (posX, posY, posZ, | // The fireId is a int | ||
let fireId = mp.game.fire.startScriptFire(posX, posY, posZ, maxChildren, isGasFire); | |||
// The fireId is a int | |||
let fireId = mp.game.fire.startScriptFire(posX, posY, posZ, | |||
}); | }); | ||
</ | </pre> | ||
}} | |||
==See also== | ==See also== | ||
{{Fire_s_function_c}} | {{Fire_s_function_c}} | ||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
Latest revision as of 04:06, 28 September 2021
Starts a fire:
xyz: Location of fire
maxChildren: The max amount of times a fire can spread to other objects. Must be 25 or less, or the function will do nothing.
isGasFire: Whether or not the fire is powered by gasoline.
Syntax
mp.game.fire.startScriptFire(X, Y, Z, maxChildren, isGasFire);
Required Arguments
- X: float
- Y: float
- Z: float
- maxChildren: int
- isGasFire: Boolean
Return value
- int
Example
Client-Side
mp.events.add('StartFire', (posX, posY, posZ, maxChildren, isGasFire) => {
// The fireId is a int
let fireId = mp.game.fire.startScriptFire(posX, posY, posZ, maxChildren, isGasFire);
});