Checking if 0 is a string

Checking for roles gives you the permissions id the role is 0 but it should’ve also checked if its "0" it’s now fixed :)
This commit is contained in:
Andyyy7666
2022-07-11 06:53:31 +02:00
committed by GitHub
parent 7092f46587
commit e25da65776

View File

@@ -92,7 +92,7 @@ function validateDepartment(player, department)
local roles = getUserDiscordInfo(discordUserId).roles
for _, roleId in pairs(departmentExists) do
if roles[roleId] or roleId == 0 then
if roles[roleId] or roleId == 0 or roleId == "0" then
return true
end
end
@@ -109,7 +109,7 @@ AddEventHandler("checkPerms", function()
for dept, roleTable in pairs(config.departments) do
for _, roleId in pairs(roleTable) do
if roles[roleId] or roleId == 0 then
if roles[roleId] or roleId == 0 or roleId == "0" then
table.insert(allowedRoles, dept)
end
end