So I have gotten help with a friend but still cant do this. How do I open a derma menu. If someone can tell me how that would be nice please help thanks in advance - Brett
:MakePopup()? Post the code...
[CODE]local function BrettsDerma()
local base = vgui.Create( "DFrame" )
local button = vgui.Create( "DButton" )
base:SetPos( ScrW()/2 - 225, ScrH()/2 - 100 )
base:SetSize( 450, 200 )
base:SetVisible( true )
base:SetTitle( "Bretts Menu" )
base:SetDraggable( false )
base:ShowCloseButton( true )
base:MakePopup()
button:SetParent( base )
button:SetText( "Kick" )
button:Center()
button:SetSize( 150, 50 )
button.DoClick = function()
local Options = DermaMenu()
Options:SetPos( ScrW()/2 - 200, ScrH()/2 - 75 )
for k,v in pairs( player.GetAll()) do
Options:AddOption(v:Nick() function() RunConsoleCommand( "say", "!kick".. v:Nick ) end )
Options:Open()
end
end
end
concommand.Add("openmenu", BrettsDerma)
[/CODE]
also im getting the error
[ERROR] addons/brettscripts/lua/autorun/client/bderma.lua:19: ')' expected near 'function'
1. unknown - addons/brettscripts/lua/autorun/client/bderma.lua:0
also the concommand was suppose to open it but its not working
[code]
local function BrettsDerma()
local base = vgui.Create( "DFrame" )
base:SetPos( ScrW()/2 - 225, ScrH()/2 - 100 )
base:SetSize( 450, 200 )
base:SetVisible( true )
base:SetTitle( "Bretts Menu" )
base:SetDraggable( false )
base:ShowCloseButton( true )
base:MakePopup()
local button = vgui.Create( "DButton", base )
button:SetText( "Kick" )
button:Center()
button:SetSize( 150, 50 )
button.DoClick = function()
local Options = DermaMenu()
for k,v in pairs( player.GetAll()) do
Options:AddOption(v:Nick(), function() RunConsoleCommand( "say", "!kick ".. v:Nick() ) end )
Options:Open()
end
end
end
concommand.Add("openmenu", BrettsDerma)
[/code]
You forgot a comma after v:Nick(). Also, you should keep things like "local button = vgui.Create( "DButton", base )" Close to where they're relevant.
[QUOTE=Lolcats;45240951][code]
local function BrettsDerma()
local base = vgui.Create( "DFrame" )
base:SetPos( ScrW()/2 - 225, ScrH()/2 - 100 )
base:SetSize( 450, 200 )
base:SetVisible( true )
base:SetTitle( "Bretts Menu" )
base:SetDraggable( false )
base:ShowCloseButton( true )
base:MakePopup()
local button = vgui.Create( "DButton", base )
button:SetText( "Kick" )
button:Center()
button:SetSize( 150, 50 )
button.DoClick = function()
local Options = DermaMenu()
for k,v in pairs( player.GetAll()) do
Options:AddOption(v:Nick(), function() RunConsoleCommand( "say", "!kick ".. v:Nick() ) end )
Options:Open()
end
end
end
concommand.Add("openmenu", BrettsDerma)
[/code]
You forgot a comma after v:Nick(). Also, you should keep things like "local button = vgui.Create( "DButton", base )" Close to where they're relevant.[/QUOTE]
ok thank you also this would open right?
It works your a life saver
Sorry, you need to Log In to post a reply to this thread.