π[QB] Auto Dealer
Installation Guide for the [QB] Auto Dealer Script!
Step 1 - Ace Permissions
In order to add the dealer jobs to the database, you must first add the Ace Permissions which allow the use of the command /autodealer!!
Below are the common perms needed for QBCore Admin / God. Copy and paste these to the bottom of your server.cfg. You may edit them to your liking. Restart the server.
After successfully adding the ACE Permissions, an Admin or God can use the command in-game to add Auto Dealer jobs to the database when a shop has been created in the config.lua of the script. To do this, type /autodealer [jobName]
Also, be sure that the jobs for the dealerships are added to your QBCore Shared Jobs. Navigate to qb-core/shared/jobs.lua and add new jobs like the PDM job example below:
Step 2 - SQL Uploads
This script was developed for the QBCore Framework and based off of the data that should already be in the database for player_vehicles, however, there is one small change that needs to be made in order for the vehicle financing to work properly.
If you skipped this step, do NOT request support if you have issues!
With the player_vehicles.sql file found in the script, open in your word editor (visual studio code, etc.). If you already have this in your database, the only part you will need to add to the database is the part at the bottom so delete everything above it before executing the sql into the database.
Alternatively, if you know what you are doing when it comes to database stuff, you can directly execute the query below. This adds the purchase_timestamp column to the player_vehicles table if the table already exists with all of the other columns.
Below is the full player_vehicles sql query if needed:
Next,
Locate the display.sql file in the INSTALL folder and upload it into your database.
It is MANDATORY for saving the display vehicle models, vehicle coordinates, rotation state, and color options, as well as a unique VehicleID that is used within the code for creating the vehicles.
Or, you could execute the below code directly:
Step 3 - Credit Metadata
This script uses a credit score system for vehicle financing. In order for the system to work properly, you must add the below information to your QBCore Metadata Table.
Navigate to: qb-core/server/player.lua and insert the following line anywhere around lines 90 to 100: Older QBCore:
It should look something like this:

Latest QBCore:
It should look something like this:
This will give each player a starting credit score of 100. Alternatively, you may adjust to your standards or liking. If your server already uses a Credit Score Meta System, then you can exclude this step and rename the meta table in the config.lua of the script, to your credit metadata.
Bonus Info: If you want to implement the credit system into other scripts, such as when players make a house loan payment, then you can add to their "creditscore" metadata by implementing the below code into other scripts. (Requires Basic Lua Knowledge) This is not something we will be supporting you with.
Step 4 - Dealerships
You should remove qb-vehicleshop as this script alters the database table for player_vehicles. I have not tested it as of yet to see if there is any interference so if you run both scripts, you are doing so at your own risk!
PDM and Ottos Autos have been pre-established, but feel free to make modifications as needed. Should you wish to create additional dealerships, please use the same format as the PDM shop in the Config.lua file. This task requires proficient use of PolyZone. If you're unfamiliar with creating PolyZones, we recommend seeking assistance from an experienced developer (not myself).
The process is relatively straightforward; just refer to the README.md of the PolyZone script for guidance. However, please note that we won't be providing support for setting up PolyZones or explaining the process. Alternatively, you can find an excellent YouTube tutorial on PolyZone creation below:
Step 5 - Vehicles
Next, In the Shared Folder of this script, there is a vehicles.lua file. Your task is to review each vehicle and set the pricing based on your server's preferences. The majority of the content is the default from qb-core/shared/vehicles.lua, with the addition of server build 2944 vehicles, which are commented out at the top.
If you have already customized your qb-core/shared/vehicles.lua to your liking, you can simply copy those vehicles and replace the vehicles tables in the vehicles.lua file located in the shared folder of this script. The vehicles must be present in the script's vehicles.lua file for the dealerships to function correctly. It does not utilize the data from qb-core/shared/vehicles.lua.
You have the flexibility to assign, create, or modify the ["category"] = "name" (name only) for any vehicle as you see fit.
Afterward, you can assign these categories to specific dealerships to grant them access to the respective vehicles.
Now,
Navigate to the INSTALL folder of the script and locate the dealertablet.png image. Drag and Drop, or Copy this image into your servers inventory images folder. For example:
QBCore Inventory: qb-inventory/html/images
Ox Inventory: ox_inventory/web/images
Then, Copy the below item to your qb-core/shared/items.lua. This is required in order for the tablet to work.
VEHICLE IMAGES: You can find the Vehicle Images in the html/images folder of this script. In case a vehicle doesn't have an image, or you're introducing custom vehicles, you can take a screenshot of the vehicle and add it to this folder. Afterward, make sure to restart the script so that the vehicle image will be visible in the menus. This way, players will be able to see the vehicle representation when browsing through the available options. Please make sure the image size is no larger than 300x169 to avoid player UI lag.

VEHICLE CATEGORIES: The Vehicle Categories are fully customizable, allowing you to name them according to your preferences. However, to make a category appear, you need to assign it to the appropriate dealership in the Config file.
Please take the time to carefully review the vehicles in the xmmx_autodealer/shared/vehicles.lua file and adjust the prices and categories to suit your server's preferences.
Important: Do not modify the model name of the vehicle as it must remain identical to the legitimate spawn name of the vehicle. This ensures the proper functioning of the script. See the example below for clarity:
[Example] If the legitimate spawn name of a vehicle is "CometSR," you must not change it in the script. However, you can create or modify a category such as ["category"] = "sports" to categorize the "CometSR" under the "Sports" category. Then, make sure to assign the "sports" category to the appropriate dealership in the Config file to display this vehicle in that dealership's menu.


Step 6 - Config File
Last updated