From d006715131ae1c6f480c1a8a5fb80a742cf74b64 Mon Sep 17 00:00:00 2001 From: Matthew <22198949+MafewTM@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:24:09 -0500 Subject: [PATCH] fix(client): ensure tutorial sessions --- client/character.lua | 8 ++++++-- client/events.lua | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/character.lua b/client/character.lua index 54db5c72a..2d15be38a 100644 --- a/client/character.lua +++ b/client/character.lua @@ -102,6 +102,8 @@ local randomPeds = { } } +NetworkStartSoloTutorialSession() + local nationalities = {} if config.characters.limitNationalities then @@ -370,8 +372,10 @@ local function chooseCharacter() SetEntityCoords(cache.ped, randomLocation.pedCoords.x, randomLocation.pedCoords.y, randomLocation.pedCoords.z, false, false, false, false) SetEntityHeading(cache.ped, randomLocation.pedCoords.w) - if not NetworkIsInTutorialSession() then - NetworkStartSoloTutorialSession() + NetworkStartSoloTutorialSession() + + while not NetworkIsInTutorialSession() do + Wait(0) end Wait(1500) diff --git a/client/events.lua b/client/events.lua index 35250cb96..b100e75d0 100644 --- a/client/events.lua +++ b/client/events.lua @@ -8,8 +8,10 @@ RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() NetworkSetFriendlyFireOption(true) end - if NetworkIsInTutorialSession() then - NetworkEndTutorialSession() + NetworkEndTutorialSession() + + while NetworkIsInTutorialSession() do + Wait(0) end local motd = GetConvar('qbx:motd', '')