temp fix for vehicle ownership

This commit is contained in:
Mycroft
2022-08-20 14:07:10 +01:00
parent 3e32a1a55f
commit f891d682e4
+2 -1
View File
@@ -489,8 +489,9 @@ function ESX.Game.SpawnVehicle(vehicle, coords, heading, cb, networked)
print("Spawned Vehicle: " .. NetID)
if NetID then
local vehicle = NetworkGetEntityFromNetworkId(NetID)
while not DoesEntityExist(vehicle) do
while not DoesEntityExist(vehicle) and not NetworkHasControlOfEntity(vehicle) do
vehicle = NetworkGetEntityFromNetworkId(NetID)
NetworkRequestControlOfEntity(vehicle)
Wait(0)
end
SetEntityAsMissionEntity(vehicle, true, true)