fix(vehicleshop): wait until the vehicle is spawned

This commit is contained in:
Mycroft
2022-10-14 17:58:42 +01:00
parent fc87fe5c2d
commit 67c5c12049
@@ -175,6 +175,9 @@ ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, mo
ESX.OneSync.SpawnVehicle(joaat(model), Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading,{plate = plate}, function(vehicle)
Wait(100)
local vehicle = NetworkGetEntityFromNetworkId(vehicle)
while not DoesEntityExist(vehicle) do
Wait(0)
end
while GetVehicleNumberPlateText(vehicle) ~= plate do
Wait(0)
end