Weapon.Clip2

From GMod Wiki

Jump to: navigation, search


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: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Weapon.Clip2]Weapon.Clip2 [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDefinition of SWEP.TakeSecondaryAmmo
Used onNewerShared.png
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
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox