From 5f096f485f98704dc0eec54feaad4a88b39ece8b Mon Sep 17 00:00:00 2001 From: MoskalykA <100430077+MoskalykA@users.noreply.github.com> Date: Wed, 8 Mar 2023 12:30:11 +0100 Subject: [PATCH] refactor(playerActive): longer refreshment time --- [core]/es_extended/client/main.lua | 3 ++- [core]/esx_multicharacter/client/main.lua | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index 4dfff72c..53fbb5bc 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -2,7 +2,8 @@ local pickups = {} CreateThread(function() while not Config.Multichar do - Wait(0) + Wait(100) + if NetworkIsPlayerActive(PlayerId()) then exports.spawnmanager:setAutoSpawn(false) DoScreenFadeOut(0) diff --git a/[core]/esx_multicharacter/client/main.lua b/[core]/esx_multicharacter/client/main.lua index b0ee83de..ac4f8d12 100644 --- a/[core]/esx_multicharacter/client/main.lua +++ b/[core]/esx_multicharacter/client/main.lua @@ -4,12 +4,13 @@ if ESX.GetConfig().Multichar then CreateThread(function() while not ESX.PlayerLoaded do - Wait(0) + Wait(100) + if NetworkIsPlayerActive(PlayerId()) then exports.spawnmanager:setAutoSpawn(false) DoScreenFadeOut(0) while not GetResourceState('esx_context') == 'started' do - Wait(0) + Wait(100) end TriggerEvent("esx_multicharacter:SetupCharacters") break