mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 09:48:52 +00:00
Check for "MaxInService == -1" (#481)
If "MaxInService == -1" is true check for service is skipped
This commit is contained in:
+33
-17
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user