Hello guys,
to learn some more Lua and how GMod functions I have decided to start writing my own small gamemode.
Since it derives from sandbox users can use all sandbox functions. I went on and disabled the context menu aswell as the spawnmenu (qmenu)
local function DisallowSpawnMenu( )
if not LocalPlayer():IsAdmin() then
return false
end
end
hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", DisallowSpawnMenu)
local function DisallowContextMenu( )
if not LocalPlayer():IsAdmin() then
return false
end
end
hook.Add( "OnContextMenuOpen", "DisallowContextMenu", DisallowContextMenu)
But I just noticed users can still use gmod_spawnnpc and gmod_npcweapon, now I want to disable this aswell.
My question is where I should start looking and how to effectively disable those two commands.
Cheers,
Avoid