Derma: Property Sheet

Okay so im attempting to make a derma menu and i can’t seem to get any of the tabs to work properly.

How can i fix up the panel inside and make the admin menu accessable by admins only, when i attempt to change the SetSize of the derma panel it doesnt move :confused:

http://puu.sh/jizR3/3cca7bfd77.jpg

My current code, Excuse the messiness will fix that later xD

http://pastebin.com/rpS4YFjE

-snip-

just make at the admin tab an “If ply:isAdmin() then…”?

[editline]30th July 2015[/editline]

Also, your DPropertySheet has “setpos(5, 25)” you cant add 5 if its size is already at the max.

You should useDock.

Here is your code



--[ Derma ]--
 
// Menu Selector DermaPanel
function DERMA()

    local Frame = vgui.Create( "DFrame" )     
    Frame:SetPos( 200, 200 )
    Frame:SetSize( 520, 300 )
    Frame:SetTitle( "Class Selector" )
    Frame:SetVisible( true )
    Frame:SetDraggable( false )
    Frame:ShowCloseButton( true )
    Frame:Center()
    Frame:MakePopup()
     
    function Frame:Paint( w, h )
         draw.RoundedBox( 0, 0, 0, w, h, Color( 50, 150, 50 ) )
         surface.SetDrawColor( 0, 0, 0 )
         surface.DrawOutlinedRect( 1, 1, w-1, h-1 )
    end
     
    local PropertySheet = vgui.Create( "DPropertySheet", Frame )
     PropertySheet:Dock(FILL)
     
    local DermaPanel = vgui.Create( "DPanel", Frame )
    DermaPanel:SetPos( 5, 2)
    DermaPanel:SetSize( 100, 100 )
   
    // Menu Selector Buttons 
    local DermaButton = vgui.Create( "DButton", DermaPanel )
    DermaButton:SetParent( DermaPanel )
    DermaButton:SetText( "Sniper" )
    DermaButton:SetPos( 25, 50 )
    DermaButton:SetSize( 150, 50 )
    DermaButton.DoClick = function ()
        RunConsoleCommand( "CC3_class1" )
        Frame:Remove()
    end
     
    local DermaButton2 = vgui.Create( "DButton", DermaPanel )
    DermaButton2:SetParent( DermaPanel )
    DermaButton2:SetText( "Shotgun" )
    DermaButton2:SetPos( 185, 50 )
    DermaButton2:SetSize( 150, 50 )
    DermaButton2.DoClick = function ()
        RunConsoleCommand( "CC3_class2" )
        Frame:Remove()
    end
     
    local DermaButton3 = vgui.Create( "DButton", DermaPanel )
    DermaButton3:SetParent( DermaPanel )
    DermaButton3:SetText( "SMG" )
    DermaButton3:SetPos( 345, 50 )
    DermaButton3:SetSize( 150, 50 )
    DermaButton3.DoClick = function ()
        RunConsoleCommand( "CC3_class3" )
        Frame:Remove()
    end
     
    PropertySheet:AddSheet( "Classes", DermaPanel, "gui/silkicons/key", false, false)
    if ( !LocalPlayer():IsAdmin() ) then
	    local DermaPanel2 = vgui.Create( "DPanel", Frame )
	    DermaPanel:SetPos( 0, 2)
	    DermaPanel:SetSize( 520, 100 )
	    DermaPanel:Center()

        PropertySheet:AddSheet( "Admin Menu", DermaPanel2, "gui/silkicons/bomb", false, false)
    end    
end