โš ๏ธImportant Notes

Upon performing all the steps mentioned before, you can witness a folder data with all the vehicles informations same like vehicles.lua for qb-core.

Here You can go both way on adding new vehicles:

  1. You can add new vehicles directly to data folder in the mm_dealership and vehicles.lua in QBCore

If you do it this, way you dont have to modify any vehicles.lua dependent scripts. Just update new vehicles to both Dealership Script and QBCore

  1. You can add new vehicles to mm_dealership only.

If you follow this Process, then you need to add these sets of line for all the script which requires QBCore.Shared.Vehicles data, to update the vehicle list

Client Side Event to Update QBCore.Shared.Vehicles

RegisterNetEvent('Dealership:Client:UpdateVeh', function(data)
    QBCore.Shared.Vehicles = data
end)

Server Side Event to Update QBCore.Shared.Vehicles

RegisterNetEvent('Dealership:Server:UpdateVeh', function(data)
    QBCore.Shared.Vehicles = data
end)

Events are used to update vehicles.lua for scripts which starts before mm_dealership

Export to Update QBCore.Shared.Vehicles

local vehicles = exports.mm_dealership.GetVehicles()
QBCore.Shared.Vehicles = vehicles

Exports are used to update vehicles.lua for scripts which starts after mm_dealership

Last updated