GivePlayerWeapon

From RAGE Multiplayer Wiki
Revision as of 13:30, 27 November 2019 by Muphy (talk | contribs) (Created page with "Gives the given player a weapon of the given type. See also Weapons Models. ==Syntax== <syntaxhighlight lang="C#">void NAPI.Player.GivePlayerWeapon(Client player, WeaponH...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Gives the given player a weapon of the given type. See also Weapons Models.

Syntax

void NAPI.Player.GivePlayerWeapon(Client player, WeaponHash weaponHash, int ammo);
  • player: parameter input should be in Client type.
  • weaponHash: parameter input should be in WeaponHash type.
  • ammo: parameter input should be in int type.

Note: All the weapons in a slot share the same ammo.

Usage example(s)

// Use as: /weapon smg
[Command("weapon")]
public void WeaponCommand(Client sender, WeaponHash hash)
{
  NAPI.Player.GivePlayerWeapon(sender, hash, 500);
}