add sborka

This commit is contained in:
2026-03-31 10:27:04 +03:00
commit f5e5f56c84
2345 changed files with 382127 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
if not SERVER then return end
-- Таблица групп, которым разрешён административный доступ к Physgun
local AdminGroups = {
["superadmin"] = true,
["super admin"] = true,
["owner"] = true,
["curator"] = true,
["sudo-curator"] = true,
["asist-sudo"] = true,
["admin"] = true,
["st.admin"] = true,
["projectteam"] = true,
["teh.admin"] = true,
["ivent"] = true,
["st.event"] = true,
["event"] = true,
["specadmin"] = true,
["assistant"] = true,
["disp"] = true,
}
-- Хук для Physgun: позволяем администраторам поднимать энтити и игроков
hook.Add("PhysgunPickup", "!!!!Admin_PhysgunPickup_Fix", function(ply, ent)
if not IsValid(ply) then return end
local group = ply:GetUserGroup()
if AdminGroups[group] then
-- Если это игрок, SAM уже имеет свою логику, но мы подтверждаем наше разрешение
if ent:IsPlayer() then
-- Запрещаем поднимать суперадминов если мы просто "админ" (опционально)
-- if group == "admin" and ent:IsSuperAdmin() then return false end
return true
end
-- Для всех остальных энтитей — разрешаем
return true
end
end)
-- Хук для ToolGun: позволяем администраторам использовать инструменты на защищённых объектах
hook.Add("CanTool", "!!!!Admin_CanTool_Fix", function(ply, tr, tool)
if IsValid(ply) and AdminGroups[ply:GetUserGroup()] then
return true
end
end)
-- Хук для Properties (ПКМ меню): позволяем администраторам видеть всё
hook.Add("CanProperty", "!!!!Admin_CanProperty_Fix", function(ply, property, ent)
if IsValid(ply) and AdminGroups[ply:GetUserGroup()] then
return true
end
end)
-- Хук для Unfreeze: позволяем администраторам размораживать объекты
hook.Add("CanPlayerUnfreeze", "!!!!Admin_CanPlayerUnfreeze_Fix", function(ply, ent, phys)
if IsValid(ply) and AdminGroups[ply:GetUserGroup()] then
return true
end
end)
-- Принудительная регистрация привилегий в CAMI для Helix и SAM
hook.Add("InitPostEntity", "!!!!Admin_CAMI_Permissions_Fix", function()
if CAMI then
CAMI.RegisterPrivilege({
Name = "Helix - Bypass Prop Protection",
MinAccess = "admin"
})
-- Для SAM
if SAM_LOADED and sam then
sam.permissions.add("can_physgun_players", nil, "admin")
end
end
end)
print("[ADMIN FIX] Physics and Prop Protection bypass for 'admin' and 'curator' groups loaded.")