mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +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
|
local cam, cam2 = nil, nil
|
||||||
|
|
||||||
RegisterNetEvent('esx_multicharacter:SetupCharacters')
|
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)
|
ESX.UI.HUD.SetDisplay(0.0)
|
||||||
DisplayHud(false)
|
DisplayHud(false)
|
||||||
DisplayRadar(false)
|
DisplayRadar(false)
|
||||||
@@ -133,4 +135,12 @@ if ESX.GetConfig().Multichar then
|
|||||||
end
|
end
|
||||||
cb("ok")
|
cb("ok")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
RegisterNetEvent('esx:onPlayerLogout')
|
||||||
|
AddEventHandler('esx:onPlayerLogout', function()
|
||||||
|
TriggerServerEvent("esx_multicharacter:SetupCharacters")
|
||||||
|
TriggerEvent("esx_multicharacter:SetupCharacters")
|
||||||
|
TriggerEvent('esx_skin:resetFirstSpawn')
|
||||||
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -91,3 +91,7 @@ if ESX.GetConfig().Multichar then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RegisterCommand('relog', function(source, args, rawCommand)
|
||||||
|
TriggerEvent('esx:playerLogout', source)
|
||||||
|
end, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user