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

GetPlayerWeaponAmmo

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

Returns the amount of ammo in the weapon of the player.

Syntax

<syntaxhighlight lang="C#">int NAPI.Player.GetPlayerWeaponAmmo(Player player, WeaponHash weapon);</syntaxhighlight>

Required Arguments

  • player: parameter input should be in Player type.
  • weapon: parameter input should be in WeaponHash type.

NOTE: This function returns data in int type.

Usage example(s)

<syntaxhighlight lang="C#" > int ammoAmount = NAPI.Player.GetPlayerWeaponAmmo(player, WeaponHash.SMG); player.sendChatMessage("You have " + ammoAmount + " bullets in your SMG."); </syntaxhighlight>