Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: fix incorrect object manipulation (fixes #3)
  • Loading branch information
MrGriefs committed Oct 1, 2021
1 parent 954e80f commit 297ede2
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions server.lua
Expand Up @@ -5,17 +5,14 @@ local Categories = { 'vehicles', 'peds', 'weapons' }
for _, category in ipairs(Categories) do
local restriction = { locked = {} }
for ace, bl in pairs(Restricted[category]) do
if not bl then
for _, v in ipairs(ace) do
restriction.locked[v] = true
end
if type(bl) ~= 'table' then
restriction.locked[bl] = true
else
if not restriction[ace] then
restriction[ace] = { [bl] = true }
else
for _, v in ipairs(bl) do
restriction[ace][v] = true
end
restriction[ace] = {}
end
for _, hash in pairs(bl) do
restriction[ace][hash] = true
end
end
end
Expand All @@ -41,9 +38,15 @@ AddEventHandler('dblacklist:getClientBlacklist', function ()
for category, aces in pairs(restrictions) do
if not blacklist[category] then blacklist[category] = {} end
for ace, bl in pairs(aces) do
if not IsPlayerAceAllowed(source, Prefix..'.'..ace..'.'..category) then
if not (IsPlayerAceAllowed(source, Prefix..'.'..ace) or IsPlayerAceAllowed(source, Prefix..'.'..ace..'.'..category)) then
for name, _ in pairs(bl) do
blacklist[category][GetHashKey(name)] = true
if type(name) == 'table' then
for name, _ in pairs(bl) do
blacklist[category][GetHashKey(name)] = true
end
else
blacklist[category][GetHashKey(name)] = true
end
end
end
end
Expand Down

0 comments on commit 297ede2

Please sign in to comment.