Player::getWeaponAmmo: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
 
Line 12: Line 12:
== Examples ==
== Examples ==


We get the ammo of the weapon you are using.
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.");