Full View config.lua

Preview File Updated: v2.0.0 - 20.04.2024

Config = {}

------------------------------ █▀ █▀▄ ▄▀▄ █▄ ▄█ ██▀ █   █ ▄▀▄ █▀▄ █▄▀ ------------------------------
------------------------------ █▀ █▀▄ █▀█ █ ▀ █ █▄▄ ▀▄▀▄▀ ▀▄▀ █▀▄ █ █ ------------------------------
Config.Core = "ESX" -- "ESX" / "QB-Core"
Config.CoreExport = function()
    if Config.Core == "ESX" then
        return exports['es_extended']:getSharedObject()
    elseif Config.Core == "QB-Core" then
        return exports['qb-core']:GetCoreObject()
    end
end

Config.Notification = function(message, time, type)
    if type == "success" then
        if GetResourceState("vms_notify") == 'started' then
            exports['vms_notify']:Notification("TUNING", message, time, "#36f230", "fa-solid fa-screwdriver-wrench")
        else
            TriggerEvent('esx:showNotification', message)
            TriggerEvent('QBCore:Notify', message, 'success', time)
        end
    elseif type == "error" then
        if GetResourceState("vms_notify") == 'started' then
            exports['vms_notify']:Notification("TUNING", message, time, "#f23030", "fa-solid fa-screwdriver-wrench")
        else
            TriggerEvent('esx:showNotification', message)
            TriggerEvent('QBCore:Notify', message, 'error', time)
        end
    elseif type == "info" then
        if GetResourceState("vms_notify") == 'started' then
            exports['vms_notify']:Notification("TUNING", message, time, "#4287f5", "fa-solid fa-screwdriver-wrench")
        else
            TriggerEvent('esx:showNotification', message)
            TriggerEvent('QBCore:Notify', message, 'primary', time)
        end
    end
end

Config.Hud = {
    Enable = function()
        DisplayRadar(true)

        if GetResourceState('vms_hud') ~= 'missing' then
            exports['vms_hud']:Display(true)
        end
    end,
    Disable = function()
        DisplayRadar(false)
        
        if GetResourceState('vms_hud') ~= 'missing' then
            exports['vms_hud']:Display(false)
        end
    end
}

Config.Interact = {
    Enabled = false,
    Open = function(message)
        exports["interact"]:Open("E", message) -- Here you can use your TextUI or use my free one - https://github.com/vames-dev/interact
    end,
    Close = function()
        exports["interact"]:Close() -- Here you can use your TextUI or use my free one - https://github.com/vames-dev/interact
    end
}


-- @PlayerLoaded:  ESX: "esx:playerLoaded" / QB-Core: "QBCore:Client:OnPlayerLoaded"
Config.PlayerLoaded = "esx:playerLoaded"

-- @PlayerLogoutServer: ESX: "esx:playerDropped" / QB-Core: "QBCore:Server:OnPlayerUnload"
Config.PlayerLogoutServer = "esx:playerDropped"

-- @PlayerSetJob:  ESX: "esx:setJob" / QB-Core: "QBCore:Client:OnJobUpdate"
Config.PlayerSetJob = "esx:setJob"


------------------------ █▄ ▄█ ▄▀▄ █ █▄ █   ▄▀▀ ██▀ ▀█▀ ▀█▀ █ █▄ █ ▄▀  ▄▀▀ ------------------------
------------------------ █ ▀ █ █▀█ █ █ ▀█   ▄██ █▄▄  █   █  █ █ ▀█ ▀▄█ ▄██ ------------------------

-- @UseProgressbar: If you want to use a progress bar for part installation, you can do so below.
Config.UseProgressBar = false

-- @UseSkillbar: If you want to use the skill bar to install parts, you can do so below.
Config.UseSkillbar = false

-- @UseTarget: Do you want to use target system
Config.UseTarget = false
Config.TargetResource = 'ox_target' -- 'ox_target' / 'qb-target'
Config.UseTargetSystemForBossMenu = false

-- @Menu: Menu that will appear to the mechanic if the player sends a tuning request
Config.Menu = 'esx_context' -- 'esx_menu_default' / 'esx_context' / 'qb-menu' / 'ox_lib'
Config.ESXMenuDefault_Align = 'right'
Config.UseCustomQuestionMenu = false -- if you want to use for example vms_notify Question Menu, set it true, if you want to use default menu from Config.Menu set it false

-- @AutoExecuteQuery: Automatic execution of the creation of the vms_business table in database
Config.AutoExecuteQuery = true


Config.KeyToAccess = 38 -- E

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

Config.Markers = {
    part = {
        id = 21,
        size = vec(0.4, 0.4, 0.4),
        rotation = {0.0, 0.0, 0.0},
        color = {r=87, g=60, b=250, a=120},
        bobUpAndDown = false,
        rotate = true,
        distanceToSee = 25.0,
        distanceToAccess = 1.0
    },
    installation = {
        id = 20,
        size = vec(0.35, 0.35, 0.35),
        rotation = {0.0, 180.0, 0.0},
        color = {r=87, g=60, b=250, a=120},
        bobUpAndDown = false,
        rotate = true,
        distanceToSee = 25.0,
        distanceToAccess = 1.0
    },
    talkWithNpc = { -- talk with npc marker from missions
        id = 20,
        size = vec(0.28, 0.28, 0.28),
        rotation = {0.0, 180.0, 0.0},
        color = {r=50, g=207, b=91, a=185},
        bobUpAndDown = false,
        rotate = true,
        distanceToSee = 25.0,
        distanceToAccess = 1.0
    },
    collectMoney = { -- Collect Money marker from missions
        id = 29,
        size = vec(0.28, 0.28, 0.28),
        rotation = {0.0, 0.0, 0.0},
        color = {r=50, g=207, b=91, a=185},
        bobUpAndDown = false,
        rotate = true,
        distanceToSee = 25.0,
        distanceToAccess = 1.0
    },
    returnVehicle = { -- Return vehicle marker from missions
        id = 1,
        size = vec(1.2, 1.2, 1.2),
        rotation = {0.0, 0.0, 0.0},
        color = {r=50, g=207, b=91, a=185},
        bobUpAndDown = false,
        rotate = false,
        distanceToSee = 25.0,
        distanceToAccess = 1.0
    },
}

-- @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

-- @ForMotorcyclesOnlyMotoWheels: When a player wants to tune the wheels of a motorcycle, he will only be able to choose from the 'Motorcycle' section, because by using other types of rims, there may be problems for motorcycles
Config.ForMotorcyclesOnlyMotoWheels = true

-- @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,
        oldESX = false, -- oldESX only for ESX which use essentialmode script.
        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,
        oldESX = false, -- oldESX only for ESX which use essentialmode script.
        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

-- @RequestMoneyToTunerPercent: Do you want the tuner to receive a % from request of tuning a vehicle?
Config.RequestMoneyToTunerPercent = 5

-- @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

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,
            -- options = {
            --     ['bossmenu'] = true,
            --     ['discounts'] = true
            -- }
        },
        whitelist = { -- https://docs.vames-store.com/assets/vms_tuning/guides/
            vehicleClasses = {
                [0] = true, -- Compacts
                [1] = true, -- Sedans
                [2] = true, -- SUVs
                [3] = true, -- Coupes
                [4] = true, -- Muscle
                [5] = true, -- Sports Classics
                [6] = true, -- Sports
                [7] = true, -- Super
                [8] = true, -- Motorcycles
                [9] = true, -- Off-road
                -- [10] = true, -- Industrial
                -- [11] = true, -- Utility
                [12] = true, -- Vans
                [13] = true, -- Cycles
                -- [14] = true, -- Boats
                -- [15] = true, -- Helicopters
                -- [16] = true, -- Planes
                -- [17] = true, -- Service
                [18] = true, -- Emergency
                -- [19] = true, -- Military
                [20] = true, -- Commercial
                -- [21] = true, -- Trains
                -- [22] = true, -- Open Wheel
            },
            -- indexedColors = {},
            -- menus = {},
            -- parts = {},
            -- actions = {},
        },
        blacklist = { -- https://docs.vames-store.com/assets/vms_tuning/guides/
            -- vehicleClasses = {},
            -- indexedColors = {
            --     ['chameleon'] = true,
            -- },
            -- 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 only if you are using esx_society/qb-management | example: 'society_mechanic',
        
        job = 'mechanic', -- not required if you want to use this public.
        grades_access = {'recruit', 'employee', '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'}
    },
    ['BennyS-Paintshop'] = {
        -- BennyS: Interior Benny'S.
        blip = {
            enabled = false,
        },
        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
        },
        whitelist = {
            -- vehicleClasses = {},
            -- indexedColors = {},
            menus = {
                ['visual'] = true, 
                ['paint'] = true,
                ['color1'] = true, 
                ['color2'] = true, 
            },
            parts = {
                ['color1'] = true, 
                ['color2'] = true, 
                ['pearlescentColor'] = true, 
                ['paintType1'] = true, 
                ['paintType2'] = true
            },
            -- actions = {}
        },
        blacklist = {
            -- vehicleClasses = {},
            -- indexedColors = {},
            -- menus = {},
            -- parts = {},
            actions = {
                ['repair'] = true
            },
        },
        points = {
            vector3(-200.73, -1324.29, 29.71),
        },

        client_can_select_tuning = false,
        
        send_bill_to_player = true,

        pay_from_society_money = false,
        society_name = nil,

        job = 'mechanic', -- not required if you want to use this public.
        grades_access = {'recruit', 'employee', 'boss'},
    },
}

Last updated