Hiding default menu tabs

Hi. I need to hide certain tabs in the spawn menu from some usergroups but I can’t hide tabs even for myself.
I try to using methods described in this threads but it doesn’t work for me:

Maybe I just pastes this code to wrong places? Where is right place? /lua/autorun/client ?
Thanks in advance

UPD. Why tabs doesn’t close?


seems this has been addressed in a ton of locations lol this works for me though

[editline]2nd September 2015[/editline]

i have it close on menu open instead of when populating the menu, i dont know if that has anything to do with it

[editline]2nd September 2015[/editline]

[lua]local function removeOldTabls()
if LocalPlayer():IsUserGroup(“superadmin”) then
for k, v in pairs( g_SpawnMenu.CreateMenu.Items ) do
if (v.Tab:GetText() == language.GetPhrase(“spawnmenu.category.npcs”) or
v.Tab:GetText() == language.GetPhrase(“spawnmenu.category.entities”) or
v.Tab:GetText() == language.GetPhrase(“spawnmenu.category.weapons”) or
v.Tab:GetText() == language.GetPhrase(“spawnmenu.category.vehicles”) or
v.Tab:GetText() == language.GetPhrase(“spawnmenu.category.postprocess”) or
v.Tab:GetText() == language.GetPhrase(“spawnmenu.category.dupes”) or
v.Tab:GetText() == language.GetPhrase(“spawnmenu.category.saves”)) then
g_SpawnMenu.CreateMenu:CloseTab( v.Tab, true )
hook.Add(“SpawnMenuOpen”, “blockmenutabs”, removeOldTabls)


[editline]2nd September 2015[/editline]

also if you dont have a bit of a loop in there it likes to only remove one or 2 tabs

[lua] g_SpawnMenu.CreateMenu:CloseTab( v.Tab, true )

Big thanks dude!