mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
refactor(es_extended/client/main.lua): move the event
This commit is contained in:
@@ -24,8 +24,7 @@ function ESX.SpawnPlayer(skin, coords, cb)
|
|||||||
p:resolve()
|
p:resolve()
|
||||||
end)
|
end)
|
||||||
Citizen.Await(p)
|
Citizen.Await(p)
|
||||||
TriggerEvent('playerSpawned', coords)
|
|
||||||
|
|
||||||
local playerPed = PlayerPedId()
|
local playerPed = PlayerPedId()
|
||||||
FreezeEntityPosition(playerPed, true)
|
FreezeEntityPosition(playerPed, true)
|
||||||
SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false, true)
|
SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false, true)
|
||||||
@@ -35,6 +34,7 @@ function ESX.SpawnPlayer(skin, coords, cb)
|
|||||||
end
|
end
|
||||||
FreezeEntityPosition(playerPed, false)
|
FreezeEntityPosition(playerPed, false)
|
||||||
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, true, false)
|
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, true, false)
|
||||||
|
TriggerEvent('playerSpawned', coords)
|
||||||
cb()
|
cb()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user