Gamemode.PopulateToolMenu

From GMod Wiki

Revision as of 01:06, 23 October 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameAddToolMenuCategories
SyntaxGM:AddToolMenuCategories( )
DescriptionUse this to add a menu to the spawnmenu
ReturnsNil
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PopulateToolMenu]Gamemode.PopulateToolMenu [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionAdds a menu in the Category "Stuff"
Used onNewerClient.png
Code
 
function TheMenu( Panel )
	Panel:ClearControls()
	Panel:AddHeader()
	//Do menu things here
end
 
function createthemenu()
	spawnmenu.AddToolMenuOption( "Options", "Stuff",   "CustomMenu",   "My Custom Menu",    "",    "",    TheMenu )
end
hook.Add( "PopulateToolMenu", "pleasework", createthemenu )
 
OutputN/A


Stub.pngThis article is a stub.
You can help the GMod Wiki by expanding it.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox