mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
fix(vehicleshop): wait until the vehicle is spawned
This commit is contained in:
@@ -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)
|
ESX.OneSync.SpawnVehicle(joaat(model), Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading,{plate = plate}, function(vehicle)
|
||||||
Wait(100)
|
Wait(100)
|
||||||
local vehicle = NetworkGetEntityFromNetworkId(vehicle)
|
local vehicle = NetworkGetEntityFromNetworkId(vehicle)
|
||||||
|
while not DoesEntityExist(vehicle) do
|
||||||
|
Wait(0)
|
||||||
|
end
|
||||||
while GetVehicleNumberPlateText(vehicle) ~= plate do
|
while GetVehicleNumberPlateText(vehicle) ~= plate do
|
||||||
Wait(0)
|
Wait(0)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user