📃Config

Config = {}

-- General Settings --
Config.Framework = "qb" -- "qb" or "esx"
Config.Core = "qb-core" -- Your qb-core folder name
Config.Target = "qb" -- "qb" or "ox" or "3dtext"
Config.Inventory = "oldqb" -- "oldqb" or "newqb" or "ox" or "qs" or "tgiann" or "codem" ( open code on s_utils.lua )
Config.EmoteMenu = "rp" -- "rp" or "dp" or "scully" or "aty_emote" or "cylex_animmenuv2" or "r_animations" ( open code on config_functions.lua )
Config.Notify = "ox" -- "standalone", "qb" or "okok" or "ox" or "codem" ( open code on config_functions.lua )
Config.Society = "qb-management" -- "qb-management" or "qb-banking" or "okokBanking" or "renewed-banking" ( open code on s_utils.lua )
Config.AutoDatabase = true -- If you set this to true, all the database tables to DB will be done automatically
Config.Language = "en" -- "pt" or "en"
Config.Debug = true -- If true, debug messages will be printed in the console and have some custom commands
Config.InspectionDuration = 30 -- 30 Days ( Real Days )
-- General Settings --

Config.Inspections = {
    [1] = {
        name = "Mechanic Inspection", -- Name of the inspection
        needJob = false, -- If true, the player must have a specific job to access this inspection
        job = "mechanic", -- The job required to access this inspection
        pedLocation = vector4(-200.54, -1309.61, 31.29, 2.28), -- Location of the ped
        pedModel = "s_m_m_autoshop_02", -- Model of the ped
        inspectionPrice = 100, -- Price for the inspection
        useSociety = { 
            use = true, -- If true, the inspection will use the society money
            society = "mechanic", -- The society name to use for the inspection
            amount = 100 -- Amount to deduct from the society money
        },
    },
    [2] = {
        name = "Bennys Inspection", -- Name of the inspection
        needJob = false, -- If true, the player must have a specific job to access this inspection
        job = "bennys", -- The job required to access this inspection
        pedLocation = vector4(456.12, -1017.45, 28.27, 90.0), -- Location of the ped
        pedModel = "s_m_y_construct_01", -- Model of the ped
        inspectionPrice = 200, -- Price for the inspection
        useSociety = { 
            use = true, -- If true, the inspection will use the society money
            society = "mechanic", -- The society name to use for the inspection
            amount = 200 -- Amount to deduct from the society money
        },
    },
    -- You can add more inspections here
}


Config.InspectionParts = {
    [1] = {
        title = "Drive your vehicle for at least 1 minute to check the engine and transmission.",
        icon = "car",
        time = 10, -- Time in seconds to complete the test
        successMessage = "Engine and transmission test passed.",
        failMessage = "Test cancelled or failed."
    },
    [2] = {
        title = "Turn on and off your headlights.",
        icon = "lightbulb",
        successMessage = "Lights test completed successfully.",
        failMessage = "Lights test failed or not performed.",
        customCheck = function(vehicle)
            Notify("[H] - Please turn on and off your headlights.", "info", 7500)
            local wasOn = false
            local wasOff = false

            while true do
                local _, lightsOn, highBeams = GetVehicleLightsState(vehicle)
                if lightsOn == 1 or highBeams == 1 then wasOn = true end
                if lightsOn == 0 and highBeams == 0 then wasOff = true end
                if wasOn and wasOff then return true end
                Wait(200)
            end
        end
    },
    [3] = {
        title = "Brake multiple times to test the brake system.",
        icon = "hand-paper",
        successMessage = "Brake test completed successfully.",
        failMessage = "Brake test failed or not performed.",
        customCheck = function(vehicle)
            Notify("[S] - Press the brake at least 3 times.", "info", 7500)
            local brakesPressed = 0
            local lastPress = false

            while true do
                local pressed = IsControlPressed(0, 72)
                if pressed and not lastPress then
                    brakesPressed = brakesPressed + 1
                end
                lastPress = pressed

                if brakesPressed >= 3 then return true end
                Wait(100)
            end
        end
    },
    [4] = {
        title = "Sound the horn at least 3 times.",
        icon = "bullhorn",
        successMessage = "Horn test passed.",
        failMessage = "You didn't use the horn in time.",
        customCheck = function(vehicle)
            Notify("[E] - Press the horn at least 3 times", "info", 7500)
            local hornPressed = 0
            local lastState = false

            while true do
                local pressed = IsControlPressed(0, 86)
                if pressed and not lastState then
                    hornPressed = hornPressed + 1
                end
                lastState = pressed

                if hornPressed >= 3 then return true end
                Wait(100)
            end
        end
    },
    [5] = {
        title = "Accelerate to 100 km/h and then brake to a complete stop.",
        icon = "tachometer-alt",
        successMessage = "Acceleration and braking test passed.",
        failMessage = "You didn't reach the required speed or stop correctly.",
        customCheck = function(vehicle)
            Notify("Accelerate to 100 km/h and then brake to a complete stop.", "info", 7500)

            local speedLimit = 100.0 -- km/h
            local timeout = 20000
            local startTime = GetGameTimer()

            while GetEntitySpeed(vehicle) * 3.6 < speedLimit do -- If you want mph use 2.23694 instead of 3.6
                if GetGameTimer() - startTime > timeout then
                    return false
                end
                Wait(100)
            end

            while GetEntitySpeed(vehicle) * 3.6 > 1.0 do
                Wait(100)
            end

            return true
        end
    }
}


-- Commands for the script
Config.Commands = {
    myInspections = {
        name = 'myinspections',
        help = 'Check your inspections', 
        restricted = false -- If you want restricted write 'group.admin'
    },
    createInspection = {
        name = 'createinspection',
        help = 'Open inspection menu',
        restricted = 'group.admin'
    }
}

Last updated