Merge branch 'main' into main

This commit is contained in:
Kakarot
2022-05-31 07:16:31 -05:00
committed by GitHub
3 changed files with 24 additions and 32 deletions
+1 -18
View File
@@ -1,23 +1,6 @@
# qb-core
### [Official QBCore Documentation](https://qbcore-framework.github.io/qb-docs/)
## Jet Brains Open Source Community Member
* [Click here for more info](https://www.jetbrains.com/community/opensource/#support)
![imageedit_1_7437031978](https://user-images.githubusercontent.com/57848836/169108129-5bc5e78c-d8ae-464d-bb86-42451685ca1a.png)
## QBCore is officially partnered with Sonoran Software!
Sonoran Software offers:
* [The most advanced, integrated CAD software](https://sonorancad.com/kakarot)
* [Complete community management software](https://sonorancms.com/kakarot)
* [In-depth radio communications simulator](https://sonoranradio.com/kakarot)
* [Premium server hosting](https://sonoranservers.com/kakarot)
Use code `KAKAROT` for 20% off your first month at checkout!
# Sonoran Software
![Sonoran Software Partnership](https://sonoransoftware.com/assets/images/promotional/partners/qb_banner_coupon.png)
### [Official QBCore Documentation](https://docs.qbcore.org)
# License
+13 -7
View File
@@ -5,17 +5,23 @@ local Translations = {
missing_args = '请输入必须参数 (x, y, z)',
missing_args2 = '请输入所有参数!',
no_access = '你没有权限',
company_too_poor = '的老板破产了',
item_not_exist = '物品不存在',
too_heavy = '背包已满'
company_too_poor = '所在的公司账户目前发不起工资',
item_not_exist = '物品不存在',
too_heavy = '背包已满',
duplicate_license = '发现重复的 Rockstar 许可证',
no_valid_license = '未找到有效的 Rockstar 许可证',
not_whitelisted = '您没有被列入此服务器的白名单'
},
success = {},
info = {
received_paycheck = '你收到了你的工资 $%{value}',
job_info = '工作: %{value} | 级别: %{value2} | 责任: %{value3}',
gang_info = '团队: %{value} | 级别: %{value2}',
on_duty = '你开始工作了!',
off_duty = '你现在下班了!'
job_info = '工作: %{value} | 级别: %{value2} | 工作状态状态: %{value3}',
gang_info = '帮派: %{value} | 级别: %{value2}',
on_duty = '你开始上班了!',
off_duty = '你现在下班了!',
checking_ban = '你好 %s. 我们正在检查你是否被服务器封禁.',
join_server = '欢迎 %s 进入 {Server Name}.',
checking_whitelisted = '你好 %s. 我们正在检查您是否在白名单内.'
}
}
+10 -7
View File
@@ -209,25 +209,28 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am
if not Player then return cb(false) end
local isTable = type(items) == 'table'
local isArray = isTable and table.type(items) == 'array' or false
local totalItems = 0
local totalItems = #items
local count = 0
if isTable then for _ in pairs(items) do totalItems += 1 end else totalItems = #items end
local kvIndex
if isArray then kvIndex = 2 else kvIndex = 1 end
local kvIndex = 2
if isTable and not isArray then
totalItems = 0
for _ in pairs(items) do totalItems += 1 end
kvIndex = 1
end
if isTable then
for k, v in pairs(items) do
local itemKV = {k, v}
local item = Player.Functions.GetItemByName(itemKV[kvIndex])
if item and (not amount or (amount and item.amount >= amount)) then
if item and ((amount and item.amount >= amount) or (not amount and not isArray and item.amount >= v) or (not amount and isArray)) then
count += 1
end
end
if count == totalItems then
retval = false
retval = true
end
else -- Single item as string
local item = Player.Functions.GetItemByName(items)
if item and (not amount or (amount and item.amount >= amount)) then
if item and not amount or (amount and item.amount >= amount) then
retval = true
end
end