feat(server/functions): GetDutyCount

This commit is contained in:
Mojito-Fivem
2021-11-07 22:46:00 +00:00
parent 2236163d5c
commit 85819bddbf
+13
View File
@@ -92,6 +92,19 @@ function QBCore.Functions.GetPlayersOnDuty(job)
return players, count
end
function QBCore.Functions.GetDutyCount(job)
local count = 0
for _, Player in pairs(QBCore.Players) do
if Player.PlayerData.job.name == job then
if Player.PlayerData.job.onduty then
count = count + 1
end
end
end
return count
end
-- Paychecks (standalone - don't touch)
function PaycheckLoop()