mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-01 10:48:56 +00:00
Change back to compound operators
This commit is contained in:
+4
-4
@@ -213,11 +213,11 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am
|
||||
for k, v in pairs(items) do
|
||||
if type(k) == 'string' then
|
||||
finalcount = 0
|
||||
for _, _ in pairs(items) do finalcount = finalcount + 1 end
|
||||
for _, _ in pairs(items) do finalcount += 1 end
|
||||
local item = Player.Functions.GetItemByName(k)
|
||||
if item then
|
||||
if item.amount >= v then
|
||||
count = count + 1
|
||||
count += 1
|
||||
if count == finalcount then
|
||||
retval = true
|
||||
end
|
||||
@@ -229,13 +229,13 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am
|
||||
if item then
|
||||
if amount then
|
||||
if item.amount >= amount then
|
||||
count = count + 1
|
||||
count += 1
|
||||
if count == finalcount then
|
||||
retval = true
|
||||
end
|
||||
end
|
||||
else
|
||||
count = count + 1
|
||||
count += 1
|
||||
if count == finalcount then
|
||||
retval = true
|
||||
end
|
||||
|
||||
@@ -83,7 +83,7 @@ function QBCore.Functions.GetPlayersOnDuty(job)
|
||||
if Player.PlayerData.job.name == job then
|
||||
if Player.PlayerData.job.onduty then
|
||||
players[#players + 1] = src
|
||||
count = count + 1
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -96,7 +96,7 @@ function QBCore.Functions.GetDutyCount(job)
|
||||
for _, Player in pairs(QBCore.Players) do
|
||||
if Player.PlayerData.job.name == job then
|
||||
if Player.PlayerData.job.onduty then
|
||||
count = count + 1
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+1
-1
@@ -577,7 +577,7 @@ function QBCore.Player.GetTotalWeight(items)
|
||||
local weight = 0
|
||||
if not items then return 0 end
|
||||
for _, item in pairs(items) do
|
||||
weight = weight + item.weight * item.amount
|
||||
weight += item.weight * item.amount
|
||||
end
|
||||
return tonumber(weight)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user