-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.lua
34 lines (31 loc) · 1.02 KB
/
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
27
28
29
30
31
32
33
34
local QBCore = exports['qb-core']:GetCoreObject()
-- Functions
local function UpdateBlips()
local dutyPlayers = {}
local players = QBCore.Functions.GetQBPlayers()
for _, v in pairs(players) do
if v and v.PlayerData.job.onduty then
local coords = GetEntityCoords(GetPlayerPed(v.PlayerData.source))
local heading = GetEntityHeading(GetPlayerPed(v.PlayerData.source))
dutyPlayers[#dutyPlayers + 1] = {
source = v.PlayerData.source,
label = v.PlayerData.charinfo.firstname .. ' ' .. v.PlayerData.charinfo.lastname,
job = v.PlayerData.job,
location = {
x = coords.x,
y = coords.y,
z = coords.z,
w = heading
}
}
end
end
TriggerClientEvent('jobblips:client:UpdateBlips', -1, dutyPlayers)
end
CreateThread(function()
Wait(20000)
while true do
Wait(5000)
UpdateBlips()
end
end)