okokDocs
  • About Us
  • Scripts
    • okokVehicleControl
      • Config file
    • okokMechanicJob
      • Config file
    • okokPoliceJob
      • Config file
      • qb-inventory support
    • okokBossMenu
      • Config file
    • okokMulticharacter
      • Config file
    • okokPhone
    • okokSpawnSelector
      • Config file
      • qb-multicharacter support
    • okokLoadingScreen
      • Config file
    • okokVehicleSales
      • Config file
    • okokShop
      • Config file
    • okokGasStation
      • Config file
    • okokTuning
      • Config file
    • okokGarage
      • Config file
      • RGB vehicle colors
      • Inventories metadata
      • Housing integrations
      • qb-phone support
    • okokVehicleShop
      • Config file
      • Common errors
    • okokBanking
      • Config file
      • Paycheck transactions
      • Registering transactions
    • okokMarketplace
      • Config file
      • Common errors
    • okokChat
      • Config file
      • Export
    • okokBilling
      • Config file
      • Snippets
    • okokCrafting
      • Config file
    • okokContract
      • Config file
    • okokTalkToNPC
      • Config file
    • okokReports
      • Config file
    • okokNotify
      • Config file
      • Snippets
    • okokTextUI
      • Config file
      • Snippets
    • okokRequests
    • okokDeleteVehicles
      • Config file
  • Others
    • Discord Webhook
Powered by GitBook
On this page
  • Installation Guide
  • Importing vehicles to the Vehicle Shop
  • Optional okokScripts that are configured to be used with okokVehicleShop
  • Adding vehicle images
  • Setting the Discord Webhook URL (to enable logs)
  • Server artifacts
  1. Scripts

okokVehicleShop

Previousqb-phone supportNextConfig file

Last updated 1 year ago

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.

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.

Server artifacts

Make sure your server artifacts version is above the 5181.

, and (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).

Windows:

Linux:

YouTube Video
okokTextUI
okokRequests
okokNotify
How to create a Discord Webhook URL
https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/
https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/