GetPlayerWeaponAmmo: Difference between revisions
(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...") |
No edit summary |
||
| Line 2: | Line 2: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="C#">int NAPI.Player.GetPlayerWeaponAmmo( | <syntaxhighlight lang="C#">int NAPI.Player.GetPlayerWeaponAmmo(Player player, WeaponHash weapon);</syntaxhighlight> | ||
'''Required Arguments''' | '''Required Arguments''' | ||
*'''player:''' parameter input should be in ''' | *'''player:''' parameter input should be in '''Player''' type. | ||
*'''weapon:''' parameter input should be in '''WeaponHash''' type. | *'''weapon:''' parameter input should be in '''WeaponHash''' type. | ||
Latest revision as of 21:51, 22 December 2022
Returns the amount of ammo in the weapon of the player.
Syntax
int NAPI.Player.GetPlayerWeaponAmmo(Player player, WeaponHash weapon);
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)
int ammoAmount = NAPI.Player.GetPlayerWeaponAmmo(player, WeaponHash.SMG);
player.sendChatMessage("You have " + ammoAmount + " bullets in your SMG.");