forked from Simnation/Main
Check Owner Funktion ADD
This commit is contained in:
parent
0070350cd1
commit
105f6a85ca
2 changed files with 69 additions and 56 deletions
|
@ -14,6 +14,8 @@ AddEventHandler('mh_garage:storeVehicle', function()
|
||||||
local lc_fuelLevel = exports["lc_fuel"]:GetFuel(vehicles[i]) -- Get the fuel level
|
local lc_fuelLevel = exports["lc_fuel"]:GetFuel(vehicles[i]) -- Get the fuel level
|
||||||
|
|
||||||
mods.fuelLevel = lc_fuelLevel
|
mods.fuelLevel = lc_fuelLevel
|
||||||
|
QBCore.Functions.TriggerCallback('mh_garage:CheckownerVehicles', function(cb)
|
||||||
|
if cb then
|
||||||
table.insert(opt, {
|
table.insert(opt, {
|
||||||
title = "Kennzeichen: "..mods.plate,
|
title = "Kennzeichen: "..mods.plate,
|
||||||
description = GetRandomCarDescription(),
|
description = GetRandomCarDescription(),
|
||||||
|
@ -77,6 +79,8 @@ AddEventHandler('mh_garage:storeVehicle', function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
end, mods.plate)
|
||||||
lib.registerContext({
|
lib.registerContext({
|
||||||
id = "StoredVehicles",
|
id = "StoredVehicles",
|
||||||
title = random.name.."\n\n"..random.description,
|
title = random.name.."\n\n"..random.description,
|
||||||
|
|
|
@ -149,3 +149,12 @@ RegisterServerEvent('mh_garage:spawnedVehicle')
|
||||||
AddEventHandler('mh_garage:spawnedVehicle', function(netID, plate)
|
AddEventHandler('mh_garage:spawnedVehicle', function(netID, plate)
|
||||||
MySQL.query("UPDATE player_vehicles SET garage = ? WHERE plate = ?", {"OUT", plate})
|
MySQL.query("UPDATE player_vehicles SET garage = ? WHERE plate = ?", {"OUT", plate})
|
||||||
end)
|
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)
|
Loading…
Add table
Add a link
Reference in a new issue