Garry's Mod Wiki

Revision Difference

WEAPON:CanSecondaryAttack#553199

<function name="CanSecondaryAttack" parent="WEAPON" type="hook"> <ishook>yes</ishook>⤶ <description>Helper function for checking for no ammo.</description> <realm>Shared</realm> <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>