Implemented esx_service:notifyAllInService and esx_service:getInServiceList

This commit is contained in:
ElPumpo
2018-07-22 14:46:06 +02:00
parent a636c5161d
commit 5d8b12a415
3 changed files with 37 additions and 0 deletions
+13
View File
@@ -26,6 +26,15 @@ AddEventHandler('esx_service:disableService', function(name)
InService[name][source] = nil
end)
RegisterServerEvent('esx_service:notifyAllInService')
AddEventHandler('esx_service:notifyAllInService', function(notification, name)
for k,v in pairs(InService[name]) do
if v == true then
TriggerClientEvent('esx_service:notifyAllInService', k, notification, source)
end
end
end)
ESX.RegisterServerCallback('esx_service:enableService', function(source, cb, name)
local inServiceCount = GetInServiceCount(name)
@@ -47,6 +56,10 @@ ESX.RegisterServerCallback('esx_service:isInService', function(source, cb, name)
cb(isInService)
end)
ESX.RegisterServerCallback('esx_service:getInServiceList', function(source, cb, name)
cb(InService[name])
end)
AddEventHandler('playerDropped', function()
local _source = source