Weapon.Clip1

From GMod Wiki

Jump to: navigation, search


Function
Syntax Weapon:Clip1( )
Description:
Returns the number of bullets in the primary fire's clip. Returns -1 if the weapon doesn't have a primary fire, or if it doesn't take ammo.
Returns: Integer
In Object: Weapon
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Weapon.Clip1]Weapon.Clip1 [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCan be used to quickly check if a proper amount of bullets is in your primary clip.
Used onNewerShared.png
Code
if( self:Clip1() > 0 ) then
     // Fire code goes here
else
     // Not enough bullets code goes here
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox