Перейти к содержанию

Player::taskPlantBomb

Материал из RAGE MP Wiki Archive

This function plays a planting bomb animation and plants a bomb in heading target location, you need to have the bomb equiped in your hands to work, otherwise nothing happens.

Syntax

<syntaxhighlight lang="javascript">player.taskPlantBomb(x, y, z, heading);</syntaxhighlight>

Required Arguments

  • x: float
  • y: float
  • z: float
  • heading: float

Return value

  • Undefined

Example

In the example below the player will plant when the X key is pressed: <syntaxhighlight lang="javascript"> mp.keys.bind(88, false, () => {

 if (mp.players.local.weapon != mp.game.joaat('weapon_stickybomb'))
   return mp.gui.chat.push(`You need a sticky bomb to use planting feature!`);
 const { x, y, z } = mp.players.local.position;
 mp.players.local.taskPlantBomb(x, y, z, mp.players.local.heading);

}); </syntaxhighlight>

See also