mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
feat(esx_vehicleshop): Serverside onesync spawning :)
This commit is contained in:
@@ -228,18 +228,12 @@ function OpenShopMenu()
|
||||
menu2.close()
|
||||
menu.close()
|
||||
DeleteDisplayVehicleInsideShop()
|
||||
|
||||
ESX.Game.SpawnVehicle(vehicleData.model, Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading, function(vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
SetVehicleNumberPlateText(vehicle, generatedPlate)
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
end)
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
else
|
||||
ESX.ShowNotification(_U('not_enough_money'))
|
||||
end
|
||||
end, vehicleData.model, generatedPlate)
|
||||
end, vehicleData.model, generatedPlate, IsThisModelACar(vehicleData.model))
|
||||
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)
|
||||
ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, model, plate, automobile)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local modelPrice = getVehicleFromModel(model).price
|
||||
|
||||
@@ -172,6 +172,9 @@ 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(_U('vehicle_belongs', plate))
|
||||
ESX.OneSync.SpawnVehicle(joaat(model), Config.Zones.VehicleSpawnPoint.Pos, Config.Zones.VehicleSpawnPoint.Heading, automobile,{plate = plate}, function(vehicle)
|
||||
TaskWarpPedIntoVehicle(GetPlayerPed(source), vehicle, -1)
|
||||
end)
|
||||
cb(true)
|
||||
end)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user