• Disabling Spawn Menu for Certain Ranks
    16 replies, posted
Hello, I have been trying to disable the opening of the Q menu (spawn) for certain ranks, and I still can't figure it out. After googling, finding a bunch of outdated threads, I am getting somewhere, but not all the way. I had something to just stop people from spawning props, but now I want to be able to stop them from being able to open the menu entirely. I tried function GM:SpawnMenuOpen() if ( LocalPlayer():isAdmin) then return false else return true end end and function GM:SpawnMenuOpen() if ( ply:isAdmin) then return false else return true end end both of those broke my chat, and didn't allow anyone to open the spawn menu I also tried this from an old thread. local qmenu_ranks = { ["founder"] = true, ["sudoroot"] = true, ["council"] = true, ["superadmin"] = true, ["gamemaster"] = true, } hook.Add("SpawnMenuOpen", "spawn_menu_ranks", function() local ply = LocalPlayer() if qmenu_ranks[ply:GetUserGroup()] then returntrueelsereturnfalse end end) this blocked the spawn menu from everyone, however it didn't break my chat or anything. What am I doing wrong? How do I go about fixing it?
Thats gotta go somewhere client, correct?
Thank you! Let me go test this right quick!
hook.Remove( "OnSpawnMenuOpen", "SpawnMenuWhitelist" ) Bypassed
What do you mean?
They're saying that a client could potentially bypass your prevention by removing the hook manually clientside. However, that's pretty much only going to happen if you're stupid and have sv_allowcslua set to 1 on your server.
Ah, makes sense.
This logic is why addons are riddled with exploits.
¯\_(ツ)_/¯
Hm, what do you mean "this logic"?
The reasoning that it could only ever be called if sv_allowcslua is enabled, there are multiple ways to get around sv_allowcslua.
This is correct. The problem wasn't me not trusting anyone to spawn props, it was that no one could spawn props and allowing them to open the spawn menu was just ugly and useless at this point. If they got passed that, then they already couldn't spawn props and getting it open would be useless.
What about entities?
Already blocked.
Sorry, you need to Log In to post a reply to this thread.