From 5459372a3691b57fcf12a5a077e81d0823ceed8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 8 Aug 2017 19:12:38 +0200 Subject: [PATCH] fix Inservice bug + add playerDropped event --- server/main.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index a30b38dc..1828d4a1 100644 --- a/server/main.lua +++ b/server/main.lua @@ -34,10 +34,18 @@ ESX.RegisterServerCallback('esx_service:enableService', function(source, cb, nam if inServiceCount >= MaxInService[name] then cb(false, MaxInService[name], inServiceCount) else - InService[name][source] = enable + InService[name][source] = true cb(true, MaxInService[name], inServiceCount) end end) +AddEventHandler('playerDropped', function(source) + for k,v in pairs(InService) do + if v[source] == true then + v[source] = nil + end + end + +end) \ No newline at end of file