DarkRP: SetActiveTab() (Derma)

In the DarkRP F4 Menu, I have managed to add a new tab, and get it working 100%, with no problems.

My question:
How do I make it open up to a specific tab in the F4 menu?

I want to set it to where players can type a chat/console command to access it.
I’ve tried it multiple ways with no success.

Any suggestions?

When you make the tab, save its panel by doing like:
[lua]local Derptab = PropertySheet:AddSheet(blabla)[/lua]
Then later when you want to make that tab active, do:

Nope, AddSheet returns a table with, you need the member Tab from it.


local tab = bla:AddSheet(…)

Thanks for the quick replies, but I have hit another snag.

I declared the variable with:
local testtab = F4MenuTabs:AddSheet(“Test Tab”, F4Tabs[5], “gui/silkicons/user”, false, false)

Also, I have set up a console command to open my test tab, with:
function OpenTestTab()
concommand.Add(“Open_Test_Tab”, OpenTestTab)

Now, F4Menu:SetVisible(true) opens it just fine, but not to the right tab.
The Error:
[DarkRP\gamemode\cl_vgui.lua:296] attempt to call method ‘SetActiveTab’ (a nil value)

I know I’m doing something simple wrong, but I am not sure.
It has eluded me.

Full code please.

Then the wiki gives false information, or I didn’t read it correctly.

Ok I read it wrong.

Never mind.