GetPlayerWeaponAmmo

From RAGE Multiplayer Wiki
Revision as of 13:28, 27 November 2019 by Muphy (talk | contribs) (Created page with "Returns the amount of ammo in the weapon of the player. ==Syntax== <syntaxhighlight lang="C#">int NAPI.Player.GetPlayerWeaponAmmo(Client player, WeaponHash weapon);</syntaxhi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Syntax

int NAPI.Player.GetPlayerWeaponAmmo(Client player, WeaponHash weapon);

Required Arguments

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

NOTE: This function returns data in int type.

Usage example(s)

int ammoAmount = NAPI.Player.GetPlayerWeaponAmmo(player, WeaponHash.SMG);
player.sendChatMessage("You have " + ammoAmount + " bullets in your SMG.");