Skip to content

Commit 1332d9b

Browse files
authored
fix(client): wait to ensure tutorial sessions status
1 parent a209671 commit 1332d9b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

client/character.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ local randomPeds = {
102102
}
103103
}
104104

105+
NetworkStartSoloTutorialSession()
106+
105107
local nationalities = {}
106108

107109
if config.characters.limitNationalities then
@@ -375,8 +377,10 @@ local function chooseCharacter()
375377
SetEntityCoords(cache.ped, randomLocation.pedCoords.x, randomLocation.pedCoords.y, randomLocation.pedCoords.z, false, false, false, false)
376378
SetEntityHeading(cache.ped, randomLocation.pedCoords.w)
377379

378-
if not NetworkIsInTutorialSession() then
379-
NetworkStartSoloTutorialSession()
380+
NetworkStartSoloTutorialSession()
381+
382+
while not NetworkIsInTutorialSession() do
383+
Wait(0)
380384
end
381385

382386
Wait(1500)

client/events.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
88
NetworkSetFriendlyFireOption(true)
99
end
1010

11-
if NetworkIsInTutorialSession() then
12-
NetworkEndTutorialSession()
11+
NetworkEndTutorialSession()
12+
13+
while NetworkIsInTutorialSession() do
14+
Wait(0)
1315
end
1416

1517
local motd = GetConvar('qbx:motd', '')

0 commit comments

Comments
 (0)