diff --git a/resources/[carscripts]/mh_garage/client/main.lua b/resources/[carscripts]/mh_garage/client/main.lua index 0742dc35c..0d84785a3 100644 --- a/resources/[carscripts]/mh_garage/client/main.lua +++ b/resources/[carscripts]/mh_garage/client/main.lua @@ -19,7 +19,7 @@ Citizen.CreateThread(function() if IsPedInAnyVehicle(ped, false) then local veh = GetVehiclePedIsUsing(ped) local mods = QBCore.Functions.GetVehicleProperties(vehicle) - + print("Triggert setMods") TriggerServerEvent('mh_garage:setMods', mods) end end diff --git a/resources/[carscripts]/mh_garage/server/server.lua b/resources/[carscripts]/mh_garage/server/server.lua index 5902d697e..538ae4954 100644 --- a/resources/[carscripts]/mh_garage/server/server.lua +++ b/resources/[carscripts]/mh_garage/server/server.lua @@ -7,18 +7,22 @@ AddEventHandler('mh_garage:setMods', function(mods) for k, v in pairs(test_vari) do if v.plate ~= mods.plate then MySQL.query("SELECT * FROM player_vehicles WHERE plate = ?", {mods.plate}, function(rs) + print("1: "..json.encode(rs)) if rs[1].mods == nil then MySQL.query("UPDATE player_vehicles SET mods = ? WHERE plate = ?", {mods, mods.plate}) table.insert(test_vari, {plate = mods.plate}) + print("2: ") end end) end end else MySQL.query("SELECT * FROM player_vehicles WHERE plate = ?", {mods.plate}, function(rs) + print("3: "..json.encode(rs)) if rs[1].mods == nil then MySQL.query("UPDATE player_vehicles SET mods = ? WHERE plate = ?", {mods, mods.plate}) table.insert(test_vari, {plate = mods.plate}) + print("4") end end) end