Привет, как из C menu убрать лишние кнопки такие как: Модель игрока
Ты не понял, я даже скриншот показал что кнопки в С меню закрывают само контекстное меню, а по итогу та что?
засунуть в клиентскую часть: lua/autorun/client/*.lua
hook.Add( "ContextMenuCreated", "RemoveCMenuStuff", function( )
list.Set( "DesktopWindows", "PlayerEditor", nil )
end )
остальные кнопки аддонов вырезать по похожему принципу (или в самом коде)
Например у esc аддонов:
esclib/lua/autorun/esc_loared.lua
179 строка (просто вырезать этот хук)
--Context menu button
hook.Add("ContextMenuCreated","esclib.context_button",function(context)
list.Set( "DesktopWindows", "esclib", {
title = "ESettings",
icon = "materials/esclib/esclib_logo.png",
init = function(icon, window)
RunConsoleCommand("esettings")
end
})
end)
а как сделать так чтобы кнопки могли только админы видеть?
--Context menu button
hook.Add("ContextMenuCreated","esclib.context_button",function(context)
if LocalPlayer():GetUserGroup ~= "superadmin" return end
list.Set( "DesktopWindows", "esclib", {
title = "ESettings",
icon = "materials/esclib/esclib_logo.png",
init = function(icon, window)
RunConsoleCommand("esettings")
end
})
end)