Configuration

1. Adjust config.lua to your server core

  1. Adjusting the script to your server core

Config.Core = "ESX"
Config.CoreExport = function()
    return exports['es_extended']:getSharedObject()
end

  1. Adjusting the PlayerLoaded trigger from server core to the script

Config.PlayerLoaded = "esx:playerLoaded"

  1. Adjusting the PlayerLogoutServer trigger from server core to the script

Config.PlayerLogoutServer = "esx:playerDropped"

  1. Adjusting the PlayerSetJob trigger from server core to the script

Config.PlayerSetJob = "esx:setJob"

  1. Adjust the Menu to your menu script

Config.Menu = 'esx_context' -- 'esx_menu_default' / 'esx_context' / 'ox_lib'
Config.ESXMenuDefault_Align = 'right'

2. Adjust config.lua to server preferences

Several options are available for interacting with the point

Config.UseMarkers = true
Config.UseText3D = true
Config.UseHelpNotify = true

LoadPricesFromDatabase: You can load vehicle prices from the database to automate the configuration process, but make sure that your database match to the function SV.getPricesFromDatabase in config.server.lua

Config.LoadPricesFromDatabase = false

LiveriesUseCustomNames: When using this option, it will search if a name other than NULL exists, if found, it will display the custom name, otherwise, it will set 'Livery ID' as before.

Config.LiveriesUseCustomNames = true

RemoveGunsTuningMods: Do you want tuning parts that add weapons to the vehicle to be automatically detected and removed from the purchase option

Config.RemoveGunsTuningMods = true

DefaultVehiclePrice: Default price if the vehicle is not defined in Config.Vehicles (config.vehicles.lua)

Config.DefaultVehiclePrice = 50000

UseDiscountCodes: Do you want it to be possible to use the discount code for tuning

Config.UseDiscountCodes = true

DiscountCodeLength: from how many characters the code will be generated

Config.DiscountCodeLength = 12

EnableDiscountsForWorkshops: This allows in the boss-menu to create discount codes for the heads of tuning workshops

Config.EnableDiscountsForWorkshops = true

DiscountCodesPercentages: Percentages available to generate codes in boss menu for player

Config.DiscountCodesPercentages = {5, 10, 15, 20}

DiscountCodesUsablesCount: Number of coupons available to generate codes in player's boss menu

Config.DiscountCodesUsablesCount = {1, 2, 3, 4, 5, 10, 15, 20}

AdminDiscountCodesCommand: Commands for administrators to generate and delete discount codes

Config.AdminDiscountCodesCommand = {
    generate = {
        enabled = true,
        commandName = "generatetuningcode",
        argumentsLabels = {
            [1] = "Code name or 0 - if you want to be random", 
            [2] = "Mechanic Point name or all", 
            [3] = "Percentage of discount", 
            [4] = "Count to use"
        },
        helpLabel = "Generate a discount code for tuning.",
        groups = "admin", -- example: string: "admin" or table: {"admin", "moderator"}
    },
    remove = {
        enabled = true,
        commandName = "removetuningcode",
        argumentsLabels = {
            [1] = "Code name"
        },
        helpLabel = "Remove tuning discount code by name.",
        groups = "admin", -- example: string: "admin" or table: {"admin", "moderator"}
    }
}

UseBuildInCompanyBalance: If you don't want to use the balance built into the Management Menu, set this to false and configure config.server.lua to be compatible with your server, for example a script for banks that may have company accounts

Config.UseBuildInCompanyBalance = true

BillMoneyToSocietyPercent: Do you want the company to receive a % from paid billing of tuning a vehicle?

Config.BillMoneyToSocietyPercent = 80

BillMoneyToTunerPercent: Do you want the tuner to receive a % from paid billing of tuning a vehicle?

Config.BillMoneyToTunerPercent = 20

AddSocietyMoneyForTuningPercent: Do you want the company to receive a % from price of tuning a vehicle?

Config.AddSocietyMoneyForTuningPercent = 10 -- number or false

UseTuningPoints: Do you want to use the points provided by the vms_tuning resource, if you want to use export with another resource set false

Config.UseTuningPoints = true -- true / false

Prepare tuning points accordingly

Described options available for Config.TuningPoints

jobGradesToSet - list of possible grades to be given by the boss/manager in the management menu

client_can_select_tuning - With this option activated, it is recommended to use manual installation by a mechanic, because the player will be able to drive to the tuning point, select the parts he is interested in and pay for them himself, then the nearest mechanic is searched for him to install the parts he has selected.

send_bill_to_player - This option when paying for tuning adds a "BILL" button which allows the mechanic to issue a bill to the customer and he will be the one to make the payment of a given amount

pay_from_society - Payment with company money

society_name - Company account name, e.g. 'society_mechanic'

job - Name of the job that will have access to the ability to interact with tuning points.

grades_access - The names of the grades of jobs that have access to the tuning point, you can set them in a table for several, for example {'gradename', 'gradename2'}, as a string for one grade - 'gradename' or set nil as for each player with job.

manager_grades - managers grades so that the script can identify a player as a manager and grant him additional options in the management menu

bossmenu_grades_access - boss grades so that the script can identify a player as a manager and grant him additional options in the management menu

Config.TuningPoints = {
    ['BennyS'] = {
        -- BennyS: Interior Benny'S.
        blip = {
            enabled = true,
            sprite = 72,
            display = 4,
            scale = 0.85,
            color = 83,
            coords = vec(-222.41, -1329.52, 29.89),
            name = "Tuning",
        },
        marker = {
            enabled = true,
            id = 1,
            size = vec(2.7, 2.7, 0.25),
            color = {r=87, g=60, b=250, a=125},
            rotate = false,
            distanceToSee = 15.0,
            distanceToAccess = 1.9
        },
        markerBossMenu = {
            enabled = true,
            id = 29,
            coords = vector3(-197.97, -1341.61, 34.7),
            size = vec(0.55, 0.55, 0.55),
            color = {r=87, g=60, b=250, a=125},
            rotate = true,
            distanceToSee = 15.0,
            distanceToAccess = 1.3,
        },
        whitelist = {
            -- vehicleClasses = {},
            -- indexedColors = {},
            -- menus = {},
            -- parts = {},
            -- actions = {},
        },
        blacklist = {
            -- vehicleClasses = {},
            -- indexedColors = {},
            -- menus = {},
            -- parts = {},
            -- actions = {},
        },
        points = {
            vector3(-222.41, -1329.52, 29.89),
            vector3(-223.26, -1323.21, 29.89),
        },
        jobGradesToSet = {
            {grade = 'recruit', label = 'Recruit'},
            {grade = 'employee', label = 'Employee'},
            {grade = 'manager', label = 'Manager', needToBeBoss = true}, -- needToBeBoss means that only the boss can give this grade, the manager will not be able to do so
            {grade = 'boss', label = 'Boss', needToBeBoss = true}, -- needToBeBoss means that only the boss can give this grade, the manager will not be able to do so
        },

        vehicleSpawn = vector4(-181.4, -1289.19, 30.3, 175.67),
        
        client_can_select_tuning = false, -- this causes each player to be able to select parts for his vehicle, then when paying, he selects the nearest mechanic who will install all the selected parts for him

        send_bill_to_player = true,

        pay_from_society_money = false, -- Do you want the payment to be made with money from the society, if so, you need to enter the account name in society_name
        society_name = 'society_mechanic', -- Society name will be requiered for pay_from_society_money or for Config.AddSocietyMoneyForTuningPercent or for Config.BillMoneyToSocietyPercent | example: 'society_mechanic',
        
        job = 'mechanic', -- not required if you want to use this public.
        grades_access = {'recruit', 'employee', 'manager', 'boss'}, -- nil for every user with job, string: 'name', table: {'name', 'name2'}
        manager_grades = 'manager', -- string: 'name', table: {'name', 'name2'}
        boss_grades = 'boss', -- string: 'name', table: {'name', 'name2'}
    },
}

3. Adjust config.installationparts.lua to your server preferences

UseHelpUI: For advanced part installation which can prompt the player what they need to do now

Config.UseHelpUI = true

DisableAbilityToRunWithParts: Is the player to be blocked from running with parts in hand?

Config.DisableAbilityToRunWithParts = true

UseManualPartInstallation: Do you want the player to have to manually install each part separately to give the tuning process realism

Config.UseManualPartInstallation = true

UseTargetForPartInstallation: Do you want to use target system for part installation

Config.UseTargetForPartInstallation = false

TeleportToVehicleAfterInstallForMS: Is the player to be teleported to the vehicle for a millisecond, it will not be practically visible and the newly installed part in each player will synchronize

Config.TeleportToVehicleAfterInstallForMS = true

TeleportToVehicleAfterFullInstallation: Is the mechanic to be transported to the vehicle after the installation of all parts is completed so that all Vehicle Properties are loaded

Config.TeleportToVehicleAfterFullInstallation = true

InstallationPartsPoints: Points for workshops to find purchased parts for the installation

Use advanced installation

-- @UseAdvancedEngineInstallation: Advanced engine installation with engine on stand
Config.UseAdvancedEngineInstallation = true

-- @UseAdvancedBrakesInstallation: Advanced brakes installation with jacks
Config.UseAdvancedBrakesInstallation = true

-- @UseAdvancedTransmissionInstallation: Advanced transmission installation with jacks
Config.UseAdvancedTransmissionInstallation = true

-- @UseAdvancedSuspensionInstallation: Advanced suspension installation with jacks
Config.UseAdvancedSuspensionInstallation = true

-- @UseAdvancedEngineSwapInstallation: Advanced engine swap installation with engine on stand
Config.UseAdvancedEngineSwapInstallation = true

-- @UseAdvancedWheelsInstallation: Advanced installation of each wheel separately 
Config.UseAdvancedWheelsInstallation = true

Last updated