Garry's Mod Wiki

Revision Difference

weapons.GetList#567597

<function name="GetList" parent="weapons" type="libraryfunc"> <description>Get a list of all the registered SWEPs. This does not include weapons added to spawnmenu manually.</description>⤶ <description>Get a list of all the registered SWEPs. This does not include weapons added to spawnmenu manually. <note>This function does not inherit fields from the weapon's base class, unlike <page>weapons.Get</page> </note>⤶ </description>⤶ <realm>Shared</realm> <file line="177-L185">lua/includes/modules/weapons.lua</file> <rets> <ret name="" type="table">List of all the registered SWEPs</ret> </rets> </function> <example> <description>Example structure.</description> <code>PrintTable( weapons.GetList() )</code> <output> ``` 1: Folder = weapons/weapon_myweapon ClassName = weapon_myweapon -- The rest of the SWEP table 2: Folder = weapons/weapon_myweapon2 ClassName = weapon_myweapon2 -- The rest of the SWEP table ``` </output> </example>