Revision Difference
WEAPON:CanSecondaryAttack#565031
<function name="CanSecondaryAttack" parent="WEAPON" type="hook">
	<description>Helper function for checking for no ammo.</description>
	<realm>Shared</realm>
	<file line="219-L231">gamemodes/base/entities/weapons/weapon_base/shared.lua</file>⤶
	<rets>
		<ret name="" type="boolean">Can use secondary attack</ret>
	</rets>
</function>⤶
⤶
<example>⤶
	<description>As defined in weapon_base</description>⤶
	<code>⤶
function SWEP:CanSecondaryAttack()⤶
⤶
	if ( self:Clip2() <= 0 ) then⤶
	⤶
		self:EmitSound( "Weapon_Pistol.Empty" )⤶
		self:SetNextSecondaryFire( CurTime() + 0.2 )⤶
		return false⤶
		⤶
	end⤶
⤶
	return true⤶
⤶
end⤶
	</code>⤶
⤶
</example></function>
			Garry's Mod 
		
			Rust 
		
			Steamworks 
		
			Wiki Help