mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
fix(es_extended/server/main): remove old player from memory (non multichar)
This commit is contained in:
@@ -50,7 +50,7 @@ local function onPlayerJoined(playerId)
|
||||
return DropPlayer(playerId, "there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.")
|
||||
end
|
||||
|
||||
if not playerId and ESX.GetPlayerFromIdentifier(identifier) then
|
||||
if ESX.GetPlayerFromIdentifier(identifier) then
|
||||
DropPlayer(
|
||||
playerId,
|
||||
("there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s"):format(
|
||||
@@ -115,17 +115,27 @@ if not Config.Multichar then
|
||||
return deferrals.done("[ESX] OxMySQL Was Unable To Connect to your database. Please make sure it is turned on and correctly configured in your server.cfg")
|
||||
end
|
||||
|
||||
if identifier then
|
||||
if not playerId and ESX.GetPlayerFromIdentifier(identifier) then
|
||||
if not identifier then
|
||||
return deferrals.done("[ESX] There was an error loading your character!\nError code: identifier-missing\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.")
|
||||
end
|
||||
|
||||
local xIdentifier = ESX.GetPlayerFromIdentifier(identifier)
|
||||
|
||||
if not playerId and xIdentifier then
|
||||
local xId = xIdentifier.playerId
|
||||
|
||||
if ESX.Players[xId] then
|
||||
ESX.Players[xId] = nil
|
||||
Core.playersByIdentifier[identifier] = nil
|
||||
print(("[ESX] Cleaning old ESX.Players entry for %s (ped invalid)"):format(identifier))
|
||||
else
|
||||
return deferrals.done(
|
||||
("[ESX] There was an error loading your character!\nError code: identifier-active\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same account.\n\nYour identifier: %s"):format(identifier)
|
||||
)
|
||||
else
|
||||
return deferrals.done()
|
||||
end
|
||||
else
|
||||
return deferrals.done("[ESX] There was an error loading your character!\nError code: identifier-missing\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.")
|
||||
end
|
||||
|
||||
return deferrals.done()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user