weapons.GetList

From GMod Wiki

Jump to: navigation, search
Function
Syntax weapons.GetList( )
Where is this used?
Description:
Retrieves a copy of all of the weapons available on the server.
Returns: Table :Weapon
Part of Library: Weapons
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Weapons.GetList]Weapons.GetList [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints all variables you can call of specified weapon.
Used onNewerClient.png
Code
for k,v in pairs( weapons.GetList()[ 1 ] ) do
	print( k )
end
Outputprints all variables of the weapon in slot 1.


DescriptionPrints all names of sweps on the server.
Used onNewerClient.png
Code
 for k,v in pairs( weapons.GetList() ) do 
	print( v.PrintName )
end 
Outputprints all weapon names.


Additional notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox