Fire::addExplosion: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
No edit summary
Line 1: Line 1:
BOOL isAudible = If explosion makes a sound.<br>BOOL isInvisible = If the explosion is invisible or not.<br><br>this native is missing a new argument: noDamage<br>nodamage = false: damage || nodamage = true: no damage<br><br>enum ExplosionTypes<br>{<br> EXPLOSION_GRENADE,<br> EXPLOSION_GRENADELAUNCHER,<br> EXPLOSION_STICKYBOMB,<br> EXPLOSION_MOLOTOV,<br> EXPLOSION_ROCKET,<br> EXPLOSION_TANKSHELL,<br> EXPLOSION_HI_OCTANE,<br> EXPLOSION_CAR,<br> EXPLOSION_PLANE,<br> EXPLOSION_PETROL_PUMP,<br> EXPLOSION_BIKE,<br> EXPLOSION_DIR_STEAM,<br> EXPLOSION_DIR_FLAME,<br> EXPLOSION_DIR_WATER_HYDRANT,<br> EXPLOSION_DIR_GAS_CANISTER,<br> EXPLOSION_BOAT,<br> EXPLOSION_SHIP_DESTROY,<br> EXPLOSION_TRUCK,<br> EXPLOSION_BULLET,<br> EXPLOSION_SMOKEGRENADELAUNCHER,<br> EXPLOSION_SMOKEGRENADE,<br> EXPLOSION_BZGAS,<br> EXPLOSION_FLARE,<br> EXPLOSION_GAS_CANISTER,<br> EXPLOSION_EXTINGUISHER,<br> EXPLOSION_PROGRAMMABLEAR,<br> EXPLOSION_TRAIN,<br> EXPLOSION_BARREL,<br> EXPLOSION_PROPANE,<br> EXPLOSION_BLIMP,<br> EXPLOSION_DIR_FLAME_EXPLODE,<br> EXPLOSION_TANKER,<br> EXPLOSION_PLANE_ROCKET,<br> EXPLOSION_VEHICLE_BULLET,<br> EXPLOSION_GAS_TANK,<br> EXPLOSION_BIRD_CRAP<br>};
__TOC__
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">mp.game.fire.addExplosion(x, y, z, explosionType, damageScale, isAudible, isInvisible, cameraShake);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.fire.addExplosion(x, y, z, explosionType, damageScale, isAudible, isInvisible, cameraShake);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''x:''' float
 
*'''y:''' float
*'''x: <font color='green'>float'''</font>
*'''z:''' float
*'''y: <font color='green'>float'''</font>
*'''explosionType:''' int
*'''z: <font color='green'>float'''</font>
*'''damageScale:''' float
*'''explosionType: <font color='red'>int'''</font>
*'''isAudible:''' Boolean
*'''damageScale: <font color='green'>float'''</font>
*'''isInvisible:''' Boolean
*'''isAudible: <font color='blue'>Boolean'''</font> (Trigger explosion sound)
*'''cameraShake:''' float
*'''isInvisible: <font color='blue'>Boolean'''</font> (Trigger visibility)
*'''cameraShake: <font color='green'>float'''</font>
 
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
let playerPos = mp.players.local.position;
// Creates a grenade explosion infront of the player.
mp.game.fire.addExplosion(playerPos.x + 3, playerPos.y + 3, playerPos.z, 0, 0, true, false, 0.5);
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Fire_s_function_c}}
{{Fire_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Revision as of 22:10, 28 September 2018

Syntax

mp.game.fire.addExplosion(x, y, z, explosionType, damageScale, isAudible, isInvisible, cameraShake);

Required Arguments

  • x: float
  • y: float
  • z: float
  • explosionType: int
  • damageScale: float
  • isAudible: Boolean (Trigger explosion sound)
  • isInvisible: Boolean (Trigger visibility)
  • cameraShake: float

Return value

  • Undefined

Example

let playerPos = mp.players.local.position;
// Creates a grenade explosion infront of the player.
mp.game.fire.addExplosion(playerPos.x + 3, playerPos.y + 3, playerPos.z, 0, 0, true, false, 0.5);

See also

Template:Fire s function c