DoClick Issues




include( 'shared.lua' )
include( 'industry.lua' )

function AdminDerma()

	adminDermaPanel = vgui.Create( "DFrame" )
	adminDermaPanel:SetPos( 150, 150 )
	adminDermaPanel:SetSize( 600, 600 )
	adminDermaPanel:SetTitle( "Adminge Panel" )
	adminDermaPanel:SetVisible( true )
	adminDermaPanel:SetDraggable( true )
	adminDermaPanel:ShowCloseButton( true )
	adminDermaPanel:MakePopup()

	addOOCMoney = vgui.Create( "DButton" )
	addOOCMoney:SetPos( 40, 40 )
	addOOCMoney:SetSize( 100, 20 )
	addOOCMoney:SetTitle( "Give OOC Money" )
	addOOCMoney:SetText( "Give Money" )
	addOOCMoney.DoClick = function()
	RunConsoleCommand( "adminAddCash" )


	end
end

function personalFinances()

financeOwnPanel = vgui.Create( "DFrame" )
financeOwnPanel:SetPos( 300, 300 )
financeOwnPanel:SetSize( 400, 400 )
financeOwnPanel:SetTitle( "Personal Finances" )
financeOwnPanel:SetVisible( true )
financeOwnPanel:SetDraggable( true )
financeOwnPanel:ShowCloseButton( true )
financeOwnPanel:MakePopup()

financeOwnSave = vgui.Create( "DButton" )
financeOwnSave:SetParent( financeOwnPanel )
financeOwnSave:SetPos( 30, 360 )
financeOwnSave:SetSize( 60, 30 )
financeOwnSave:SetText( "Save" )
financeOwnSave.DoClick = function()
RunConsoleCommand( "saveProgress" )

OOCMoneyDisplay = vgui.Create("DLabel", financeOwnPanel)
OOCMoneyDisplay:SetPos( 60, 200 )
OOCMoneyDisplay:SetSize( 100, 30 )
OOCMoneyDisplay:SetText( OOCMoney )

createAdminPanel = vgui.Create("DButton")
createAdminPanel:SetParent( financeOwnPanel )
createAdminPanel:SetPos( 300, 50 )
createAdminPanel:SetSize( 80, 20 )
createAdminPanel:SetText( "Admin Only" )
createAdminPanel.DoClick = function()
RunConsoleCommand( "Admin Menu" )

end

end



concommand.Add( "personalFinance", personalFinances )
hook.Add( "ShowHelp", "Finances", personalFinances )
concommand.Add( "Admin Menu", AdminDerma )



This is my current cl_init.lua code, I tried getting do click to work a second time in the file, I thought I ended it correctly ad everything, but it gives me there’s a no end error, anyone know what the problem is?

You forgot an “end” in the personalFinances function.

What about that one right under run console command?

financeOwnSave.DoClick

That line.

OH MY GOD! CURSE YOU MYSELF! -- I’m so sorry guys. I’d bet you guys would be surprised if I told you I was a writer. >>

You need 3 ends, not 2:


function personalFinances() -- 1

financeOwnPanel = vgui.Create( "DFrame" )
financeOwnPanel:SetPos( 300, 300 )
financeOwnPanel:SetSize( 400, 400 )
financeOwnPanel:SetTitle( "Personal Finances" )
financeOwnPanel:SetVisible( true )
financeOwnPanel:SetDraggable( true )
financeOwnPanel:ShowCloseButton( true )
financeOwnPanel:MakePopup()

financeOwnSave = vgui.Create( "DButton" )
financeOwnSave:SetParent( financeOwnPanel )
financeOwnSave:SetPos( 30, 360 )
financeOwnSave:SetSize( 60, 30 )
financeOwnSave:SetText( "Save" )
financeOwnSave.DoClick = function() -- 2
RunConsoleCommand( "saveProgress" )
end -- 2

OOCMoneyDisplay = vgui.Create("DLabel", financeOwnPanel)
OOCMoneyDisplay:SetPos( 60, 200 )
OOCMoneyDisplay:SetSize( 100, 30 )
OOCMoneyDisplay:SetText( OOCMoney )

createAdminPanel = vgui.Create("DButton")
createAdminPanel:SetParent( financeOwnPanel )
createAdminPanel:SetPos( 300, 50 )
createAdminPanel:SetSize( 80, 20 )
createAdminPanel:SetText( "Admin Only" )
createAdminPanel.DoClick = function() -- 3
RunConsoleCommand( "Admin Menu" )

end -- 3

end -- 1


Huh?

[editline]08:54AM[/editline]

OH

:eng101:

Thanks. XP :slight_smile: