GM:ShowHelp Customization

Hello,
I am trying to customize the F1 menu.
I created my own index.html, and made it into a website. I have 4 html files I was to use, and all controlled by a CSS that switches between them.
How can I do that server side? So when a client presses F1, it automatically shows index.html, and when a client press a tab (which has a command to redirect to index2.html) it will switch them to index2.html?

Regards,
Odahilys.

EDIT:
Yes I did search. I can’t find anything that regards my case. Also, I do not know anything about LUA, so please please please walk me through rather then redirecting me to the wiki which only has hooks that I have no clue what to do with.

Just create a complete new Derma menu, put a HTML panel in it and then make sure its opened on the ShowHelp hook.

As I mentioned in my edit, I do not know any LUA. I asked for a walkthrough instead of just a link to the wiki.
Where does I put the Derma LUA? How do i make gm_showhelp direct to the derma lua?

This subject has been bumped

Ok, off the top of my head (be careful what you listen to, b/c I’m having a “brain farty” day)

You have to have your Derma Panel Stuff (not necessarily, but for team menu’s and stuff I usually do it here) and you do stuff with it.

GM:ShowHelp() or is it SchoolMe? is:
in init.lua



function GM:ShowHelp( ply )
	ply:ConCommand( "showhelp" )
end
--This makes it so that when you push F1 the console command will be run (showhelp)


Then in cl_init, you would have your dermapanel.
eg.



function ShowHelp()
local DermaPanel = vgui.Create( "DFrame" )
	print('test1')
	DermaPanel:SetPos( 50,50 ) 
	DermaPanel:SetSize( ScrW()-100, ScrH()-100 )
	DermaPanel:SetTitle( "Help Menu" )
	DermaPanel:SetVisible(true)
	--DermaPanel:SetBackgroundBlur( true )
	DermaPanel:SetDraggable( false ) 
	DermaPanel:ShowCloseButton( false ) 
--etc...
end
at the end of it all have something like this:
concommand.Add("showhelp",ShowHelp)

Thanks for your help, it sorta worked. I peeked through the wiki using your guideline, so its works now.
Just one problem, for some reason it won’t download my cl_vgui.lua file.
What i did it, i created a usermessage hook in init.lua to my cl_vgui.lua (which is the derma menu) , and I included the file in cl_init.lua
here are my three files:

init.lua



//The AddCSLuaFile
AddCSLuaFile( "cl_init.lua" )
//The Function
function GM:ShowHelp( ply )
	umsg.Start( "motd", ply )
	umsg.End()
end

cl_init.lua



include( 'cl_vgui.lua' )


cl_vgui.lua (My custom motd file)


function TabMenu()
	local DermaPanel = vgui.Create( "DFrame" )
	DermaPanel:SetPos( 55,55 )
	DermaPanel:SetSize( ScrW() - 110, ScrH() - 110 )
	DermaPanel:SetTitle( "Menu" )
	DermaPanel:SetVisible( true )
	DermaPanel:SetDraggable( false )
	DermaPanel:ShowCloseButton( true )
	DermaPanel:MakePopup()
	DermaPanel:SetBackgroundBlur( true )
	local PropertySheet = vgui.Create( "DPropertySheet" )
	PropertySheet:SetParent( DermaPanel )
	PropertySheet:SetPos( 5, 30 )
	PropertySheet:SetSize( 340, 315 )
	HTMLTest = vgui.Create("HTML")
	HTMLTest:SetPos(30,50)
	HTMLTest:SetSize(ScrW() - 160, ScrH() - 160)
	HTMLTest:SetParent( DermaPanel )
	HTMLTest:OpenURL("http://www.agclan.net")
	DermaPanel:SetMouseInputEnabled( true )
	DermaPanel:SetKeyboardInputEnabled( true )
	HTMLTest2 = vgui.Create("HTML")
	HTMLTest2:SetPos(30,50)
	HTMLTest2:SetSize(ScrW() - 160, ScrH() - 160)
	HTMLTest2:SetParent( DermaPanel )
	HTMLTest2:OpenURL("http://www.agclan.net/motd.html")
	if LocalPlayer():IsAdmin() then
		local AdminPanel = vgui.Create( "DPanel", DermaPanel )
		AdminPanel:SetPos( 25, 50 )
		AdminPanel:SetSize( 250, 250 )
		local KickButton= vgui.Create( "DButton" )
		KickButton:SetParent( AdminPanel )
		KickButton:SetText( "Kick" )
		KickButton:SetPos( 25, 50 )
		KickButton:SetSize( 75, 25 )
			KickButton.DoClick = function ()
	  	  local KickNameFrame = vgui.Create( "DFrame" )
			KickNameFrame:SetPos( 55,55 )
			KickNameFrame:SetSize( 110, 110 )
			KickNameFrame:SetTitle( "Enter Name" )
			KickNameFrame:SetVisible( true )
			KickNameFrame:SetDraggable( false )
			KickNameFrame:ShowCloseButton( true )
			KickNameFrame:MakePopup()
			local NameInput = vgui.Create( "DTextEntry", DermaPanel )
			NameInput:SetPos( 20,25 )
			NameInput:SetParent( KickNameFrame )
			NameInput:SetTall( 20 )
			NameInput:SetWide( 450 )
			NameInput:SetEnterAllowed( true )
			local OkButton = vgui.Create( "DButton" )
		OkButton:SetParent( KickNameFrame )
		OkButton:SetText( "OK" )
		OkButton:SetPos( 25, 50 )
		OkButton:SetSize( 75, 25 )
			OkButton.DoClick = function ()
			LocalPlayer():ConCommand( "sm_kick", NameInput:GetValue() )
			KickNameFrame:Close()
			end
			end
		PropertySheet:AddSheet( "Admin Menu", AdminPanel, "gui/silkicons/group", false, false, "The Admin Menu!!!!!" )
	end
	PropertySheet:AddSheet( "Website", HTMLTest, "gui/silkicons/world", false, false, "Our Website" )
	PropertySheet:AddSheet( "MOTD", HTMLTest2, "gui/silkicons/exclamation", false, false, "Message of the day") 
end
usermessage.Hook( "motd", TabMenu )

You can’t add init.lua as a clientside file.

I meant AddCSLuaFile( “cl_init.lua” )
sorry for the confusion

Did you remember to AddCSLuaFile( “cl_vgui.lua” )?

Yes. I even added init.lua for no reason, just to be sure.
New development:
Console gives out the following errors:
• cl_vgui.lua could not be located
• Warning: unhandeled message motd
Something in the area of that, its not exact word for word but should be the same meaning