Changing the Q Menu

I need to make the Q Menu instead a menu to select player models (Certain player models only defined by the Lua code) and possibly some added stuff later on, rather then what it is now (Spawning props etc.)

So, how should I do this?

Edit:

Oh yes and if they’re on a certain team it will also display a prop spawning menu where they can spawn certain props.

Sorry if this has already been made but the search function wasn’t working :frowning:

I suppose http://wiki.garrysmod.com/?title=Using_SpawnIcons can help me with the second part, maybe not spawning props but I’ll figure that out myself.

I suppose you know how to use hooks so i wont post a example since [lua] isn’t working.
**[Gamemode.OnSpawnMenuOpen

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Gamemode.OnSpawnMenuOpen)**
**[Gamemode.OnSpawnMenuClose

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Gamemode.OnSpawnMenuClose)**

I beg to differ :v:

http://www.facepunch.com/showthread.php?1012807-Lua-tags

Actually I’m still not fully familiar with this hook stuff, Is there a quick example for me to use with this? Or do I have to read a whole thing, I’m fine with that.

[LUA] local Models = {
“models/props/CS_militia/newspaperstack01.mdl”,
“models/props/cs_office/coffee_mug.mdl”,
“models/props/cs_office/coffee_mug2.mdl”,
“models/props/cs_office/coffee_mug3.mdl”,
“models/props/cs_office/Chair_office.mdl”,
“models/props/cs_office/computer.mdl”,
“models/props/cs_office/computer_caseB.mdl”,
“models/props/cs_office/computer_mouse.mdl”,
“models/props/cs_office/file_cabinet1_group.mdl”,
“models/props/cs_office/Shelves_metal.mdl”,
“models/props/cs_office/sofa.mdl”,
“models/props/cs_office/sofa_chair.mdl”,
“models/props/cs_office/Table_coffee.mdl”,
“models/props_junk/PlasticCrate01a.mdl”,
“models/props_junk/PushCart01a.mdl”,
“models/props_junk/TrafficCone001a.mdl”,
“models/props_junk/wood_crate001a.mdl”,
“models/props_junk/TrashBin01a.mdl”,
}

local frame = vgui.Create("DFrame")
local IconList = vgui.Create( "DPanelList", frame ) 

frame:SetPos((ScrW() / 2) - 175, (ScrH() / 2) - 200)
frame:SetSize(350,400)
frame:SetTitle("Spawn Menu")
frame:SetDraggable(false)
frame:ShowCloseButton(false)
frame:SetVisible(false)

 IconList:EnableVerticalScrollbar( true ) 
 IconList:EnableHorizontal( true ) 
 IconList:SetPadding( 4 ) 
IconList:SetPos(10,30)
IconList:SetSize(330, 360)

for k,v in pairs(Models) do
    local icon = vgui.Create( "SpawnIcon", IconList ) 
    icon:SetModel( v )
    IconList:AddItem( icon )
    icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v) end 
end 
function GM:OnSpawnMenuOpen()
    frame:SetVisible(true)
    gui.EnableScreenClicker(true) 
end
function GM:OnSpawnMenuClose()
    frame:SetVisible(false)
    gui.EnableScreenClicker(false) 
end[/LUA]

I wish I didn’t waste my time learning C++

If you know C++ Lua should come easier to you.

If you know C++ why are you wasting your time with Lua, go make a 3D game or something similar.