change Funktion GARAGE
This commit is contained in:
parent
eab3df34be
commit
a1dd0e2dd1
3 changed files with 74 additions and 41 deletions
|
@ -1,3 +1,32 @@
|
|||
RegisterNetEvent('mh_garage:retrieveOwnerVehicle')
|
||||
AddEventHandler('mh_garage:retrieveOwnerVehicle', function()
|
||||
local ped = PlayerPedId()
|
||||
local coords = GetEntityCoords(ped)
|
||||
local random = SelectName()
|
||||
|
||||
local opt = {}
|
||||
|
||||
QBCore.Functions.TriggerCallback('mh_garage:retrieveOwnerVehicle', function(cb)
|
||||
if cb == false then
|
||||
Notification("Es ist kein Fahrzeug hier!", "inform")
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, #cb, 1 do
|
||||
local mods = json.decode(cb[i].mods)
|
||||
table.insert(opt, {
|
||||
title = cb[i].name,
|
||||
description = "Kennzeichen: "..cb[i].plate, --[[ \nTankinhalt: "..math.round(mods.fuelLevel, 2).."%" ]]
|
||||
icon = "car",
|
||||
onSelect = function()
|
||||
cb[i].mods = mods
|
||||
SpawnThisVehicle(cb[i])
|
||||
end
|
||||
})
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('mh_garage:retrieveVehicle')
|
||||
AddEventHandler('mh_garage:retrieveVehicle', function()
|
||||
local ped = PlayerPedId()
|
||||
|
@ -6,7 +35,7 @@ AddEventHandler('mh_garage:retrieveVehicle', function()
|
|||
|
||||
local opt = {}
|
||||
|
||||
QBCore.Functions.TriggerCallback('mh_garage:CallVehicles', function(cb)
|
||||
QBCore.Functions.TriggerCallback('mh_garage:retrieveKeyVehicle', function(cb)
|
||||
Debug(json.encode(cb))
|
||||
for i = 1, #cb, 1 do
|
||||
if cb[i].garage ~= "OUT" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue