// Clientside only stuff goes here function ShowTeamMenu() local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself DermaPanel:SetPos( 80,80 ) -- Position on the players screen DermaPanel:SetSize( 600, 500 ) -- Size of the frame DermaPanel:SetTitle( "Main Menu" ) -- Title of the frame DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( false ) -- Draggable by mouse? DermaPanel:ShowCloseButton( true ) -- Show the close button? DermaPanel:MakePopup() -- Show the frame local TestingPanel = vgui.Create( "DPanel", DermaPanel ) TestingPanel:SetPos( 25, 50 ) TestingPanel:SetSize( 550, 50 ) TestingPanel.Paint = function() -- Paint function surface.SetDrawColor( 50, 50, 50, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) -- Draw the rect surface.DrawText( "Message of the Day: Zyler Rocks!" ) end local PropertySheet = vgui.Create( "DPropertySheet" ) PropertySheet:SetParent( DermaPanel ) PropertySheet:SetPos( 25, 110 ) PropertySheet:SetSize( 550, 315 ) local Welcome = vgui.Create( "DLabel" ) Welcome:SetText( "A" ) Welcome:SetColor(Color(191,255,0,255)) Welcome:SizeToContents() local Character = vgui.Create( "DPanel" ) Character:SetSize( 305, 305 ) Character.paint = function() surface.SetDrawColor(Color(191,255,0,255)) surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) surface.DrawText( "Characters" ) end local Props = vgui.Create( "DPanel" ) Props:SetSize( 305, 305 ) Props.paint = function() surface.SetDrawColor(Color(191,255,0,255)) surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) surface.DrawText( "Pick props to spawn" ) end local food = {} food[1] = "models/props_junk/garbage_milkcarton002a.mdl" food[2] = "models/props_junk/PopCan01a.mdl" food[3] = "models/props_junk/garbage_takeoutcarton001a.mdl" food[4] = "models/props_junk/watermelon01.mdl" food[5] = "models/props_junk/garbage_metalcan001a.mdl" food[6] = "models/props_lab/box01a.mdl" food[7] = "models/props_lab/box01b.mdl" local Proplist1 = vgui.Create("DCollapsibleCategory", Props) Proplist1:SetPos(25, 50) Proplist1:SetSize( 450, 50 ) -- Keep the second number at 50 Proplist1:SetLabel( "Proplist1" ) Proplist1menu = vgui.Create("DModelSelect", Proplist1 ) Proplist1menu:SetSize( 300, 300 ) Proplist1menu:SetSpacing( 5 ) Proplist1menu:EnableHorizontal( true ) Proplist1menu:EnableVerticalScrollbar( false ) Proplist1menu:SetPadding( 4 ) for k,v in pairs(food) do local icon = vgui.Create( "SpawnIcon", Proplist1menu ) icon:SetModel( v ) Proplist1menu:AddItem( icon ) icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v) end end Proplist1:SetContents(Proplist1menu) PropertySheet:AddSheet( "Welcome", Welcome, "gui/silkicons/user", false, false, "Rules and stuff" ) PropertySheet:AddSheet( "Character/Groups", Character, "gui/silkicons/group", false, false, "Manage your character and groups" ) PropertySheet:AddSheet( "Props/Tools", Props, "gui/silkicons/group", false, false, "Get Props and Tools" ) local groupsnamesasdf = {} groupsnamesasdf[1] = "Civil Service" groupsnamesasdf[2] = "Government" groupsnamesasdf[3] = "Employable" local groupslist = vgui.Create("DCollapsibleCategory", Character) groupslist:SetPos(25, 50) groupslist:SetSize( 450, 45 ) -- Keep the second number at 50 groupslist:SetLabel( "Groups" ) local group1 = vgui.Create("DLabel", groupslist) group1:SetPos(20,20) group1:SetColor(Color(255,255,255,255)) group1:SetFont("default") group1:SetText(groupsnamesasdf[1]) group1:SizeToContents() group1menu = vgui.Create("DModelSelect", groupslist ) group1menu:SetPos(40, 40) group1menu:SetSize( 300, 300 ) group1menu:SetSpacing( 5 ) group1menu:EnableHorizontal( true ) group1menu:EnableVerticalScrollbar( false ) group1menu:SetPadding( 4 ) for _, pl in pairs( team.GetPlayers( 1 ) ) do -- loop through all the players on TEAM_WHATEVER local spawnicon = vgui.Create( "SpawnIcon", group1menu ) spawnicon:SetModel( pl:GetModel() ) -- get their model, set the spawnicon to it spawnicon:SetTooltip( pl:Nick() ) -- "little yellow speech bubbles when you move your cursor over them" group1menu:AddItem( spawnicon ) end groupslist:SetContents(group1menu) end usermessage.Hook( "call_vgui", ShowTeamMenu )