fixes(service+police): Police can properly go on duty; remove player from service when dropping

This commit is contained in:
Linden
2021-06-29 10:32:32 +10:00
parent 5ea3cc1a2f
commit f3369b6660
3 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ function OpenCloakroomMenu()
ESX.TriggerServerCallback('esx_service:isInService', function(isInService)
if not isInService then
if Config.MaxInService == -1 then
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))
+2 -2
View File
@@ -5,7 +5,7 @@ Config.MarkerType = {Cloakrooms = 20, Armories = 21, BossActions
Config.MarkerSize = {x = 1.5, y = 1.5, z = 0.5}
Config.MarkerColor = {r = 50, g = 50, b = 204}
Config.EnablePlayerManagement = false -- Enable if you want society managing.
Config.EnablePlayerManagement = true -- Enable if you want society managing.
Config.EnableArmoryManagement = false
Config.EnableESXIdentity = true -- Enable if you're using esx_identity.
Config.EnableLicenses = false -- Enable if you're using esx_license.
@@ -17,7 +17,7 @@ Config.EnableJobBlip = false -- Enable blips for cops on duty, requ
Config.EnableCustomPeds = false -- Enable custom peds in cloak room? See Config.CustomPeds below to customize peds.
Config.EnableESXService = false -- Enable esx service?
Config.MaxInService = -1 -- How much people can be in service at once?
Config.MaxInService = -1 -- How many people can be in service at once? Set as -1 to have no limit
Config.Locale = 'en'
+1 -3
View File
@@ -73,9 +73,7 @@ ESX.RegisterServerCallback('esx_service:getInServiceList', function(source, cb,
cb(InService[name])
end)
AddEventHandler('playerDropped', function()
local _source = source
AddEventHandler('esx:playerDropped', function(playerId, reason)
for k,v in pairs(InService) do
if v[_source] == true then
v[_source] = nil