Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
save vehicle upgrade when stored in garage
Browse files Browse the repository at this point in the history
  • Loading branch information
yeganehha committed Jan 26, 2021
1 parent 82c1ec9 commit 581a374
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/vehicle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions server/vehicle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 581a374

Please sign in to comment.