☰ All guides
ESX

6-donatorshop

Vehicle shop for donators: categories for in-game money and for keys that you hand out through Tebex, with test drives and Discord logs.

Resource folder

six_importshop

01Requirements

  • ESX (1.1, 1.2 or Legacy). QB-Core is not supported.
  • oxmysql
  • The tables users and owned_vehicles of ESX.

Good to know

The resource folder is called six_importshop, not six_donatorshop.

02Installation

  1. 01Sign in to the Cfx Portal with the account you bought with and download the script under Granted Assets.
  2. 02Unzip the download and move the folder six_importshop into the resources folder of your server. Keep the folder name and upload every file, including the hidden .fxap.
  3. 03Open config/config.lua and enter your vehicles and positions. Open config/webhooks.lua and enter your Discord webhook.
  4. 04Add ensure six_importshop to your server.cfg, below es_extended and oxmysql.
  5. 05Restart the server (or run refresh and then ensure with the folder name in the server console).

On start the script adds the column Import_Keys to your users table by itself. If the server console shows an SQL error about Import_Keys instead (older versions of the script on MySQL 8), run this once by hand:

sql
ALTER TABLE users ADD COLUMN Import_Keys VARCHAR(255) DEFAULT '{}';

03Commands

Command

/addKey [playerId] [key] [amount]
Gives keys to an online player. key is a name from Config.Shop.Keys, for example Key1. For the groups in Commands.addKey.groups and for the server console.
/removeKey [playerId] [key] [amount]
Takes keys away.
/keys
Shows a player their own keys.

04Selling keys through Tebex

  1. 01Create a package in Tebex for each key stage.
  2. 02Add a game server command to the package: addKey {id} Key1 1. {id} is the player's server ID.
  3. 03Set the command to run only when the player is online. The script can only credit keys to players who are on the server.

Set onlyConsole = true for addKey and removeKey if no admin should be able to hand out keys in-game.

05Configuration

Option

General.newESX
true for ESX Legacy (1.2 and newer), false for old ESX 1.1.
General.shopCoords
Where the shop NPC stands.
General.buyCoords
Where a bought vehicle spawns.
General.testCoords
Where test drives start. A test drive lasts two minutes and ends early when the player leaves the vehicle.
General.ped / General.blip
NPC model and map blip.
Config.bulletin
use = true sends notifications through the resource named in resourceName. Set it to false if you don't run that resource.
Config.Commands
Names, permission groups and onlyConsole for the commands.
Shop.Keys
The key types: name is the internal name used in commands, label is what players see.
Shop.Vehicles.ingame_money
Categories paid with in-game money. Every vehicle has model, label, price, img (picture link) and type.
Shop.Vehicles.keys
Categories paid with keys. key names the key type a vehicle of this category costs. website is the link to your store for this category.

Careful

Every category needs its own id. Two categories with the same id overwrite each other.

›config/config.luaComplete file · 109 lines
config/config.lua
Config = {}

Config.General = {
    newESX = true, -- true if you use the new ESX version

    shopCoords = vector4(268.71987915039, -1155.3666992188, 28.290948867798, 93.042747497559),
    buyCoords = vector4(250.12022399902, -1157.2799072266, 29.18236541748, 91.88256072998),
    testCoords = vector4(1353.0825195312, 628.15649414062, 80.510597229004, 309.92245483398),
    ped = "s_m_m_highsec_01",

    blip = {
        label = "Händler | VIP-Shop",
        sprite = 823,
        scale = 0.8,
        colour = 5,
    },
}

Config.bulletin = {
    use = true, -- True if you use bulletin Notifications
    resourceName = "modern_notify"
}

-- For Tebex you can use the addKey command to add keys to players
Config.Commands = {
    addKey = {
        command = "addKey", -- Command to add keys
        onlyConsole = false, -- Only console can use this command
        groups = {"admin"}, -- Groups that can add keys
    },
    removeKey = {
        command = "removeKey",
        onlyConsole = false,
        groups = {"admin"},
    },
    keys = {
        command = "keys",
    },
}

function Notify(text, type, source)
    if type == "client" then
        ESX.ShowNotification(text)
    elseif type == "server" then
        local xPlayer = ESX.GetPlayerFromId(source)
        xPlayer.showNotification(text)
    end
end

Config.Shop = {
    Keys = {
        { name = "Key1", label = "Stage 1"},
        { name = "Key2", label = "Stage 2"},
        { name = "Key3", label = "Stage 3"},
    },

    Vehicles = {

        ingame_money = { -- Categorys with ingame money currency
            {
                catName = "VIP - Vehicles", -- Category name
                id = 1, -- Category ID (unique!!!)
                website = "https://six-6-services.tebex.io",
                cars = {
                    { model = "t20", label = "Rolls-Royce Spectre", price = 2000000, img = "https://img.gta5-mods.com/q85-w800/images/2024-rolls-royce-spectre-add-on-fivem/c30645-FiveM_b3095_GTAProcess_2024-06-04_18-47-46.jpg", type = "car"},
                    { model = "t20", label = "Trabant 601", price = 5000000, img = "https://img.gta5-mods.com/q85-w800/images/trabant-601-universal-add-on-tuning-template-sound-lods/33911a-prew001.png", type = "car"},
                    -- ...
                }
            },
        },

        keys = { -- Categorys with (Tebex) Keys currency
            {
                id = 3, -- Category ID (unique!!!)
                catName = "Stage 1 - Vehicles", -- Category name
                key = "Key1",
                website = "https://six-6-services.tebex.io",
                cars = {
                    { model = "minijcwgp20", label = "Mini - Chooper GP", img = "https://img.gta5-mods.com/q85-w800/images/mini-john-cooper-works-gp-2020/334362-1.jpg", type = "car"},
                    { model = "minijcwgp20", label = "McLaren 720S", img = "https://img.gta5-mods.com/q85-w800/images/mclaren-720s-liberty-walk-add-on/a31df0-3.png", type = "car"},
                    -- ...

                }
            },
            {
                id = 4,
                catName = "Stage 2 - Vehicles",
                key = "Key2",
                website = "https://six-6-services.tebex.io",
                cars = {
                    { model = "police", label = "2019 Range Rover Velar",img = "https://img.gta5-mods.com/q75-w500-h333-cfill/images/2018-range-rover-velar/8c0bb7-QQ%E5%9B%BE%E7%89%8720190609113942.jpg", type = "car"},
                    { model = "police", label = "Land Rover Range Rover Startech",img = "https://img.gta5-mods.com/q75-w500-h333-cfill/images/land-rover-range-rover-startech/38d093-1.jpg", type = "car"},
                    -- ...
                }
            },
            {
                id = 5,
                catName = "Stage 3 - Vehicles",
                key = "Key3",
                website = "https://six-6-services.tebex.io",
                cars = {
                    { model = "t20", label = "Mini - Chooper GP", img = "https://img.gta5-mods.com/q85-w800/images/mini-john-cooper-works-gp-2020/334362-1.jpg", type = "car"},
                    { model = "t20", label = "Rolls-Royce Spectre", img = "https://img.gta5-mods.com/q85-w800/images/2024-rolls-royce-spectre-add-on-fivem/c30645-FiveM_b3095_GTAProcess_2024-06-04_18-47-46.jpg", type = "car"},
                    -- ...
             }
            },
        },
    }
}
›config/webhooks.luaComplete file · 19 lines
config/webhooks.lua
Config_SV = {}

Config_SV.Webhook = {
    Link = "https://discord.com/api/webhooks/...", -- Your webhook link
    serverName = "6-services",
    serverLogo = "https://message.style/cdn/images/c884d8c6c55bf7118ba4380ed450c5eb0729995c8d5cec16539068244c624853.png",

    Colors = {
        blue = 255,
        red = 16711680,
        green = 65280,
        white = 16777215,
        black = 0,
        orange = 16744192,
        yellow = 16776960,
        pink = 16761035,
        lightgreen = 65309
    }
}

Language and all texts are in config/locals.lua (Config.Language, Config.Locales).

06Still stuck?

Open a ticket on our Discord. Send the script name, your framework and version, and the full error from the server console (F8 for client errors). That saves a round of questions.