[GARAGE]
This commit is contained in:
parent
a29350c85f
commit
fa136ac8c4
6 changed files with 303 additions and 18 deletions
|
@ -1,8 +1,7 @@
|
|||
RegisterNetEvent('mh_garage:storeVehicle')
|
||||
AddEventHandler('mh_garage:storeVehicle', function(zone)
|
||||
print("Trigger Stored Vehicle...")
|
||||
print(json.encode(zone))
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
local ped = PlayerPedId()
|
||||
local coords = GetEntityCoords(ped)
|
||||
local vehicles = GetGamePool('CVehicle')
|
||||
local random = SelectName()
|
||||
|
||||
|
@ -17,7 +16,8 @@ AddEventHandler('mh_garage:storeVehicle', function(zone)
|
|||
description = GetRandomCarDescription(),
|
||||
icon = "car",
|
||||
onSelect = function()
|
||||
if zone.price ~= nil then
|
||||
print(zone.price)
|
||||
if zone.price ~= false then
|
||||
lib.hideContext("StoredVehicles")
|
||||
|
||||
lib.registerContext({
|
||||
|
@ -30,8 +30,18 @@ AddEventHandler('mh_garage:storeVehicle', function(zone)
|
|||
title = "Akzeptieren",
|
||||
description = "Geld wird vom Bankkonto abgebucht!",
|
||||
onSelect = function()
|
||||
lib.hideContext("thisVehicle")
|
||||
StoredVehicle(vehicles[i], zone)
|
||||
lib.hideContext("thisVehicle")
|
||||
QBCore.Functions.TriggerCallback('mh_garage:storedVehicle', function(cb)
|
||||
if cb.status then
|
||||
DeleteVehicle(vehicles[i])
|
||||
Notification(cb.text, cb.type, zone.name)
|
||||
else
|
||||
if cb.police and Config.EnabledPolice then
|
||||
exports["roadphone"]:sendDispatch("Hier hat grade jemand versucht, ein Fahrzeug einzuparken.\nDas Zündschloss sah Beschädigt aus.\nKennzeichen: "..veh.plate, 'police', nil)
|
||||
end
|
||||
Notification(cb.text, cb.type)
|
||||
end
|
||||
end, veh, zone)
|
||||
end
|
||||
},
|
||||
{
|
||||
|
@ -61,10 +71,6 @@ AddEventHandler('mh_garage:storeVehicle', function(zone)
|
|||
end
|
||||
end)
|
||||
|
||||
function StoredVehicle(veh, zone)
|
||||
|
||||
end
|
||||
|
||||
function SelectName()
|
||||
local names = {
|
||||
{name = "Garagen-Guru",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue