• Add tabs to the tabs menu
    8 replies, posted
Hey, I am making a DarkRP server and I was just wondering if anyone knows how to add tabs to the tabs menu in DarkRP? I've searched some but I do not understand how to add text to the added tabs since I am not a LUA coder. What I would like to add is a simple donators tab for text explaining how to donate and why they should donate. Kind regards, Kippan.
[QUOTE=Kippan;40606948]Hey, I am making a DarkRP server and I was just wondering if anyone knows how to add tabs to the tabs menu in DarkRP? I've searched some but I do not understand how to add text to the added tabs since I am not a LUA coder. What I would like to add is a simple donators tab for text explaining how to donate and why they should donate. Kind regards, Kippan.[/QUOTE] You have to add them in the client/vgui.lua and client/showteamtabs.lua.
[QUOTE=Mors Quaedam;40607517]You have to add them in the client/vgui.lua and client/showteamtabs.lua.[/QUOTE] The thing is, I don't know how, I know where to (sort of) but I don't know how, the code used so to speak.
[url]http://wiki.darkrp.com/index.php/DarkRP.F4MenuTabs[/url] You have to have a tab control somewhere. Put it in the addF4MenuTab function and it will be added to the F4 menu. You need to update DarkRP for it to work.
[QUOTE=FPtje;40614380][url]http://wiki.darkrp.com/index.php/DarkRP.F4MenuTabs[/url] You have to have a tab control somewhere. Put it in the addF4MenuTab function and it will be added to the F4 menu. You need to update DarkRP for it to work.[/QUOTE] Alright, will try it out! Thanks! [editline]12th May 2013[/editline] [QUOTE=FPtje;40614380][url]http://wiki.darkrp.com/index.php/DarkRP.F4MenuTabs[/url] You have to have a tab control somewhere. Put it in the addF4MenuTab function and it will be added to the F4 menu. You need to update DarkRP for it to work.[/QUOTE] Eh, I feel so stupid but what do you mean by "tab control"? Is it some kind of code used to edit the tabs in-game or what? Otherwise how do I add text to the tab? As known, I am a noob of LUA.
[QUOTE=Kippan;40614834] Eh, I feel so stupid but what do you mean by "tab control"? Is it some kind of code used to edit the tabs in-game or what? Otherwise how do I add text to the tab? As known, I am a noob of LUA.[/QUOTE] Check the example on the wiki: [LUA] 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 fifth tab) -- GAMEMODE:addF4MenuTab("NAME OF TAB HERE", vguiControlOfTab, "Icon here!") returns the tab number of the added tab local tabNr = GAMEMODE:addF4MenuTab("My Custom tab", createMyTab(), "icon16/money.png") -- I want it to be before the HUD tab (which is the fourth tab) -- GAMEMODE:switchTabOrder(TabNumberOfFirstTab, TabNumberOfSecondTab) GAMEMODE:switchTabOrder(tabNr, 4) end) [/LUA] You have to create the VGUI for the tab in the createMyTab() function (or whatever you call it) and pass it to the addF4MenuTabFunction (also seen above but I'll show it again): [LUA] local tabNr = GAMEMODE:addF4MenuTab("My Custom tab", createMyTab(), "icon16/money.png") [/LUA] First argument is the title, second is the call to the function which creates the VGUI for the tab, and the third is the icon.
[QUOTE=Kippan;40614834]Eh, I feel so stupid but what do you mean by "tab control"? Is it some kind of code used to edit the tabs in-game or what? Otherwise how do I add text to the tab? As known, I am a noob of LUA.[/QUOTE] To put a tab in the F4 menu, you need to have a tab in the first place. If you don't know how to make a tab, then the knowledge of how to add one to F4 is completely and utterly useless.
[QUOTE=FPtje;40615231]To put a tab in the F4 menu, you need to have a tab in the first place. If you don't know how to make a tab, then the knowledge of how to add one to F4 is completely and utterly useless.[/QUOTE] I have the knowledge of how to ADD a tab, I don't have the knowledge of how to EDIT the tab. I just want the information of >where< to add a couple of lines of code to make the TAB usefull with that having text in it, also what these lines of codes would be. [editline]12th May 2013[/editline] [lua]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 fifth tab) -- GAMEMODE:addF4MenuTab("NAME OF TAB HERE", vguiControlOfTab, "Icon here!") returns the tab number of the added tab local tabNr = GAMEMODE:addF4MenuTab("My Custom tab", createMyTab(), "icon16/money.png") -- I want it to be before the HUD tab (which is the fourth tab) -- GAMEMODE:switchTabOrder(TabNumberOfFirstTab, TabNumberOfSecondTab) GAMEMODE:switchTabOrder(tabNr, 4) end)[/lua] I mean, it's pretty obvious that that's how to add one, which I thank you for showing me but I need to know how to be able to edit the tab if there's any way to do it >in-game< or if I need the knowledge to code it in, if so, I need some help with that.
You need to code the tab in Lua. Showteamtabs.lua has all the default f4 tabs, but it's code isn't that good. You can't make tabs in game.
Sorry, you need to Log In to post a reply to this thread.