1
0
Fork 0
forked from Simnation/Main

Check Owner Funktion ADD

This commit is contained in:
Miho931 2025-06-25 13:18:34 +02:00
parent 0070350cd1
commit 105f6a85ca
2 changed files with 69 additions and 56 deletions

View file

@ -14,6 +14,8 @@ AddEventHandler('mh_garage:storeVehicle', function()
local lc_fuelLevel = exports["lc_fuel"]:GetFuel(vehicles[i]) -- Get the fuel level
mods.fuelLevel = lc_fuelLevel
QBCore.Functions.TriggerCallback('mh_garage:CheckownerVehicles', function(cb)
if cb then
table.insert(opt, {
title = "Kennzeichen: "..mods.plate,
description = GetRandomCarDescription(),
@ -77,6 +79,8 @@ AddEventHandler('mh_garage:storeVehicle', function()
end
end
})
end
end, mods.plate)
lib.registerContext({
id = "StoredVehicles",
title = random.name.."\n\n"..random.description,

View file

@ -149,3 +149,12 @@ RegisterServerEvent('mh_garage:spawnedVehicle')
AddEventHandler('mh_garage:spawnedVehicle', function(netID, plate)
MySQL.query("UPDATE player_vehicles SET garage = ? WHERE plate = ?", {"OUT", plate})
end)
QBCore.Functions.CreateCallback('mh_garage:CheckownerVehicles', function(source, cb, plate)
MySQL.query("SELECT * FROM player_vehicles WHERE plate = ?", {plate}, function(rs)
if rs ~= nil and rs[1] ~= nil then
cb(true)
else
cb(false)
end)
end)