Garry's Mod Wiki

Garry's Mod Wiki

  WEAPON:TakeSecondaryAmmo( number amount )

Description

A convenience function to remove secondary ammo from clip.

Arguments

1 number amount
How much of secondary ammo to remove

Example

As defined in weapon_base

function SWEP:TakeSecondaryAmmo( num ) -- Doesn't use clips if ( self.Weapon:Clip2() <= 0 ) then if ( self:Ammo2() <= 0 ) then return end self:GetOwner():RemoveAmmo( num, self.Weapon:GetSecondaryAmmoType() ) return end self.Weapon:SetClip2( self.Weapon:Clip2() - num ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...