mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
feat: Support logging out to character select
This commit is contained in:
+11
-1
@@ -22,7 +22,9 @@ if ESX.GetConfig().Multichar then
|
||||
local cam, cam2 = nil, nil
|
||||
|
||||
RegisterNetEvent('esx_multicharacter:SetupCharacters')
|
||||
AddEventHandler('esx_multicharacter:SetupCharacters', function()
|
||||
AddEventHandler('esx_multicharacter:SetupCharacters', function()
|
||||
ESX.PlayerLoaded = false
|
||||
ESX.PlayerData = {}
|
||||
ESX.UI.HUD.SetDisplay(0.0)
|
||||
DisplayHud(false)
|
||||
DisplayRadar(false)
|
||||
@@ -133,4 +135,12 @@ if ESX.GetConfig().Multichar then
|
||||
end
|
||||
cb("ok")
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:onPlayerLogout')
|
||||
AddEventHandler('esx:onPlayerLogout', function()
|
||||
TriggerServerEvent("esx_multicharacter:SetupCharacters")
|
||||
TriggerEvent("esx_multicharacter:SetupCharacters")
|
||||
TriggerEvent('esx_skin:resetFirstSpawn')
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
@@ -91,3 +91,7 @@ if ESX.GetConfig().Multichar then
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterCommand('relog', function(source, args, rawCommand)
|
||||
TriggerEvent('esx:playerLogout', source)
|
||||
end, true)
|
||||
|
||||
Reference in New Issue
Block a user