1
0
Fork 0
forked from Simnation/Main

valet app

This commit is contained in:
Nordi98 2025-06-12 01:28:39 +02:00
parent 9b0c3281d7
commit c07bc915bd
2 changed files with 52 additions and 49 deletions

View file

@ -56,60 +56,54 @@ RegisterNUICallback('searchCar', function(data, cb)
cb('ok') cb('ok')
end) end)
RegisterNUICallback("deliverormarkcar", function(data, cb) -- RegisterNUICallback("deliverormarkcar", function(data, cb)
QBCore.Functions.TriggerCallback("roadphone:valet:loadVehicle", function(vehicle, coords) -- QBCore.Functions.TriggerCallback("roadphone:valet:loadVehicle", function(vehicle, coords)
-- if not vehicle and not coords then
-- return
-- end
-- if vehicle == false then
-- if coords then
-- SetNewWaypoint(coords.x, coords.y)
-- TriggerEvent("roadphone:sendNotification", {
-- apptitle = 'APP_VALET_NAME',
-- title = 'APP_VALET_TITLE_WAYPOINT',
-- img = "/public/img/Apps/valet.jpg"
-- })
-- end
-- return;
-- end
if not vehicle and not coords then -- local plate = vehicle[1].plate
return
end
if vehicle == false then -- local gameVehicles = GetGamePool('CVehicle')
if coords then -- for i = 1, #gameVehicles do
SetNewWaypoint(coords.x, coords.y) -- local vehicle = gameVehicles[i]
TriggerEvent("roadphone:sendNotification", { -- if DoesEntityExist(vehicle) then
apptitle = 'APP_VALET_NAME', -- if GetVehicleNumberPlateText(vehicle) == plate then
title = 'APP_VALET_TITLE_WAYPOINT', -- local vehicleCoords = GetEntityCoords(vehicle)
img = "/public/img/Apps/valet.jpg" -- SetNewWaypoint(vehicleCoords.x, vehicleCoords.y)
}) -- TriggerEvent("roadphone:sendNotification", {
-- apptitle = 'APP_VALET_NAME',
-- title = 'APP_VALET_TITLE_WAYPOINT',
-- img = "/public/img/Apps/valet.jpg"
-- })
-- cb('ok')
-- return
-- end
-- end
-- end
end -- QBCore.Functions.TriggerCallback("roadphone:valet:checkMoney", function(cb)
return; -- if cb then
end -- SpawnVehicle(vehicle[1].vehicle, plate, json.decode(vehicle[1].mods))
-- end
-- end)
local plate = vehicle[1].plate -- end, data.plate)
local gameVehicles = GetGamePool('CVehicle') -- cb('ok')
-- end)
for i = 1, #gameVehicles do
local vehicle = gameVehicles[i]
if DoesEntityExist(vehicle) then
if GetVehicleNumberPlateText(vehicle) == plate then
local vehicleCoords = GetEntityCoords(vehicle)
SetNewWaypoint(vehicleCoords.x, vehicleCoords.y)
TriggerEvent("roadphone:sendNotification", {
apptitle = 'APP_VALET_NAME',
title = 'APP_VALET_TITLE_WAYPOINT',
img = "/public/img/Apps/valet.jpg"
})
cb('ok')
return
end
end
end
QBCore.Functions.TriggerCallback("roadphone:valet:checkMoney", function(cb)
if cb then
SpawnVehicle(vehicle[1].vehicle, plate, json.decode(vehicle[1].mods))
end
end)
end, data.plate)
cb('ok')
end)
function SpawnVehicle(vehicle, plate, mods) function SpawnVehicle(vehicle, plate, mods)

View file

@ -234,7 +234,7 @@
"disallowJobs": [] "disallowJobs": []
}, },
{ {
"name": "Fotos", "name": "Galerie",
"icon": "/public/img/Apps/gallery.png", "icon": "/public/img/Apps/gallery.png",
"default": true, "default": true,
"category": "apps", "category": "apps",
@ -242,6 +242,15 @@
"allowJobs": [], "allowJobs": [],
"disallowJobs": [] "disallowJobs": []
}, },
{
"name": "Garage",
"icon": "/public/img/Apps/valet.jpg",
"default": true,
"category": "apps",
"redirect": "gallery",
"allowJobs": [],
"disallowJobs": []
},
{ {
"name": "Rechner", "name": "Rechner",
"icon": "/public/img/Apps/calculator.png", "icon": "/public/img/Apps/calculator.png",