local ranks = {
["founder"] = true,
["superadmin"] = true,
["admin"] = true,
["ivent"] = true,
["curat"] = true,
["sudocurat"] = true,
}
if SERVER then
local function CheckAccess(ply)
if not ranks[ply:GetUserGroup()] then
DarkRP.notify(ply, 1, 4, "Доступ запрещён.")
return false
end
return true
end
local hooks = {
["PlayerSpawnSWEP"] = true,
["PlayerSpawnSENT"] = true,
["PlayerSpawnRagdoll"] = true,
["PlayerSpawnProp"] = true,
["PlayerSpawnObject"] = true,
["PlayerSpawnNPC"] = true,
["PlayerSpawnEffect"] = true,
["PlayerSpawnVehicle"] = true,
["PlayerGiveSWEP"] = true,
}
for k, v in ipairs(hooks) do
hook.Add(k, 'RanksCheck', CheckAccess)
end
end
if CLIENT then
hook.Add('OnSpawnMenuOpen', 'RanksCheck', function()
return ranks[LocalPlayer()] or false
end)
end