Garry's Mod

How to set context menu for admins

Submitted by Papich, , Thread ID: 226116

Thread Closed
Papich
Junior Member
Level:
7
Reputation:
0
Posts:
98
Likes:
11
Credits:
257
21-11-2021, 01:17 AM
This post was last modified: 21-11-2021, 01:19 AM by Papich
#1
And so in order to set the context of the menu for the administration, you need to follow a couple of steps
1.First go to lua file garrysmod\gamemodes\sandbox\gamemode\spawnmenu\contextmenu.lua
2.The second is just to write this script here.

local function DisallowContextMenu()
if not LocalPlayer():IsAdmin() then return false end
end
hook.Add("ContextMenuOpen", "DisallowContextMenu", DisallowContextMenu)



And now only the administration sees the context of the menu

Users browsing this thread: 1 Guest(s)