forked from Simnation/Main
Update stored.lua
This commit is contained in:
parent
4d7799c70b
commit
1551a73809
1 changed files with 57 additions and 61 deletions
|
@ -14,73 +14,69 @@ 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)
|
table.insert(opt, {
|
||||||
if cb then
|
title = "Kennzeichen: "..mods.plate,
|
||||||
table.insert(opt, {
|
description = GetRandomCarDescription(),
|
||||||
title = "Kennzeichen: "..mods.plate,
|
icon = "car",
|
||||||
description = GetRandomCarDescription(),
|
onSelect = function()
|
||||||
icon = "car",
|
print(CurrentZone.price)
|
||||||
onSelect = function()
|
if CurrentZone.price ~= nil then
|
||||||
print(CurrentZone.price)
|
lib.hideContext("StoredVehicles")
|
||||||
if CurrentZone.price ~= nil then
|
|
||||||
lib.hideContext("StoredVehicles")
|
|
||||||
|
|
||||||
lib.registerContext({
|
lib.registerContext({
|
||||||
id = "thisVehicle",
|
id = "thisVehicle",
|
||||||
title = random.name,
|
title = random.name,
|
||||||
options = {
|
options = {
|
||||||
{title = "Kosten: "..CurrentZone.price.."$"},
|
{title = "Kosten: "..CurrentZone.price.."$"},
|
||||||
{title = "", disabled = true},
|
{title = "", disabled = true},
|
||||||
{
|
{
|
||||||
title = "Akzeptieren",
|
title = "Akzeptieren",
|
||||||
description = "Geld wird vom Bankkonto abgebucht!",
|
description = "Geld wird vom Bankkonto abgebucht!",
|
||||||
icon = "check",
|
icon = "check",
|
||||||
onSelect = function()
|
onSelect = function()
|
||||||
lib.hideContext("thisVehicle")
|
lib.hideContext("thisVehicle")
|
||||||
QBCore.Functions.TriggerCallback('mh_garage:storedVehicle', function(cb)
|
QBCore.Functions.TriggerCallback('mh_garage:storedVehicle', function(cb)
|
||||||
if cb.status then
|
if cb.status then
|
||||||
TriggerServerEvent('mh_Parking:deleteVehicle', mods.plate, NetworkGetNetworkIdFromEntity(vehicles[i]))
|
TriggerServerEvent('mh_Parking:deleteVehicle', mods.plate, NetworkGetNetworkIdFromEntity(vehicles[i]))
|
||||||
--DeleteVehicle(vehicles[i])
|
--DeleteVehicle(vehicles[i])
|
||||||
Notification(cb.text, cb.type, CurrentZone.name)
|
Notification(cb.text, cb.type, CurrentZone.name)
|
||||||
else
|
else
|
||||||
if cb.police and Config.EnabledPolice then
|
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)
|
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
|
||||||
end, mods, CurrentZone)
|
Notification(cb.text, cb.type)
|
||||||
end
|
end
|
||||||
},
|
end, mods, CurrentZone)
|
||||||
{
|
|
||||||
title = "Abbrechen",
|
|
||||||
description = "Das ist sehr Schade,",
|
|
||||||
icon = "close",
|
|
||||||
onSelect = function()
|
|
||||||
lib.hideContext("thisVehicle")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
lib.showContext("thisVehicle")
|
|
||||||
else
|
|
||||||
QBCore.Functions.TriggerCallback('mh_garage:storedVehicle', function(cb)
|
|
||||||
if cb.status then
|
|
||||||
TriggerServerEvent('mh_Parking:deleteVehicle', mods.plate, NetworkGetNetworkIdFromEntity(vehicles[i]))
|
|
||||||
--DeleteVehicle(vehicles[i])
|
|
||||||
Notification(cb.text, cb.type, CurrentZone.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
|
end
|
||||||
Notification(cb.text, cb.type)
|
},
|
||||||
|
{
|
||||||
|
title = "Abbrechen",
|
||||||
|
description = "Das ist sehr Schade,",
|
||||||
|
icon = "close",
|
||||||
|
onSelect = function()
|
||||||
|
lib.hideContext("thisVehicle")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
lib.showContext("thisVehicle")
|
||||||
|
else
|
||||||
|
QBCore.Functions.TriggerCallback('mh_garage:storedVehicle', function(cb)
|
||||||
|
if cb.status then
|
||||||
|
TriggerServerEvent('mh_Parking:deleteVehicle', mods.plate, NetworkGetNetworkIdFromEntity(vehicles[i]))
|
||||||
|
--DeleteVehicle(vehicles[i])
|
||||||
|
Notification(cb.text, cb.type, CurrentZone.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
|
end
|
||||||
end, mods, CurrentZone)
|
Notification(cb.text, cb.type)
|
||||||
end
|
end
|
||||||
|
end, mods, CurrentZone)
|
||||||
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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue