Player/GetAmmo

From Garry's Mod
Jump to: navigation, search
 Player:GetAmmo( )

Contents

Description

Returns a table of all ammo the player has.

Returns

table

number Key: AmmoID to be used with functions like game.GetAmmoName.

number Value: Amount of ammo the player has of this kind.

Examples

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
Personal tools
Navigation