Player::giveWeapon

From RAGE Multiplayer Wiki
Revision as of 16:48, 4 January 2017 by Niks (talk | contribs)

This function gives a weapon for the player.

Syntax

player.giveWeapon(Number/Array weaponHash, Number ammo)

Example

Example 1. This example gives 1 weapon for player.

mp.events.add('playerCommand', (player, command) => {
  let arr = command.split(' ');
  if (arr[0] == 'weapon') {
    player.giveWeapon(3220176749, 1000); // Assault Rifle
  }
});