ed
This commit is contained in:
parent
9ec9374b18
commit
1ee6dbef40
64 changed files with 5206 additions and 177 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,7 +2,7 @@ local inVehicle = false
|
|||
local fizzPed = nil
|
||||
local spawnRadius = Config.ValetRadius
|
||||
local mechBlip = nil
|
||||
--[[
|
||||
|
||||
RegisterNUICallback('searchCar', function(data, cb)
|
||||
QBCore.Functions.TriggerCallback("roadphone:valet:loadVehicle", function(vehicle, coords)
|
||||
|
||||
|
@ -16,7 +16,7 @@ RegisterNUICallback('searchCar', function(data, cb)
|
|||
TriggerEvent("roadphone:sendNotification", {
|
||||
apptitle = 'APP_VALET_NAME',
|
||||
title = 'APP_VALET_TITLE_WAYPOINT',
|
||||
img = "/public/img/Apps/valet.jpg"
|
||||
img = "/public/img/Apps/light_mode/valet.webp"
|
||||
})
|
||||
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ RegisterNUICallback('searchCar', function(data, cb)
|
|||
TriggerEvent("roadphone:sendNotification", {
|
||||
apptitle = "APP_VALET_NAME",
|
||||
title = "APP_VALET_TITLE_WAYPOINT",
|
||||
img = "/public/img/Apps/valet.jpg"
|
||||
img = "/public/img/Apps/light_mode/valet.webp"
|
||||
})
|
||||
cb('ok')
|
||||
return
|
||||
|
@ -49,66 +49,70 @@ RegisterNUICallback('searchCar', function(data, cb)
|
|||
TriggerEvent("roadphone:sendNotification", {
|
||||
apptitle = "APP_VALET_NAME",
|
||||
title = "APP_VALET_TITLE_CARNOTOUT",
|
||||
img = "/public/img/Apps/valet.jpg"
|
||||
img = "/public/img/Apps/light_mode/valet.webp"
|
||||
})
|
||||
end, data.plate)
|
||||
|
||||
cb('ok')
|
||||
end)
|
||||
--]]
|
||||
|
||||
-- RegisterNUICallback("deliverormarkcar", function(data, cb)
|
||||
-- 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
|
||||
RegisterNUICallback("deliverormarkcar", function(data, cb)
|
||||
QBCore.Functions.TriggerCallback("roadphone:valet:loadVehicle", function(vehicle, coords)
|
||||
|
||||
-- local plate = vehicle[1].plate
|
||||
if not vehicle and not coords then
|
||||
return
|
||||
end
|
||||
|
||||
-- local gameVehicles = GetGamePool('CVehicle')
|
||||
-- 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
|
||||
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/light_mode/valet.webp"
|
||||
})
|
||||
|
||||
-- QBCore.Functions.TriggerCallback("roadphone:valet:checkMoney", function(cb)
|
||||
-- if cb then
|
||||
-- SpawnVehicle(vehicle[1].vehicle, plate, json.decode(vehicle[1].mods))
|
||||
-- end
|
||||
-- end)
|
||||
end
|
||||
return;
|
||||
end
|
||||
|
||||
-- end, data.plate)
|
||||
local plate = vehicle[1].plate
|
||||
|
||||
-- cb('ok')
|
||||
-- end)
|
||||
local gameVehicles = GetGamePool('CVehicle')
|
||||
|
||||
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/light_mode/valet.webp"
|
||||
})
|
||||
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)
|
||||
|
||||
print("RoadPhone Valet: "..plate)
|
||||
local player = PlayerPedId()
|
||||
local playerPos = GetEntityCoords(player)
|
||||
local found, spawnPos, spawnHeading = GetClosestVehicleNodeWithHeading(playerPos.x + math.random(-100, 100),
|
||||
|
@ -197,6 +201,15 @@ RegisterNUICallback("getCars", function(data, cb)
|
|||
for i = 1, #data do
|
||||
if(data[i]) then
|
||||
local vehiclename = data[i].vehicle
|
||||
|
||||
local vehiclemodelnames = getVehicleNames()
|
||||
|
||||
for k, v in pairs(vehiclemodelnames) do
|
||||
if v[1] == model then
|
||||
vehiclename = v[2]
|
||||
end
|
||||
end
|
||||
|
||||
data[i].vehicle = {}
|
||||
data[i].vehicle.model = vehiclename
|
||||
end
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue