LUA:Modifying F4
Jump to navigation
Jump to search
[edit]
Description | Add your own tab to the F4 menu |
---|---|
Code | local function createMyTab()
local tab = vgui.Create("whatever...")
-- Create the your tab here or something
return tab
end
hook.Add("F4MenuTabs", "addTab", function()
-- Add the tab to F4 (will be added as the last tab)
-- DarkRP.addF4MenuTab("NAME OF TAB HERE", vguiControlOfTab) returns the tab number of the added tab
local tabNr = DarkRP.addF4MenuTab("My Custom Tab", createMyTab())
-- If you want it to move the tab to be before another, use this
-- DarkRP.switchTabOrder(TabNumberOfTabYouWantToMove, TabNumberOfDestination)
DarkRP.switchTabOrder(tabNr, 4)
end)
|
Output | Your tab is added to the F4 menu |
Remove a tab from F4[edit]
Description | Removes tab number 3 |
---|---|
Code | hook.Add("F4MenuTabs", "removeTab", function()
-- the HUD tab is the fourth one
-- DarkRP.removeF4MenuTab(TabNumber)
DarkRP.removeF4MenuTab(3)
end)
|
Output | Tab #3 is gone. |