Dealership

How to Install

1) Import the import.sql file to your database. 2) Go to Categories folder and edit all the vehicles prices and default stock values. 3) Add the resource to your server and setup your Framework in config/_config.lua. 4) Start your server, the script will start to import all the vehicles from categories folder to your database automatically. 5) Go to config/_dealerships.lua and edit the dealerships, by default the vehicle dealership comes configured for Gabz PDM, make sure to change coords if you have a different map. Optional: Add your Discord Webhook for logs in server/framework/framework.lua Note: You need the server build 2372 (Tuners DLC or newer) enabled in your server.

Add Categories

  • You can create custom categories for example VIP vehicles, addon vehicles, boats, etc.
  • Simply add the vehicle inside the av_dealership table in your database, place the spawn name, price, category name and stock.
  • You can use the command dealership:refresh to retrieve all the vehicles from database in case you have made any modification like prices, stock, etc without restarting the script/server.

Add more vehicles

  • If you already started the script for the first time, go to your database > table av_dealership and add the new vehicles from there. If the table av_dealership is empty, go to categories folder and add the vehicle in the category.lua you want, start the server and all the vehicles will be imported automatically into database.

Photobooth

The script includes a built in function to take pictures of the vehicles automatically: You need screenshot-basic 1) Add your vehicle models inside photobooth/vehicles.lua. 2) Create a hidden channel in your Discord server and generate a webhook, paste that webhook in server/photobooth.lua > line 2 to host the images. 3) Restart the script. 4) Use command /dealership:photo [type] where type can be: vehicle, boat or helicopter, depending of the type of vehicle the script will use a predefined coords. 5) Restart the script.

Change 3D Text to Target Zones

  • First you have to disable the Text3D option from _config.lua
  • Create your box zone and make sure to send the key index of the dealership as an argument, like this example using qb-target:
CreateThread(function()
exports['qb-target']:AddBoxZone("PDMDealership1", vector3(-40.65, -1094.7, 27.27), 0.45, 0.35, {
name = "PDMDealership1",
heading = 294.65,
debugPoly = false,
minZ = 27.0,
maxZ = 29.0,
}, {
options = {
{
type = "client",
event = "av_dealership:target",
icon = "fas fa-sign-in-alt",
label = "Dealership",
name = "pdm_dealership" -- This is the key index name from _dealerships.lua
},
},
distance = 2.5
})
end)
Last modified 3mo ago