mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 03:01:31 +00:00
Merge pull request #1396 from RrybaN/fix-awaiting-scripts
fix(ex_extended): prevent scripts from awaiting when multicharacter is false
This commit is contained in:
@@ -25,14 +25,19 @@ function ESX.SpawnPlayer(skin, coords, cb)
|
||||
end)
|
||||
Citizen.Await(p)
|
||||
|
||||
RequestCollisionAtCoord(coords.x, coords.y, coords.z)
|
||||
|
||||
local playerPed = PlayerPedId()
|
||||
local timer = GetGameTimer()
|
||||
|
||||
FreezeEntityPosition(playerPed, true)
|
||||
SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false, true)
|
||||
SetEntityHeading(playerPed, coords.heading)
|
||||
while not HasCollisionLoadedAroundEntity(playerPed) do
|
||||
|
||||
while not HasCollisionLoadedAroundEntity(playerPed) and (GetGameTimer() - timer) < 5000 do
|
||||
Wait(0)
|
||||
end
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
|
||||
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, true, false)
|
||||
TriggerEvent('playerSpawned', coords)
|
||||
cb()
|
||||
@@ -203,6 +208,10 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, _, skin)
|
||||
end
|
||||
end
|
||||
|
||||
if not Config.Multichar then
|
||||
FreezeEntityPosition(ESX.PlayerData.ped, false)
|
||||
end
|
||||
|
||||
if IsScreenFadedOut() then
|
||||
DoScreenFadeIn(500)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user