Skip to content

Commit

Permalink
Update main.lua
Browse files Browse the repository at this point in the history
- Should Fix storing Vehicles with Garage. Pulled code straight from esx_vehicleshop
  • Loading branch information
HumanTree92 committed Jul 18, 2022
1 parent fe7ac49 commit 51fea80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions esx_advancedgarage/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ ESX.RegisterServerCallback('esx_advancedgarage:storeVehicle', function(source, c
local vehiclemodel = vehicleProps.model
local xPlayer = ESX.GetPlayerFromId(source)

MySQL.query('SELECT * FROM owned_vehicles WHERE owner = ? AND plate = ?', {xPlayer.identifier, vehicleProps.plate}, function(result)
if result ~= nil then
MySQL.single('SELECT * FROM owned_vehicles WHERE owner = ? AND plate = ?', {xPlayer.identifier, vehicleProps.plate}, function(result)
if result then
local originalvehprops = json.decode(result.vehicle)
if originalvehprops.model == vehiclemodel then
MySQL.update('UPDATE owned_vehicles SET vehicle = ? WHERE owner = ? AND plate = ?', {json.encode(vehicleProps), xPlayer.identifier, vehicleProps.plate}, function(rowsChanged)
Expand Down

0 comments on commit 51fea80

Please sign in to comment.