Lol yes only 2 people talking lol but Combine has been very helpful
Try this:
[lua]
function helpmenu()
DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50, 50 )
DermaPanel:SetSize( 1000, 900 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
end
DermaButton = vgui.Create( "DButton", DermaPanel )
DermaButton:SetText( "Things you need to know - As a gundealealer, you need a licence. <blah blah blah> Click this message to close the window." )
DermaButton:SetPos( 20, 10 )
DermaButton:SetSize( 200, 100 )
DermaButton.DoClick = function() DermaPanel:Close() end
function CloseCopMenu(ply , text , teamonly)
if !(ply == LocalPlayer()) then return end
if string.sub(text , 0 , 14) == "!gundealerhelp" then
helpmenu()
end
end
hook.Add("OnPlayerChat" , "CloseCopInfo" , CloseCopMenu)
[/lua]
Kk
[editline]07:19PM[/editline]
Ok so what are the commands to open and close the menu?
Type !gundealerhelp and it should work.
[editline]07:22PM[/editline]
Post any lua errors that it gives here, I'm sure there's going to be one or two.
Ah ok i will go and test it out now i brb.
[editline]07:27PM[/editline]
Well i put it in the client folder, and i went to test it typed in !gundealerhelp and nothing happened.
[editline]07:33PM[/editline]
autorun/client/shared.lua:13: attempt to index global 'DermaButton' (a nil value)
Does this work?
[lua]
function helpmenu()
DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50, 50 )
DermaPanel:SetSize( 1000, 900 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
end
DermaButton = vgui.Create( "DermaButton", DermaPanel )
DermaButton:SetText( "Things you need to know - As a gundealealer, you need a licence. <blah blah blah> Click this message to close the window." )
DermaButton:SetPos( 20, 10 )
DermaButton:SetSize( 200, 100 )
DermaButton.DoClick = function() DermaPanel:Close() end
function CloseCopMenu(ply , text , teamonly)
if !(ply == LocalPlayer()) then return end
if string.sub(text , 0 , 14) == "!gundealerhelp" then
helpmenu()
end
end
hook.Add("OnPlayerChat" , "CloseCopInfo" , CloseCopMenu)
[/lua]
Is that the same as the other one?
Do this one. It's similar, but different.
[lua]
function helpmenu()
DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50, 50 )
DermaPanel:SetSize( 1000, 900 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
end
DermaButton = vgui.Create( "DermaPanel", DermaPanel )
DermaButton:SetText( "Things you need to know - As a gundealealer, you need a licence. <blah blah blah> Click this message to close the window." )
DermaButton:SetPos( 20, 10 )
DermaButton:SetSize( 200, 100 )
DermaButton.DoClick = function() DermaPanel:Close() end
function CloseCopMenu(ply , text , teamonly)
if !(ply == LocalPlayer()) then return end
if string.sub(text , 0 , 14) == "!gundealerhelp" then
helpmenu()
end
end
hook.Add("OnPlayerChat" , "CloseCopInfo" , CloseCopMenu)
[/lua]
Ok, i think i didn't get a error but the command don't work, did you even put a command in the script?
You didn't get the error, but it didn't work.
[lua]
function helpmenu()
DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50, 50 )
DermaPanel:SetSize( 1000, 900 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
end
DermaButton = vgui.Create( "DermaPanel", DermaPanel )
DermaButton:SetText( "Things you need to know - As a gundealealer, you need a licence. <blah blah blah> Click this message to close the window." )
DermaButton:SetPos( 20, 10 )
DermaButton:SetSize( 200, 100 )
DermaButton.DoClick = function() DermaPanel:Close() end
concommand.Add("gundealerhelp" , helpmenu)
[/lua]
Try doing "gundealerhelp" in console.
Wow, you two just keep on going on..... then thomasfn ruined it :D
autorun/client/shared.lua:13: attempt to index global 'DermaButton' (a nil value)
[editline]08:11PM[/editline]
i be back soon i got dinner so it will give you some time to find out whats going wrong
[lua]
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50, 50 )
DermaPanel:SetSize( 1000, 900 )
DermaPanel:SetTitle( "Gundealer Quick Reference Guide" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
local TestingPanel = vgui.Create( "DPanel", DermaPanel )
TestingPanel:SetPos( 25, 50 )
TestingPanel:SetSize( 850, 750 )
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
end
local DermaButton = vgui.Create( "DButton", TestingPanel )
DermaButton:SetText( "You need a licence, blah blah blah." )
DermaButton:SetPos( 20, 10 )
DermaButton:SetSize( 200, 100 )
/*DermaButton.DoClick = function ()
RunConsoleCommand( "kill" )
end
*/
concommand.Add("gundealerhelp" , helpmenu)
[/lua]
"gundealerhelp" in console without the ""
That one is completely rewritten, I see no reason why it shouldn't work.
Ok, thank you plus combine have you got a steam account i would like to add you to my friends if that is ok with you
Add me - smartseth
[editline]10:43PM[/editline]
Also, I don't want any invites from the paki wallpaper person, if you're lurking and hoping to spam my steam with paki links.
paki links?
[editline]10:52PM[/editline]
Who person with paki wallpaper
This has been solved over steamfriends.
Sorry, you need to Log In to post a reply to this thread.