Fire::addExplosion: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 31: Line 31:
let playerPos = mp.players.local.position;
let playerPos = mp.players.local.position;
// Creates a grenade explosion infront of the player.
// Creates a grenade explosion infront of the player.
mp.game.invoke("0xE3AD2BDBAEE269AC", playerPos.x + 3, playerPos.y + 3, playerPos.z, 0, 1.0, true, false, 0.5, false) // Last argument "nodamage" is not listed at nbase.
mp.game.invoke("0xE3AD2BDBAEE269AC", playerPos.x + 3, playerPos.y + 3, playerPos.z, 0, 0.9999, true, false, 0.5, false) // Last argument "nodamage" is not listed at nbase.


</syntaxhighlight>
</syntaxhighlight>

Revision as of 10:27, 1 November 2018

Creates an explosion at given coords. This function is missing last argument, so you cant create explosion with damage.

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);

Explosion with damage using natives

let playerPos = mp.players.local.position;
// Creates a grenade explosion infront of the player.
mp.game.invoke("0xE3AD2BDBAEE269AC", playerPos.x + 3, playerPos.y + 3, playerPos.z, 0, 0.9999, true, false, 0.5, false) // Last argument "nodamage" is not listed at nbase.

See also

Template:Fire s function c