1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

How to hide Weapons & Entities Q Menu Tabs

Discussion in 'DarkRP Modding Questions & Help' started by Paco, Sep 10, 2018.

  1. Paco

    Paco New Member

    Well I did removed NPCs,Post Processing etc..Because I don't need them but I wanna HIDE Weapons and Entities from all players except usergropup Owner..How do I do that ? I tried couple codes that I found online and facepunch but nothing helped ? Thanks.
     
  2. Pab14567

    Pab14567 Well-Known Member

  3. Paco

    Paco New Member

    No From Q menu aka SpawnMenu
     
  4. Sir Klutch

    Sir Klutch Active Member

  5. Paco

    Paco New Member

    I think I was clear about Hiding it not removing it..Yes there is code for that below but I get an error,I can use google guys but most of those codes doesn't work..I need someone that has experience to help me.
     
  6. Dancore

    Dancore Member

    Probably using
    Code (Text):
    if LocalPlayer():IsAdmin
     
  7. Paco

    Paco New Member

    can you help me with whole code ? Thanks
     
  8. Dancore

    Dancore Member

    Use whatever code you used to remove the NPC, etc.. tabs, but try adding

    Code (Text):
    if LocalPlayer():IsAdmin return end
     
  9. Paco

    Paco New Member

    Sorry im bad at lua I have no idea :( I just commented like this --include( "contenttypes/vehicles.lua" ) to remove other tabs but since I don't wanna see them or use them I just commented them,but I do wanna see weapons and entities as Owner only
     
    Last edited: Sep 15, 2018
  10. Dancore

    Dancore Member

    Player:IsSuperAdmin()
     
  11. Paco

    Paco New Member

    Yea I get it but I don't know where do I put that or rest of the code im new in all this :( Please haaalp
     
  12. Dancore

    Dancore Member

    Post the code you used to delete the tabs.
     
  13. Paco

    Paco New Member

    I just commented them like you can see here..I commented vehicles,saves etc..I'm not good at lua so yea

    include( "contenttypes/custom.lua" )
    --include( "contenttypes/npcs.lua" )
    include( "contenttypes/weapons.lua" )
    include( "contenttypes/entities.lua" )
    --include( "contenttypes/postprocess.lua" )
    --include( "contenttypes/vehicles.lua" )
    --include( "contenttypes/saves.lua" )
    --include( "contenttypes/dupes.lua" )
     
  14. Dancore

    Dancore Member

    Code (Text):
    local function removeOldTables()
         if LocalPlayer():IsSuperAdmin() then return end
         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 )
                removeOldTables()
            end
        end
    end
    hook.Add("SpawnMenuOpen", "blockmenutabs", removeOldTables)
    This isn't tested so not sure if it'll work but this is as close to a solution as I'll be able to get you. Best of luck!
     
    Paco likes this.
  15. Paco

    Paco New Member

    Thanks it's working

    For who ever find this sometimes you put this in /home/gmodserver/serverfiles/garrysmod/gamemodes/sandbox/gamemode/spawnmenu/spawnmenu.lua
     

Share This Page