GetPlayerWeaponAmmo

From GT-MP
Jump to: navigation, search
GetPlayerWeaponAmmo
Server-Side Function
Utilities-terminal.png Server-Side Csharp.png C#

Returns the total amount of ammo the player has for the specific weapon.


Syntax

API.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 = API.getPlayerWeaponAmmo(player, WeaponHash.SMG);
player.sendChatMessage("You have " + ammoAmount + " bullets in your SMG.");


References