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
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Get the ammo of the current weapon of the player.
Get the weapon's ammo.


== Syntax ==
== Syntax ==
Line 12: Line 12:
== Examples ==
== Examples ==


We obtain the ammo of our equipped weapon.
Get the ammo of the weapon you are using.


{{ServersideCode|
{{ServersideCode|

Latest revision as of 20:14, 13 October 2019

Get the weapon's ammo.

Syntax

player.getWeaponAmmo(weaponHash);

Parameters

  • weaponHash: Int

Examples

Get the ammo of the weapon you are using.

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