mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 17:23:31 +00:00
feat(server/functions): GetPlayersOnDuty
Co-authored-by: Solositeous <36283056+Solositeous@users.noreply.github.com>
This commit is contained in:
co-authored by
Solositeous
parent
ce56fea2b0
commit
2236163d5c
@@ -76,6 +76,22 @@ end
|
|||||||
function QBCore.Functions.GetQBPlayers()
|
function QBCore.Functions.GetQBPlayers()
|
||||||
return QBCore.Players
|
return QBCore.Players
|
||||||
end
|
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)
|
-- Paychecks (standalone - don't touch)
|
||||||
|
|
||||||
function PaycheckLoop()
|
function PaycheckLoop()
|
||||||
|
|||||||
Reference in New Issue
Block a user