Change back to compound operators

This commit is contained in:
TheiLLeniumStudios
2022-05-06 13:56:21 +00:00
parent be61c39319
commit fe9dae0543
3 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -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
+2 -2
View File
@@ -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
View File
@@ -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