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

GivePlayerWeapon

Материал из RAGE MP Wiki Archive
Версия от 21:51, 22 декабря 2022; imported>Xabi
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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

Syntax

<syntaxhighlight lang="C#">void NAPI.Player.GivePlayerWeapon(Player player, WeaponHash weaponHash, int ammo);</syntaxhighlight>

  • player: parameter input should be in Player 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)

<syntaxhighlight lang="C#"> // Use as: /weapon smg [Command("weapon")] public void WeaponCommand(Player sender, WeaponHash hash) {

 NAPI.Player.GivePlayerWeapon(sender, hash, 500);

} </syntaxhighlight>