Garry's Mod Wiki

WEAPON:CanSecondaryAttack

boolean WEAPON:CanSecondaryAttack()

Description

Helper function for checking for no ammo.

Returns

1 boolean
Can use secondary attack

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

Page Links


Special Pages


Wikis

?

Render Time: 115ms

DB GetPage 30
Generate Html 3
SaveChanges (1) 68
Render Body 0
Render Sidebar 12