Garry's Mod Wiki

WEAPON:CanPrimaryAttack

  boolean WEAPON:CanPrimaryAttack()

Description

Helper function for checking for no ammo.

Returns

1 boolean
Can use primary attack

Example

As defined in weapon_base

function SWEP:CanPrimaryAttack() if ( self.Weapon:Clip1() <= 0 ) then self:EmitSound( "Weapon_Pistol.Empty" ) self:SetNextPrimaryFire( CurTime() + 0.2 ) self:Reload() return false end return true end