-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcl_blips.lua
36 lines (31 loc) · 1.09 KB
/
cl_blips.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
35
36
local PlayerData, organisationBlips = {}, {}
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerData = xPlayer
end)
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
PlayerData.job = job
end)
RegisterNetEvent('tomic_blips:organisationMembers')
AddEventHandler('tomic_blips:organisationMembers', function(organisationMembers)
if organisationBlips ~= nil then
for k, v in pairs(organisationBlips) do
RemoveBlip(v)
end
end
organisationBlips = {}
for k, v in pairs(organisationMembers) do
if PlayerData.job?.name == v.job then
local blip = AddBlipForCoord(v.coords)
SetBlipSprite(blip, 1)
SetBlipColour(blip, 1)
SetBlipScale(blip, 0.8)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName('STRING')
AddTextComponentString(string.format(shared.blipName, v.name))
EndTextCommandSetBlipName(blip)
organisationBlips[#organisationBlips + 1] = blip
end
end
end)