Player::getWeaponAmmo: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Get the ammo of the current weapon of the player. == Syntax == <pre> player.getWeaponAmmo(weaponHash); </pre> === Parameters === * '''weaponHash''': {{RageType|Int}} == Ex...")
 
No edit summary
Line 1: Line 1:
Get the ammo of the current weapon of the player.
Get the weapon's ammo.


== Syntax ==
== Syntax ==

Revision as of 20:12, 13 October 2019

Get the weapon's ammo.

Syntax

player.getWeaponAmmo(weaponHash);

Parameters

  • weaponHash: Int

Examples

We obtain the ammo of our equipped weapon.

Server-Side
var weapon = player.weapon;
var ammo = player.getWeaponAmmo(weapon);
player.outputChatBox("The weapon has "+ammo+" bullets.");