fix: dont wait for plate

This commit is contained in:
Mycroft
2022-10-14 18:07:51 +01:00
parent 94b1f1700f
commit 5c45d73ebc
2 changed files with 2 additions and 13 deletions
+1 -7
View File
@@ -16,14 +16,8 @@ AddEventHandler('esx_garage:updateOwnedVehicle', function(stored, parking, Impou
xPlayer.showNotification(TranslateCap('veh_stored'))
else
ESX.OneSync.SpawnVehicle(data.vehicleProps.model, spawn, data.spawnPoint.heading,data.vehicleProps, function(vehicle)
Wait(100)
local vehicle = NetworkGetEntityFromNetworkId(vehicle)
while not DoesEntityExist(vehicle) do
Wait(0)
end
while GetVehicleNumberPlateText(vehicle) ~= data.vehicleProps.plate do
Wait(0)
end
Wait(300)
TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1)
end)
end
+1 -6
View File
@@ -175,12 +175,7 @@ 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
Wait(300)
TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1)
end)
cb(true)