Check for "MaxInService == -1" (#481)

If "MaxInService == -1" is true check for service is skipped
This commit is contained in:
userMacieG
2020-08-07 01:42:24 +02:00
committed by GitHub
parent a38b55a3f0
commit 0554280f32
+33 -17
View File
@@ -124,25 +124,41 @@ function OpenCloakroomMenu()
ESX.TriggerServerCallback('esx_service:isInService', function(isInService)
if not isInService then
ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount)
if not canTakeService then
ESX.ShowNotification(_U('service_max', inServiceCount, maxInService))
else
awaitService = true
playerInService = true
if Config.MaxInService == -1 then
ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount)
if not canTakeService then
ESX.ShowNotification(_U('service_max', inServiceCount, maxInService))
else
awaitService = true
playerInService = true
local notification = {
title = _U('service_anonunce'),
subject = '',
msg = _U('service_in_announce', GetPlayerName(PlayerId())),
iconType = 1
}
local notification = {
title = _U('service_anonunce'),
subject = '',
msg = _U('service_in_announce', GetPlayerName(PlayerId())),
iconType = 1
}
TriggerServerEvent('esx_service:notifyAllInService', notification, 'police')
TriggerEvent('esx_policejob:updateBlip')
ESX.ShowNotification(_U('service_in'))
end
end, 'police')
TriggerServerEvent('esx_service:notifyAllInService', notification, 'police')
TriggerEvent('esx_policejob:updateBlip')
ESX.ShowNotification(_U('service_in'))
end
end, 'police')
else
awaitService = true
playerInService = true
local notification = {
title = _U('service_anonunce'),
subject = '',
msg = _U('service_in_announce', GetPlayerName(PlayerId())),
iconType = 1
}
TriggerServerEvent('esx_service:notifyAllInService', notification, 'police')
TriggerEvent('esx_policejob:updateBlip')
ESX.ShowNotification(_U('service_in'))
end
else
awaitService = true