Garry's Mod Wiki

WEAPON:TakePrimaryAmmo

WEAPON:TakePrimaryAmmo( number amount )

Description

A convenience function to remove primary ammo from clip.

Arguments

1 number amount
Amount of primary ammo to remove

Example

As defined in weapon_base

function SWEP:TakePrimaryAmmo( num ) -- Doesn't use clips if ( self.Weapon:Clip1() <= 0 ) then if ( self:Ammo1() <= 0 ) then return end self.Owner:RemoveAmmo( num, self.Weapon:GetPrimaryAmmoType() ) return end self.Weapon:SetClip1( self.Weapon:Clip1() - num ) end

Page Links


Special Pages


Wikis

?

Render Time: 63ms

DB GetPage 43
Generate Html 2
SaveChanges (1) 10
Render Body 0
Render Sidebar 6