Full View config.lua

Preview File Updated: v1.0.9 - 11.01.2024

Config = {}

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

-- @Config.PlayerLoaded for ESX: 'esx:playerLoaded'
-- @Config.PlayerLoaded for QB-Core: 'QBCore:Client:OnPlayerLoaded'
Config.PlayerLoaded = 'esx:playerLoaded'

Config.Notification = function(message, type)
    if type == "success" then
        exports["vms_notify"]:Notification("DRIVE SCHOOL", message, 5000, "#32a852", "fa-solid fa-graduation-cap")
        -- TriggerEvent('esx:showNotification', message)
        -- TriggerEvent('QBCore:Notify', message, 'success', 5000)
    elseif type == "error" then
        exports["vms_notify"]:Notification("DRIVE SCHOOL", message, 5000, "#eb4034", "fa-solid fa-graduation-cap")
        -- TriggerEvent('esx:showNotification', message)
        -- TriggerEvent('QBCore:Notify', message, 'error', 5000)
    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
        -- exports['qb-core']:DrawText(message, 'right')
    end,
    Close = function()
        exports["interact"]:Close() -- Here you can use your TextUI or use my free one - https://github.com/vames-dev/interact
        -- exports['qb-core']:HideText()
    end,
}


-- ▀█▀ █▀▄ ▄▀▄ █▄ █ ▄▀▀ █   ▄▀▄ ▀█▀ ██▀
--  █  █▀▄ █▀█ █ ▀█ ▄██ █▄▄ █▀█  █  █▄▄
Config.Translate = {
    ['open_menu'] = "Press ~INPUT_CONTEXT~ to open the menu",
    ['menu.title'] = {icon = '', label = "Select Exam Type"},
    ['menu.theory_a'] = {icon = 'far fa-file-alt', label = "Theory A (%s$)"},
    ['menu.practical_a'] = {icon = 'fas fa-motorcycle', label = "Practical A (%s$)"},
    ['menu.theory_b'] = {icon = 'far fa-file-alt', label = "Theory B (%s$)"},
    ['menu.practical_b'] = {icon = 'fas fa-car-side', label = "Practical B (%s$)"},
    ['menu.theory_c'] = {icon = 'far fa-file-alt', label = "Theory C (%s$)"},
    ['menu.practical_c'] = {icon = 'fas fa-truck', label = "Practical C (%s$)"},

    ['exceeded_speed_limit'] = "You exceeded the speed limit (%s/%s), Speed Limit is %s kmh",
    ['vehicle_was_damaged'] = "The vehicle was damaged (%s/%s)",
    ['exceeded_error_limit'] = "You've exceeded the error limit, you need to go back to driving school.",
    ['started_practical'] = "You have started the practical exam, follow the examiners instructions.",
    ['complete_theory'] = "Press ~INPUT_CONTEXT~ to complete the theory exam.",

    ['success_practical'] = "Congratulations, you have obtained your driver license.",
    ['failed_practical'] = "Unfortunately, you failed to obtain a driver license.",

    ['the_maneuvering_area_is_occupied'] = "The maneuvering area is occupied.", -- Config.CheckIsManeuveringAreaIsOccupied

    ['not_enough_cash'] = "You don't have enough cash for this exam",
    ['not_enough_cash_and_bank'] = "You do not have enough cash and money in your bank account for this exam",
}


-- █▄ ▄█ ▄▀▄ █ █▄ █   ▄▀▀ ██▀ ▀█▀ ▀█▀ █ █▄ █ ▄▀  ▄▀▀
-- █ ▀ █ █▀█ █ █ ▀█   ▄██ █▄▄  █   █  █ █ ▀█ ▀▄█ ▄██
Config.AccessOnMarker = true -- Do you want to use access to the exam selection menu as E in marker?
Config.UseTarget = false
Config.TargetResource = 'ox_target'
Config.Target = function()
    exports[Config.TargetResource]:addBoxZone({
        coords = vec(Config.Zones["menu"].coords.x, Config.Zones["menu"].coords.y, Config.Zones["menu"].coords.z+0.35),
        size = vec(4.0, 4.0, 4.0),
        debug = false,
        useZ = true,
        rotation = 60,
        distance = 9.0,
        options = {
            {
                name = 'driveschoolv2',
                event = 'vms_driveschoolv2:openMenu',
                icon = 'fa-regular fa-file-lines',
                label = "Drive School"
            }
        }
    })
end


Config.UseSoundsUI = true -- Do you want to use interaction sounds in the UI?
Config.EnableBlur = true -- Do you want to blur the background in the game when you have the UI running?

Config.PossibleChargeByBank = true -- if you set it true, when the player does not have enough cash, it will try to take it from his bank account

Config.EnableMaxSpeedLoop = true
Config.MaxSpeedLoopTimeout = 1000 -- if Config.EnableMaxSpeedLoop = true and exceeds the maximum speed, will have 1 second (1000 milliseconds) to reduce the speed, otherwise another error will be charged
Config.MaxSpeed = 50 -- if you don't want a speed limit set nil
Config.SpeedMultiplier = 3.6 -- kmh = 3.6 / mph = 2.236936

Config.MaxDriveErrors = 5 -- How much maximum a player can get bugs for vehicle damage, on 5 will require going back to driving school and failing the test

Config.CheckIsManeuveringAreaIsOccupied = true -- If the maneuvering area is occupied, the practical exam will not start and the player will receive notification about it

Config.Examiner = {
    Enabled = true, -- Do you want to use a ped as an examiner who sits with the player in the vehicle?
    SpokenCommands = true,
    SpokenLanguage = "EN", -- "EN", "DE", "BG", "ES", "FR", "PT"
    PedModel = 'ig_fbisuit_01' -- https://wiki.rage.mp/index.php?title=Peds
}

Config.AddLicenseItem = false
Config.LicenseItem = "driving_license"

Config.Licenses = {
    Theory = {
        ['A'] = {name = 'theory_a', price = 150, enabled = true},
        ['B'] = {name = 'theory_b', price = 300, enabled = true},
        ['C'] = {name = 'theory_c', price = 450, enabled = true}
    },
    Practical = {
        ['A'] = {name = 'drive_a', price = 2500, enabled = true},
        ['B'] = {name = 'drive_b', price = 4500, enabled = true},
        ['C'] = {name = 'drive_c', price = 6500, enabled = true}
    }
}

Config.Questions = {
    ['A'] = {
        QuestionsCount = 18, -- Number of all questions for the draw pool
        QuestionToAnswer = 18, -- Questions the player will have to answer
        NeedAnswersToPass = 16, -- Number of questions a player must answer correctly to pass the theory exam
    },
    ['B'] = {
        QuestionsCount = 17,
        QuestionToAnswer = 17,
        NeedAnswersToPass = 15,
    },
    ['C'] = {
        QuestionsCount = 5,
        QuestionToAnswer = 5,
        NeedAnswersToPass = 4,
    },
}

Config.Tasks = {
    {label = "Start the engine", id = 1}, 
    -- DE: Starte den Motor
    -- BG: Стартирайте двигателя
    -- ES: Encender el motor
    -- FR: Démarre le moteur
    -- PT: Ligue o Motor
    -- PL: Uruchom silnik

    {label = "Turn on the lights", id = 2}, 
    -- DE: Schalte die Scheinwerfer ein
    -- BG: Включете светлените на автомобила
    -- ES: Enciende las luces
    -- FR: Allume les phares
    -- PT: Ligue as luzes
    -- PL: Włącz światła

    {label = "Get on the elevation", id = 3}, 
    -- DE: Fahre die Rampe hoch
    -- BG: Качете се на височината
    -- ES: Sube a la elevación
    -- FR: Monte sur la plateforme
    -- PT: Dirija-se para a rampa
    -- PL: Wjedź na wzniesienie

    {label = "Park at the rear slant", id = 4}, 
    -- DE: Parke in die Parklücke ein
    -- BG: Паркирайте на задния наклон
    -- ES: Parquea en la inclinación trasera
    -- FR: Gare toi en biais arrière
    -- PT: Estacione de marcha-atrás
    -- PL: Zaparkuj pod skosem tyłem
    
    {label = "Park parallel in front", id = 5}, 
    -- DE: Parke dort in Fahrtrichtung ein
    -- BG: Паркирайте успоредно отпред
    -- ES: Parquea paralelo en el frente
    -- FR: Gare toi en parallèle à l'avant
    -- PT: Estacione paralelamente de frente
    -- PL: Zaparkuj równolegle przodem
    
    -- {label = "ID 6 HAVE NO SPECIAL MANEUVERS", id = 6},
    
    {label = "Park parallel backwards", id = 7}, 
    -- DE: Parke rückwärts ein
    -- BG: Паркирайте успоредно отзад
    -- ES: Parquea paralelo al revés
    -- FR: Gare toi en parallèle à l'arrière
    -- PT: Estacione paralelamente de marcha-atrás
    -- PL: Zaparkuj równolegle tyłem
    
    {label = "Leave the maneuvering area", id = 8}, 
    -- DE: Verlasse den Verkehrsübungsplatz
    -- BG: Напуснете зоната за маневриране
    -- ES: Deja el área de maniobra
    -- FR: Quitte la zone de manœuvre
    -- PT: Saia da zona de manobras
    -- PL: Opuść plac manewrowy
    
    {label = "Get on a public road", id = 9}, 
    -- DE: Fahre auf die Straße
    -- BG: Поставете се на обществен път
    -- ES: Sube a una carretera pública
    -- FR: Emprunte une route publique
    -- PT: Entre na estrada
    -- PL: Wyjedź na drogę publiczną
    
    {label = "Stop before the lanes", id = 10}, 
    -- DE: Halte am Stoppschild
    -- BG: Спрете преди лентaтa за движение
    -- ES: Detente antes de los carriles
    -- FR: Arrête-toi avant le passage piéton
    -- PT: Pare antes da linha
    -- PL: Zatrzymaj się przed pasami
    
    {label = "Free ride <span>0.00</span>km / 2.00km", id = 11},
    
    {label = "Go back to driving school", id = 12}, 
    -- DE: Fahre zurück zur Fahrschule
    -- BG: Върнете се в автошколата
    -- ES: Volver a la escuela de conducción
    -- FR: Retourne à l'école de conduite
    -- PT: Volte para a escola de condução
    -- PL: Wróć do szkoły jazdy
}

Config.Zones = {
    ["menu"] = {
        menuType = "esx_menu_default", -- "esx_menu_default" / "esx_context" / "qb-menu" / "ox_lib"
        menuPosition = 'left', -- only for esx_menu_default and esx_context
        coords = vector3(-893.67, -2402.06, 14.125),
        marker = {
            id = 36, -- https://docs.fivem.net/docs/game-references/markers/
            color = {115, 255, 115, 120}, -- R(ed), G(reen), B(lue), A(lpha)
            scale = vec(0.65, 0.65, 0.65),
            bobUpAndDown = false, -- jumping marker
            rotate = true -- rotating marker
        },
        blip = { -- https://docs.fivem.net/docs/game-references/blips/
            sprite = 778,
            display = 4,
            scale = 1.0,
            color = 43,
            name = "Driving School"
        }
    },
    ["return_vehicle"] = {
        coords = vector3(-890.08, -2377.37, 12.94),
        marker = {
            id = 1, -- https://docs.fivem.net/docs/game-references/markers/
            color = {255, 0, 0, 120}, -- R(ed), G(reen), B(lue), A(lpha)
            scale = vec(1.5, 1.5, 0.75),
            bobUpAndDown = false, -- jumping marker
            rotate = true -- rotating marker
        },
        blip = { -- https://docs.fivem.net/docs/game-references/blips/
            sprite = 467,
            display = 4,
            scale = 1.0,
            color = 2,
            routeColor = 2,
            name = "Return to Drive School"
        }
    }
}

Config.Practical = {
    ['Vehicles'] = { -- https://docs.fivem.net/docs/game-references/vehicle-models/
        A = 'pcj',
        B = 'premier',
        C = 'boxville_vms',
    },
    ['Marker'] = { -- https://docs.fivem.net/docs/game-references/markers/
        id = 20, 
        size = vec(0.35, 0.35, 0.35),
        rotate = {0.0, 180.0, 0.0},
        rgba = {255, 255, 0, 140},
        rotataing = true
    },
    ['Blip'] = { -- https://docs.fivem.net/docs/game-references/blips/
        sprite = 270,
        display = 4,
        scale = 0.8,
        color = 28,
        routeColor = 28,
        name = "Point"
    },
    ['SpawnPoint'] = vector4(-723.38, -2210.23, 4.9, 49.79),
}

Config.PracticalTest = { -- if you don't know what each action does, don't touch it to avoid spoiling the exam route
    [1] = {
        action = function()
            if Config.Examiner.SpokenCommands and driveErrors < Config.MaxDriveErrors then
                SendNUIMessage({action = 'audioTask', filename = string.lower(Config.Examiner.SpokenLanguage)..'_1.mp3'})
            end
            while currentExam and driveErrors < Config.MaxDriveErrors do
                local myPed = PlayerPedId()
                local myVehicle = GetVehiclePedIsIn(myPed, false)
                if GetIsVehicleEngineRunning(myVehicle) then
                    SetVehicleLightsMode(myVehicle, 1)
                    SendNUIMessage({action = 'updateTasks', done = 1})
                    break
                end
                Citizen.Wait(1)
            end
        end
    },
    [...] = {},
}

Last updated