mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 17:01:16 +00:00
feat!: ace permission system
This commit is contained in:
+84
-11
@@ -7,17 +7,17 @@ for i = 48, 57 do NumberCharset[#NumberCharset+1] = string.char(i) end
|
||||
for i = 65, 90 do StringCharset[#StringCharset+1] = string.char(i) end
|
||||
for i = 97, 122 do StringCharset[#StringCharset+1] = string.char(i) end
|
||||
|
||||
QBShared.RandomStr = function(length)
|
||||
function QBShared.RandomStr(length)
|
||||
if length <= 0 then return '' end
|
||||
return QBShared.RandomStr(length - 1) .. StringCharset[math.random(1, #StringCharset)]
|
||||
end
|
||||
|
||||
QBShared.RandomInt = function(length)
|
||||
function QBShared.RandomInt(length)
|
||||
if length <= 0 then return '' end
|
||||
return QBShared.RandomInt(length - 1) .. NumberCharset[math.random(1, #NumberCharset)]
|
||||
end
|
||||
|
||||
QBShared.SplitStr = function(str, delimiter)
|
||||
function QBShared.SplitStr(str, delimiter)
|
||||
local result = {}
|
||||
local from = 1
|
||||
local delim_from, delim_to = string.find(str, delimiter, from)
|
||||
@@ -30,18 +30,18 @@ QBShared.SplitStr = function(str, delimiter)
|
||||
return result
|
||||
end
|
||||
|
||||
QBShared.Trim = function(value)
|
||||
function QBShared.Trim(value)
|
||||
if not value then return nil end
|
||||
return (string.gsub(value, '^%s*(.-)%s*$', '%1'))
|
||||
end
|
||||
|
||||
QBShared.Round = function(value, numDecimalPlaces)
|
||||
function QBShared.Round(value, numDecimalPlaces)
|
||||
if not numDecimalPlaces then return math.floor(value + 0.5) end
|
||||
local power = 10 ^ numDecimalPlaces
|
||||
return math.floor((value * power) + 0.5) / (power)
|
||||
end
|
||||
|
||||
QBShared.ChangeVehicleExtra = function (vehicle, extra, enable)
|
||||
function QBShared.ChangeVehicleExtra(vehicle, extra, enable)
|
||||
if DoesExtraExist(vehicle, extra) then
|
||||
if enable then
|
||||
SetVehicleExtra(vehicle, extra, false)
|
||||
@@ -57,9 +57,9 @@ QBShared.ChangeVehicleExtra = function (vehicle, extra, enable)
|
||||
end
|
||||
end
|
||||
|
||||
QBShared.SetDefaultVehicleExtras = function (vehicle, config)
|
||||
function QBShared.SetDefaultVehicleExtras(vehicle, config)
|
||||
-- Clear Extras
|
||||
for i=1,20 do
|
||||
for i = 1,20 do
|
||||
if DoesExtraExist(vehicle, i) then
|
||||
SetVehicleExtra(vehicle, i, 1)
|
||||
end
|
||||
@@ -77,9 +77,82 @@ QBShared.StarterItems = {
|
||||
}
|
||||
|
||||
QBShared.MaleNoGloves = {
|
||||
[0] = true, [1] = true, [2] = true, [3] = true, [4] = true, [5] = true, [6] = true, [7] = true, [8] = true, [9] = true, [10] = true, [11] = true, [12] = true, [13] = true, [14] = true, [15] = true, [18] = true, [26] = true, [52] = true, [53] = true, [54] = true, [55] = true, [56] = true, [57] = true, [58] = true, [59] = true, [60] = true, [61] = true, [62] = true, [112] = true, [113] = true, [114] = true, [118] = true, [125] = true, [132] = true
|
||||
[0] = true,
|
||||
[1] = true,
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[4] = true,
|
||||
[5] = true,
|
||||
[6] = true,
|
||||
[7] = true,
|
||||
[8] = true,
|
||||
[9] = true,
|
||||
[10] = true,
|
||||
[11] = true,
|
||||
[12] = true,
|
||||
[13] = true,
|
||||
[14] = true,
|
||||
[15] = true,
|
||||
[18] = true,
|
||||
[26] = true,
|
||||
[52] = true,
|
||||
[53] = true,
|
||||
[54] = true,
|
||||
[55] = true,
|
||||
[56] = true,
|
||||
[57] = true,
|
||||
[58] = true,
|
||||
[59] = true,
|
||||
[60] = true,
|
||||
[61] = true,
|
||||
[62] = true,
|
||||
[112] = true,
|
||||
[113] = true,
|
||||
[114] = true,
|
||||
[118] = true,
|
||||
[125] = true,
|
||||
[132] = true
|
||||
}
|
||||
|
||||
QBShared.FemaleNoGloves = {
|
||||
[0] = true, [1] = true, [2] = true, [3] = true, [4] = true, [5] = true, [6] = true, [7] = true, [8] = true, [9] = true, [10] = true, [11] = true, [12] = true, [13] = true, [14] = true, [15] = true, [19] = true, [59] = true, [60] = true, [61] = true, [62] = true, [63] = true, [64] = true, [65] = true, [66] = true, [67] = true, [68] = true, [69] = true, [70] = true, [71] = true, [129] = true, [130] = true, [131] = true, [135] = true, [142] = true, [149] = true, [153] = true, [157] = true, [161] = true, [165] = true
|
||||
}
|
||||
[0] = true,
|
||||
[1] = true,
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[4] = true,
|
||||
[5] = true,
|
||||
[6] = true,
|
||||
[7] = true,
|
||||
[8] = true,
|
||||
[9] = true,
|
||||
[10] = true,
|
||||
[11] = true,
|
||||
[12] = true,
|
||||
[13] = true,
|
||||
[14] = true,
|
||||
[15] = true,
|
||||
[19] = true,
|
||||
[59] = true,
|
||||
[60] = true,
|
||||
[61] = true,
|
||||
[62] = true,
|
||||
[63] = true,
|
||||
[64] = true,
|
||||
[65] = true,
|
||||
[66] = true,
|
||||
[67] = true,
|
||||
[68] = true,
|
||||
[69] = true,
|
||||
[70] = true,
|
||||
[71] = true,
|
||||
[129] = true,
|
||||
[130] = true,
|
||||
[131] = true,
|
||||
[135] = true,
|
||||
[142] = true,
|
||||
[149] = true,
|
||||
[153] = true,
|
||||
[157] = true,
|
||||
[161] = true,
|
||||
[165] = true
|
||||
}
|
||||
Reference in New Issue
Block a user