fix(esx_garage): working now

This commit is contained in:
Mycroft
2022-10-14 18:01:02 +01:00
parent 67c5c12049
commit 94b1f1700f
2 changed files with 5 additions and 3 deletions
+2 -3
View File
@@ -49,7 +49,7 @@ RegisterNUICallback('spawnVehicle', function(data, cb)
TriggerServerEvent('esx_garage:payPound', data.exitVehicleCost)
thisPound = nil
TriggerServerEvent('esx_garage:updateOwnedVehicle', false, nil, nil, data.vehicleProps)
TriggerServerEvent('esx_garage:updateOwnedVehicle', false, nil, nil, data, spawnCoords)
TriggerEvent('esx_garage:closemenu')
else
@@ -345,12 +345,11 @@ CreateThread(function()
if IsControlJustReleased(0, 38) then
local vehicle = GetVehiclePedIsIn(playerPed, false)
local vehicleProps = ESX.Game.GetVehicleProperties(vehicle)
ESX.TriggerServerCallback('esx_garage:checkVehicleOwner', function(owner)
if owner then
ESX.Game.DeleteVehicle(vehicle)
TriggerServerEvent('esx_garage:updateOwnedVehicle', true, currentMarker, nil,
vehicleProps)
{vehicleProps = vehicleProps})
else
ESX.ShowNotification(TranslateCap('not_owning_veh'), 'error')
end
+3
View File
@@ -18,6 +18,9 @@ AddEventHandler('esx_garage:updateOwnedVehicle', function(stored, parking, Impou
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