Player::getWeaponAmmo

From RAGE Multiplayer Wiki
Revision as of 20:08, 13 October 2019 by Sakatum (talk | contribs) (Created page with "Get the ammo of the current weapon of the player. == Syntax == <pre> player.getWeaponAmmo(weaponHash); </pre> === Parameters === * '''weaponHash''': {{RageType|Int}} == Ex...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Get the ammo of the current weapon of the player.

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.");