mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
feat(server/functions): GetPlayersOnDuty
Co-authored-by: Solositeous <36283056+Solositeous@users.noreply.github.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user