Player Logout Fix

Fixes the error with esx:playerlogout
This commit is contained in:
Fezz
2025-07-21 14:13:37 +01:00
committed by GitHub
parent 84f10fd176
commit 55c3464464
+6 -1
View File
@@ -386,11 +386,16 @@ end)
AddEventHandler("esx:playerLogout", function(playerId, cb)
local xPlayer = ESX.GetPlayerFromId(playerId)
if not xPlayer then
return
end
local job = xPlayer.getJob().name
Core.JobsPlayerCount[job] = Core.JobsPlayerCount[job] - 1
GlobalState[("%s:count"):format(job)] = Core.JobsPlayerCount[job]
if xPlayer then
TriggerEvent("esx:playerDropped", playerId)