Is there a table that has the full list of allows, including the ones that are inherited? Like:
Default, Superadmin has 16, Admin 80, and operator 1
Admin inherits from operator, and superadmin inherits from admin, so that means Superadmin really has 97 and admin has 81.
Right now I'm using this little script to do the job, just wondering if the was an easier way.
// UGroup
USort_Temp = 0
UGroups = {}
UpdateAllows = true
for k,v in pairs(ULib.ucl.groups) do
table.insert(UGroups, k )
end
UAllows = {}
for k,v in pairs(UGroups) do
UAllows[v] = #ULib.ucl.groups[v]["allow"]
end
UInherits = {}
function UpdateAllows()
for k,v in pairs(UGroups) do
UInherits[v] = ULib.ucl.groups[v]["inherit_from"]
if #UInherits[v] > 0 then
for k2,v2 in pairs(ULib.ucl.groups[v]["inherit_from"]) do
UAllows[v] = UAllows[v] + UAllows[v2]
if not UInherits[v2] == nil then
UpdateAllows = true
else
UpdateAllows = false
end
end
end
end
if UpdateAllows then
UpdateAllows()
end
end
UpdateAllows()
I'm working on a script so that you can type: UPromote <player>, and it will promote them to the next level