Revision Difference
WEAPON:CanPrimaryAttack#565030
<function name="CanPrimaryAttack" parent="WEAPON" type="hook">
<description>Helper function for checking for no ammo.</description>
<realm>Shared</realm>
<file line="200-L213">gamemodes/base/entities/weapons/weapon_base/shared.lua</file>⤶
<rets>
<ret name="" type="boolean">Can use primary attack</ret>
</rets>
</function>⤶
⤶
<example>⤶
<description>As defined in weapon_base</description>⤶
<code>⤶
function SWEP:CanPrimaryAttack()⤶
⤶
if ( self:Clip1() <= 0 ) then⤶
⤶
self:EmitSound( "Weapon_Pistol.Empty" )⤶
self:SetNextPrimaryFire( CurTime() + 0.2 )⤶
self:Reload()⤶
return false⤶
⤶
end⤶
⤶
return true⤶
⤶
end⤶
</code>⤶
⤶
</example></function>