Weapon/Clip2

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Fix typo)
 
Line 11: Line 11:
 
}}
 
}}
 
{{Example
 
{{Example
|Description=Prints the amount of seconday ammo in the magazine of the weapon the 1st player has equipped.
+
|Description=Prints the amount of secondary ammo in the magazine of the weapon the 1st player has equipped.
 
|Code=print( player.GetByID( 1 ):GetActiveWeapon():Clip2() )
 
|Code=print( player.GetByID( 1 ):GetActiveWeapon():Clip2() )
 
|Output=Will print -1 for all HL2 weapons.
 
|Output=Will print -1 for all HL2 weapons.
 
}}
 
}}

Latest revision as of 21:04, 4 November 2019

 Weapon:Clip2( )

Contents

Description

Returns how much secondary ammo is in magazine.

Returns

number

The amount of secondary ammo in the magazine.

Examples

Example

Prints the amount of secondary ammo in the magazine of the weapon the 1st player has equipped.

print( player.GetByID( 1 ):GetActiveWeapon():Clip2() )

Output:

Will print -1 for all HL2 weapons.
Personal tools
Navigation