Garry's Mod Wiki

Player:GetAmmo

table Player:GetAmmo()

Description

Returns a table of all ammo the player has.

Returns

1 table
number Key: AmmoID to be used with functions like game.GetAmmoName. number Value: Amount of ammo the player has of this kind.

Example

Output ammo table of the default Sandbox weapon loadout.

PrintTable(player.GetByID(1):GetAmmo())
Output:
1 = 130 2 = 6 3 = 256 4 = 256 5 = 32 6 = 36 7 = 64 8 = 3 10 = 6

Page Links


Special Pages


Wikis

?

Render Time: 23ms

Session 0
DB GetPage 3
Generate Html 2
SaveChanges 11
Render Body 0
Render Sidebar 5