Skip to content

Commit

Permalink
fix(client): wait to ensure tutorial sessions status
Browse files Browse the repository at this point in the history
  • Loading branch information
mafewtm authored Dec 26, 2024
1 parent a209671 commit 1332d9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions client/character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ local randomPeds = {
}
}

NetworkStartSoloTutorialSession()

local nationalities = {}

if config.characters.limitNationalities then
Expand Down Expand Up @@ -375,8 +377,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)
Expand Down
6 changes: 4 additions & 2 deletions client/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down

0 comments on commit 1332d9b

Please sign in to comment.