WEAPON:CanSecondaryAttack

From Garry's Mod
Jump to: navigation, search
 WEAPON:CanSecondaryAttack( )

Contents

Description

Helper function for checking for no ammo.

Returns

boolean

Can use secondary attack

Examples

Example

As defined in weapon_base

function SWEP:CanSecondaryAttack()

	if ( self.Weapon:Clip2() <= 0 ) then
	
		self.Weapon:EmitSound( "Weapon_Pistol.Empty" )
		self.Weapon:SetNextSecondaryFire( CurTime() + 0.2 )
		return false
		
	end

	return true

end


Personal tools
Navigation