mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
fix(esx_vehicleshop): use new onesync function
This commit is contained in:
@@ -235,7 +235,7 @@ function OpenShopMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('not_enough_money'))
|
||||
end
|
||||
end, vehicleData.model, generatedPlate, IsThisModelACar(vehicleData.model))
|
||||
end, vehicleData.model, generatedPlate)
|
||||
end
|
||||
else
|
||||
menu2.close()
|
||||
|
||||
@@ -162,7 +162,7 @@ ESX.RegisterServerCallback('esx_vehicleshop:getVehicles', function(source, cb)
|
||||
cb(vehicles)
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, model, plate, automobile)
|
||||
ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, model, plate)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local modelPrice = getVehicleFromModel(model).price
|
||||
|
||||
@@ -172,8 +172,12 @@ ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, mo
|
||||
MySQL.insert('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)', {xPlayer.identifier, plate, json.encode({model = joaat(model), plate = plate})
|
||||
}, function(rowsChanged)
|
||||
xPlayer.showNotification(TranslateCap('vehicle_belongs', plate))
|
||||
ESX.OneSync.SpawnVehicle(joaat(model), Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading, false,{plate = plate}, function(vehicle)
|
||||
ESX.OneSync.SpawnVehicle(joaat(model), Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading,{plate = plate}, function(vehicle)
|
||||
Wait(100)
|
||||
local vehicle = NetworkGetEntityFromNetworkId(vehicle)
|
||||
while GetVehicleNumberPlateText(vehicle) ~= plate do
|
||||
Wait(0)
|
||||
end
|
||||
TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1)
|
||||
end)
|
||||
cb(true)
|
||||
|
||||
Reference in New Issue
Block a user