From 581a37485131d10b51ba35daee9654b3b069459b Mon Sep 17 00:00:00 2001 From: erfan ebrahimi Date: Tue, 26 Jan 2021 13:40:37 +0330 Subject: [PATCH] save vehicle upgrade when stored in garage --- client/vehicle.lua | 1 + server/vehicle.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/client/vehicle.lua b/client/vehicle.lua index e70ff4b..3422ba9 100644 --- a/client/vehicle.lua +++ b/client/vehicle.lua @@ -391,6 +391,7 @@ AddEventHandler('Erfan:gang:openGarageMenu', function(Vehicles ,canStoredInGarag end end DeleteEntity(vehicle) + TriggerServerEvent('Erfan:gang:setVehicleProperties', vehicleProperties.plate, vehicleProperties ) TriggerServerEvent('Erfan:gang:setVehicleStatus', vehicleProperties.plate, true) canStoredInGarage = false end diff --git a/server/vehicle.lua b/server/vehicle.lua index d8bdf20..a5f1206 100644 --- a/server/vehicle.lua +++ b/server/vehicle.lua @@ -106,6 +106,12 @@ AddEventHandler('Erfan:gang:setVehicleStatus', function(plate , status ) end) +RegisterServerEvent('Erfan:gang:setVehicleProperties') +AddEventHandler('Erfan:gang:setVehicleProperties', function(plate , vehicleProperties ) + executeOnDB('UPDATE `gangs_vehicle` SET `vehicle` = @vehicle WHERE `plate` = @plate', {['@plate'] = plate , ['@vehicle'] = json.encode(vehicleProperties) } , function(e)end) +end) + + RegisterServerEvent('Erfan:gang:payImpound') AddEventHandler('Erfan:gang:payImpound', function(Vehicle ,Vehicles ,canInsertToGarage , vehicleProperties ) local _Source = source