Show menu / context menu

Hi people ,
I’m working on a DarkRP server , and i wan’t to remove the “Show menu” and “Show context menu” for the players because i want to intruduce a destructible props on the F4 menu, but i want to allow this only for the supers admin .

It’s possible ?

Thanks for your answers
Nico.

in the darkrp.txt theres a thing there called “spawnmenu” = “1” change it to 0. But that is for all players.

Im sure you could return false when you press q? I don’t know, I will have to experiment.

Thanks you Exploderguy for you answer =)

I don’t have this on my file darkrp.txt but i find a issue on the sandbox folder :

function GM:SpawnMenuOpen()

GAMEMODE:SuppressHint( "OpeningMenu" )
GAMEMODE:AddHint( "OpeningContext", 20 )
return true	

end

A just have to turn off , and i’m searching for “false” only for the membre and “true” dor superadmin only .

Do you think if it’s possible ?

Sorry fr my bad english ^^

Nico

well i havnt seen that before, but you could do something like this, (replace it where darkrp has this code)




if ply:IsSuperAdmin() then

--the codme you found

else

--the code you have to spawn the custom menu

end


just a simple ‘if’ statement.

This is a code of sandbox not on darkrp*

I have try with ply and pl but ehre is only self who work so i have test this :

function GM:ContextMenuOpen()
if self:IsSuperAdmin()
then
GAMEMODE:SuppressHint( “OpeningContext” )
GAMEMODE:AddHint( “ContextClick”, 20 )
return true
else
return false
end
end

But the IsSuperAdmin didn’t work and there is a
[ERROR] gamemodes/sandbox/gamemode/cl_spawnmenu.lua:37: attempt to call method ‘IsSuperAdmin’ (a nil value)

  1. Call - gamemodes/sandbox/gamemode/cl_spawnmenu.lua:37
  2. Call - gamemodes/sandbox/gamemode/spawnmenu/contextmenu.lua:232
    3. unknown - gamemodes/base/gamemode/cl_spawnmenu.lua:72
    4. unknown - lua/includes/modules/concommand.lua:69

So i tried with IsAdmin but don’t work to .

[Lua]
hook.Add( “ContextMenuOpen”, “denyContextMenu”, function()
if LocalPlayer():IsSuperAdmin() then
return true
else
return false
end
end )

hook.Add( “SpawnMenuOpen”, “denySpawnMenu”, function()
if LocalPlayer():IsSuperAdmin() then
return true
else
return false
end
end )
[/lua]

The rest of this thread gave me Ebola.

Yeah that work great , thanks you man =)