mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
Merge branch 'main' into main
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user