-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathserver.lua
26 lines (21 loc) · 885 Bytes
/
server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
local QBCore = exports['qb-core']:GetCoreObject()
QBCore.Functions.CreateCallback('qb-scoreboard:server:GetScoreboardData', function(_, cb)
local totalPlayers = 0
local policeCount = 0
local players = {}
for _, v in pairs(QBCore.Functions.GetQBPlayers()) do
if v then
totalPlayers += 1
if v.PlayerData.job.name == 'police' and v.PlayerData.job.onduty then
policeCount += 1
end
players[v.PlayerData.source] = {}
players[v.PlayerData.source].optin = QBCore.Functions.IsOptin(v.PlayerData.source)
end
end
cb(totalPlayers, policeCount, players)
end)
RegisterNetEvent('qb-scoreboard:server:SetActivityBusy', function(activity, bool)
Config.IllegalActions[activity].busy = bool
TriggerClientEvent('qb-scoreboard:client:SetActivityBusy', -1, activity, bool)
end)