This commit is contained in:
Miho931 2025-06-09 17:11:52 +02:00
parent 449faaa020
commit 5dcd987ab7
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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