feat(server/functions): GetPlayersOnDuty

Co-authored-by: Solositeous <36283056+Solositeous@users.noreply.github.com>
This commit is contained in:
Mojito-Fivem
2021-11-07 22:44:39 +00:00
parent ce56fea2b0
commit 2236163d5c
+16
View File
@@ -76,6 +76,22 @@ end
function QBCore.Functions.GetQBPlayers()
return QBCore.Players
end
function QBCore.Functions.GetPlayersOnDuty(job)
local players = {}
local count = 0
for src, Player in pairs(QBCore.Players) do
if Player.PlayerData.job.name == job then
if Player.PlayerData.job.onduty then
players[#players + 1] = src
count = count + 1
end
end
end
return players, count
end
-- Paychecks (standalone - don't touch)
function PaycheckLoop()