mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 00:01:20 +00:00
Player Logout Fix
Fixes the error with esx:playerlogout
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user