Weapon.Clip2
From GMod Wiki
Function | |
Syntax | Weapon:Clip2( ) |
Description: | |
Returns the number of bullets in the secondary fire's clip. Returns -1 if the weapon doesn't have a secondary fire, or if it doesn't take ammo. | |
Returns: | Integer |
In Object: | Weapon |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Weapon.Clip2]Weapon.Clip2 [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Definition of SWEP.TakeSecondaryAmmo |
---|---|
Used on | |
Code | function SWEP:TakeSecondaryAmmo( num ) // Doesn't use clips if ( self:Clip2() <= 0 ) then if ( self:Ammo2() <= 0 ) then return end self.Owner:RemoveAmmo( num, self:GetSecondaryAmmoType() ) return end self:SetClip2( self:Clip2() - num ) end |
Output | N/A |
Additional Notes
- Because it is already used by several convenience functions, it is rarely used directly.