diff --git a/client/main.lua b/client/main.lua index a3389f46..4ae3bf3a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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