ESX_Service problem

Hello everyone, I updated esx_service line 52 that most of us had problem with :
Old :
if InService[name][source] then
isInService = true
New :
if InService[name] ~= nil – checks if the job is activated for service
if InService[name][source] then
isInService = true
end

and caused me another problem :

cmd :
SCRIPT ERROR: @esx_service/server/main.lua:10: bad argument #1 to ‘pairs’ (table expected, got nil)

GetInServiceCount (@esx_service/server/main.lua:10)
ref (@esx_service/server/main.lua:39)
TriggerServerCallback (@es_extended/server/functions.lua:33)
handler (@es_extended/server/common.lua:89)

and this is line 7 to 17 which is a function :

function GetInServiceCount(name)
local count = 0
for k,v in pairs(InService[name]) do
if v == true then
count = count + 1
end
end
return count
end

Anyone can help me figuring what caused from updating the lines ? and thanks for reading btw

1 Like

Have you figured this out yet? I have the same problem. I cant get in service in esx_police.

The problem is if MaxInService = -1

Set in any valid valour in config.lua for solve it.

if Config.EnableESXService then
        if Config.MaxInService ~= -1 then
                TriggerEvent('esx_service:activateService', 'police', Config.MaxInService)
        end
end