diff --git a/server/functions.lua b/server/functions.lua index 045e6fc..08aa696 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -357,7 +357,14 @@ end function QBCore.Functions.HasPermission(source, permission) local src = source - if IsPlayerAceAllowed(src, permission) then return true end + if type(permission) == "string" then + if IsPlayerAceAllowed(src, permission) then return true end + elseif type(permission) == "table" then + for _, permLevel in pairs(permission) do + if IsPlayerAceAllowed(src, permLevel) then return true end + end + end + return false end diff --git a/shared/main.lua b/shared/main.lua index 3eb8f61..6b09b12 100644 --- a/shared/main.lua +++ b/shared/main.lua @@ -35,6 +35,11 @@ function QBShared.Trim(value) return (string.gsub(value, '^%s*(.-)%s*$', '%1')) end +function QBShared.FirstToUpper(value) + if not value then return nil end + return (value:gsub("^%l", string.upper)) +end + function QBShared.Round(value, numDecimalPlaces) if not numDecimalPlaces then return math.floor(value + 0.5) end local power = 10 ^ numDecimalPlaces