Minor change to functions

Add a TriggerEvent to `ESX.SetPlayerData` so we can tell other resources to update
Only set networked vehicles as persistent and able to migrate
Return entityCoords from `ESX.Game.GetVehicleInDirection`
Only run `ServerSyncLoops` while ESX.PlayerLoaded is true
Create an imports file to set ESX object and EventHandler for `esx:setPlayerData`
This commit is contained in:
thelindat
2021-05-06 19:42:56 +10:00
parent 2e77b9be87
commit fe86ef5f56
4 changed files with 18 additions and 6 deletions
+2 -2
View File
@@ -352,7 +352,7 @@ end
function StartServerSyncLoops()
-- keep track of ammo
Citizen.CreateThread(function()
while true do
while ESX.PlayerLoaded do
Citizen.Wait(1000)
local letSleep = true
@@ -379,7 +379,7 @@ function StartServerSyncLoops()
Citizen.CreateThread(function()
local previousCoords = vector3(ESX.PlayerData.coords.x, ESX.PlayerData.coords.y, ESX.PlayerData.coords.z)
while true do
while ESX.PlayerLoaded do
Citizen.Wait(1500)
local playerPed = PlayerPedId()