Garry's Mod Wiki

spawnmenu.AddToolTab

  spawnmenu.AddToolTab( string name, string label = "name", string icon = "icon16/wrench.png" )

Description

Adds a new tool tab to the right side of the spawnmenu. (usually via the SANDBOX:AddToolMenuTabs hook)

See spawnmenu.GetToolMenu for a function to retrieve existing tool tabs.

See spawnmenu.AddCreationTab for tabs on the left side of the spawnmenu.

See spawnmenu.AddToolCategory to add new categories to the newly created tool tab.
See spawnmenu.AddToolMenuOption to add new options to the categories within a tool tab.

Arguments

1 string name
The internal name of the tab. This is used for sorting, as well as adding categories, so it should be unique.
2 string label = "name"
The 'nice' name of the tab that is displayed to the player. See Addon Localization.
3 string icon = "icon16/wrench.png"
The file path to the icon of the tab. Should be a .png file. See Silkicons.

Example

Creates a new tab named, "Tab name!" with a unique name and a wrench icon.

hook.Add( "AddToolMenuTabs", "myHookClass", function() spawnmenu.AddToolTab( "Tab name!", "#Unique_Name", "icon16/wrench.png" ) end )