okokVehicleShop

YouTube Video

Installation Guide

Execute the following SQL code in your database:

CREATE TABLE `okokvehicleshop_vehicles`(
    `vehicle_name` varchar(255) NOT NULL,
    `vehicle_id` varchar(255) NOT NULL,
    `category` varchar(255) NOT NULL,
    `type` varchar(255) NOT NULL,
    `stock` longtext NULL,
    `unlisted` longtext NULL,
    `min_price` varchar(255) NOT NULL,
    `max_price` varchar(255) NOT NULL,
    `owner_buy_price` varchar(255) NOT NULL
);

CREATE TABLE `okokvehicleshop_shops`(
    `shop_name` varchar(255) NOT NULL,
    `shop_id` varchar(255) NOT NULL,
    `owner` varchar(255) NULL DEFAULT NULL,
    `owner_name` varchar(255) NULL DEFAULT NULL,
    `money` varchar(255) NOT NULL,
    `employees` longtext NULL
);

CREATE TABLE `okokvehicleshop_saleshistory`(
    `shop_id` varchar(255) NOT NULL,
    `vehicle_name` varchar(255) NOT NULL,
    `vehicle_id` varchar(255) NOT NULL,
    `buyer_name` varchar(255) NOT NULL,
    `buyer_id` varchar(255) NOT NULL,
    `price` varchar(255) NOT NULL,
    `date` varchar(255) NOT NULL
);

CREATE TABLE `okokvehicleshop_orders`(
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `shop_id` varchar(255) NOT NULL,
    `shop_type` varchar(255) NOT NULL,
    `vehicle_name` varchar(255) NOT NULL,
    `vehicle_id` varchar(255) NOT NULL,
    `reward` varchar(255) NOT NULL,
    `in_progress` varchar(255) NOT NULL,
    `employee_name` varchar(255) NOT NULL,
    `employee_id` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
);

Importing vehicles to the Vehicle Shop

If importing from the shared/vehicles.lua for QBCore, you must make sure that the "shop" is set as the vehicle shop "type". Here's an example:

You need to check through the config.lua that the Config.Stands section as well as the Config.VehicleshopsCategories also has their "type" set the same. In this case "pdm", like so:

The vehicle "categories" are also important, as these need to be the same in your okokvehicleshop_vehicles table as well, otherwise the shop won't sync the vehicles with their respected categories.

As you can see from the above screenshots, in the okokvehicleshop_vehicles table, there is a category called "supers", and in the config.lua, there is a category called "supercars". This is an example to show that these vehicles will not sync because they are not identical. Whereas if you look at "motorcycles", it's the same in both, so they will work perfectly.

Optional okokScripts that are configured to be used with okokVehicleShop

These do not come included with the script, they are only configured to be used alongside the script, if you have them.

okokTextUI, okokRequests and okokNotify (these are not required, so if you do not wish to use them, look for the setting within the config and set it to false).

For okokNotify it won't be in the config, but in the cl_utils.lua file instead. Change the notification system to the one you use within your server.

RegisterNetEvent(Config.EventPrefix..":notification")
AddEventHandler(Config.EventPrefix..":notification", function(notifyName, text)
    local data = Config.NotificationsText[notifyName]

    exports['okokNotify']:Alert(data.title, text, data.time, data.type)
end)

Adding vehicle images

To add images to the vehicles, simply drop them in the web/img folder with the same id as the vehicle (the images should be in the PNG format).

Setting the Discord Webhook URL (to enable logs)

Navigate to the sv_utils.lua file and paste the webhook URL in the line 5.

How to create a Discord Webhook URL

Server artifacts

Make sure your server artifacts version is above the 5181.

Last updated