Player::allWeapons

From RAGE Multiplayer Wiki
Revision as of 23:36, 26 December 2020 by Idle (talk | contribs) (Created page with "Gets the players weapon's hash and ammo == Syntax == <pre> Object player.allWeapons; </pre> ==Examples== It will show your weapon's hash and ammo {{ServersideCode| <pre> mp....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Gets the players weapon's hash and ammo

Syntax

Object player.allWeapons;

Examples

It will show your weapon's hash and ammo

Server-Side
mp.events.addCommand('weapons', (player) => {
  const weapons = player.allWeapons;
  for (let key in weapons) {
    player.notify(`Hash: ${key}, ammo: ${weapons[key]}`);
  }
});

See Also