Hello as I’m writing this i’ve seen only this [Dev Tool]yvr_recorder | recording yvr files (Vehicle Playback Files) for your races or story recorder to be easy to understand so i used it.
Im trying to make my multicharacter play an custom recorder route while the player selects it etc. Due to poor documentiation i was wondering is it possible to make it work for qb
Code im trying to replicate to qb
function StartAnimation(next)
for VehicleModel, Data in pairs(Config.RecordedVehicles) do
if next then
DeleteVehicles()
DeleteNPC()
QBCore.Functions.SpawnVehicleClient(VehicleModel, function(vehicle)
if Data.tuning then
QBCore.Functions.SetVehicleProperties(vehicle,Data.tuning)
end
SetVehicleEngineOn(vehicle,true,true,false)
SetVehicleLights(vehicle,2)
table.insert(SpawnedVehicles,vehicle)
RequestModel(`mp_m_freemode_01`)
local ped = CreatePedInsideVehicle(vehicle --[[ Vehicle ]],4 --[[ integer ]],`mp_m_freemode_01` --[[ Hash ]],-1 --[[ integer ]],true --[[ boolean ]],true --[[ boolean ]])
SetEntityVisible(ped, false)
table.insert(SpawnedNPC,ped)
SetVehicleNumberPlateText(vehicle, 'dv2012')
TriggerEvent('marioeqk_kola:StartRecording',{
model = GetHashKey(VehicleModel),
routeName = Data.routeNameExit,
routeId = 1,
vehicle = vehicle,
ped = ped,
})
Wait(5300)
DeleteNPC()
DeleteVehicles()
end, Data.spawncoords, Data.heading)
else
QBCore.Functions.SpawnVehicleClient(VehicleModel, function(vehicle)
if Data.tuning then
QBCore.Functions.SetVehicleProperties(vehicle,Data.tuning)
end
SetVehicleEngineOn(vehicle,true,true,false)
SetVehicleLights(vehicle,2)
table.insert(SpawnedVehicles,vehicle)
RequestModel(`mp_m_freemode_01`)
local ped = CreatePedInsideVehicle(vehicle --[[ Vehicle ]],4 --[[ integer ]],`mp_m_freemode_01` --[[ Hash ]],-1 --[[ integer ]],true --[[ boolean ]],true --[[ boolean ]])
SetEntityVisible(ped, false)
table.insert(SpawnedNPC,ped)
SetVehicleNumberPlateText(vehicle, 'dv2012')
TriggerEvent('marioeqk_kola:StartRecording',{
model = GetHashKey(VehicleModel),
routeName = Data.routeName,
routeId = Data.routeId,
vehicle = vehicle,
ped = ped,
})
end, Data.spawncoords, Data.heading)
end
en