[Garage]
This commit is contained in:
parent
0e0f3736ba
commit
2edc94b699
6 changed files with 54 additions and 8 deletions
37
resources/[carscripts]/mh_garage/client/stored.lua
Normal file
37
resources/[carscripts]/mh_garage/client/stored.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
RegisterNetEvent('mh_garage:storeVehicle')
|
||||
AddEventHandler('mh_garage:storeVehicle', function(zone)
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
local vehicles = GetGamePool('CVehicle')
|
||||
|
||||
local opt = {}
|
||||
|
||||
for i = 1, #vehicles, 1 do
|
||||
local veh_coords = GetEntityCoords(vehicles[1])
|
||||
local distance = #(veh_coords - coords)
|
||||
|
||||
if distance < 40.0 then
|
||||
local mods = QBCore.Functions.GetVehicleProperties(vehicles[i])
|
||||
|
||||
table.insert(opt, {
|
||||
title = "Kennzeichen: "..mods.plate,
|
||||
description = "Soll dieses Fahrzeug eingeparkt werden?",
|
||||
icon = "car",
|
||||
onSelect = function()
|
||||
if zone.price == nil then
|
||||
|
||||
else
|
||||
local alert = lib.alertDialog({
|
||||
header = "Parkplatz kosten",
|
||||
content = "Parkplatkosten pro Fahrzeug: "..zone.price.."\n\nWillst du das Parkplatz trotzdem Einparken?",
|
||||
centered = true,
|
||||
cancel = true
|
||||
})
|
||||
|
||||
print(alert)
|
||||
print(json.encode(alert))
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue