STG ScriptsDocumentation
Used Vehicle Shop

Installation

Install STG Used Vehicle Shop on your FiveM server in five steps, including the database table.

Used Vehicle Shop

STG Used Vehicle Shop

ESXQBCoreQBOX
View in store

Download the script

Sign in to the Cfx.re portal with the account you used at checkout and download stg-usedvehicleshop from Granted Assets.

Move the resource

Extract the zip and place the stg-usedvehicleshop folder inside the [STG] category folder in your resources directory. Keep the folder name exactly stg-usedvehicleshop.

resources/
└── [STG]/
    ├── stg_lib/
    └── stg-usedvehicleshop/

Install the dependencies

Used Vehicle Shop needs ox_lib, oxmysql and stg_lib. Skip this step if your server already runs them.

Import the database table

Run stg-usedvehicleshop/[SETUP]/stg_usedvehicleshop.sql on your server database, for example with HeidiSQL or phpMyAdmin. It creates the stg_used_vehicles table that holds every listing.

CREATE TABLE IF NOT EXISTS `stg_used_vehicles` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `seller_identifier` VARCHAR(60) NOT NULL,
    `seller_name` VARCHAR(100) NOT NULL,
    `model` VARCHAR(50) NOT NULL,
    `plate` VARCHAR(20) NOT NULL,
    `price` INT NOT NULL DEFAULT 0,
    `note` TEXT,
    `mods` LONGTEXT,
    `spot_index` INT NOT NULL,
    `location` INT NOT NULL DEFAULT 1,
    `km` FLOAT NOT NULL DEFAULT 0,
    `listed_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Players can only list vehicles they own in your framework's vehicle table: player_vehicles on QBCore and QBOX, owned_vehicles on ESX.

Add images for add-on vehicles

The info card shows a picture from stg-usedvehicleshop/web/images/vehicles/. Images for the base game vehicles are included. For an add-on vehicle, add a .png named after its spawn name in lower case, for example mycar.png. Without an image the card simply shows no picture.

Start the script

Make sure [STG] starts after your framework, oxmysql and ox_lib in server.cfg:

ensure oxmysql
ensure ox_lib
# your framework: es_extended, qb-core or qbx_core
ensure stg_lib
ensure [STG]

Then restart the whole server.

Nothing happens or the console shows an error? See Common Errors.

Next steps

Still having trouble?

Open a ticket on our Discord. Our team answers around 15 hours a day.

Get help on Discord

On this page