Full View config.lua

Preview File Updated: v1.0.1 - 09.10.2023

Config = {}

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

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

Config.Notification = function(message, type)
    if type == "success" then
        exports["vms_notify"]:Notification("BOAT SCHOOL", message, 5000, "#32a852", "fa-solid fa-circle-check")
        -- TriggerEvent('esx:showNotification', message)
        -- TriggerEvent('QBCore:Notify', message, 'success', 5000)
    elseif type == "error" then
        exports["vms_notify"]:Notification("BOAT SCHOOL", message, 5000, "#eb4034", "fa fa-exclamation-circle")
        -- 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_boat'] = {icon = 'far fa-file-alt', label = "Theory Boat (%s$)"},
    ['menu.practical_boat'] = {icon = 'fas fa-ship', label = "Practical Boat (%s$)"},

    ['vehicle_was_damaged'] = "The vehicle was damaged (%s/%s)",
    ['exceeded_error_limit'] = "You've exceeded the error limit, you need to go back to boat school.",
    ['started_practical'] = "You have started the practical exam, follow the examiners instructions.",
    ['complete_practical'] = "Press ~INPUT_CONTEXT~ to complete the practical exam.",

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

    ['the_start_area_is_occupied'] = "The start area is occupied.", -- Config.CheckIsStartAreaIsOccupied

    ['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",

    ['help.disable_engine'] = "Disable engine",
    ['help.attach_rope_to_the_boat'] = "Press ~INPUT_CONTEXT~ attach the rope to the boat",
    ['help.moor_the_boat'] = "Press ~INPUT_CONTEXT~ to moor the boat",
}


-- █▄ ▄█ ▄▀▄ █ █▄ █   ▄▀▀ ██▀ ▀█▀ ▀█▀ █ █▄ █ ▄▀  ▄▀▀
-- █ ▀ █ █▀█ █ █ ▀█   ▄██ █▄▄  █   █  █ █ ▀█ ▀▄█ ▄██
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 = 'boatschoolv2',
                event = 'vms_boatschoolv2:openMenu',
                icon = 'fa-regular fa-file-lines',
                label = "Boat 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.MaxDriveErrors = 1 -- How many maximum errors a player can receive for damaging a vehicle, after this number of errors the exam will be aborted

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

Config.TeleportPlayerAfterExam = false
Config.TeleportPlayerAfterFailExam = true

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", "FR", "ES", "PT"
    PedModel = 'ig_fbisuit_01' -- https://wiki.rage.mp/index.php?title=Peds
}

Config.Licenses = {
    Theory = {name = 'theory_boat', price = 3500, enabled = true},
    Practical = {name = 'practical_boat', price = 17500, enabled = true},
}

Config.Questions = {
    QuestionsCount = 10, -- Number of all questions for the draw pool
    QuestionToAnswer = 10, -- Questions the player will have to answer
    NeedAnswersToPass = 1, -- Number of questions a player must answer correctly to pass the theory exam
}

Config.Tasks = {
    {label = "Start the engine", id = 1}, 
    -- DE: Starte den Motor
    -- FR: Démarre le moteur
    -- ES: Enciende el motor
    -- PT: Liga o motor

    {label = "Collect checkpoints <span>0</span>/5", id = 2}, 
    -- DE: Sammle alle Kontrollpunkte ein <span>0</span>/5
    -- FR: Collecte les points de contrôle <span>0</span>/5
    -- ES: Recolecta los puntos <span>0</span>/5
    -- PT: Coleta os pontos de controlo <span>0</span>/5

    {label = "Avoid obstacles <span>0</span>/6", id = 7}, 
    -- DE: Umfahre die Hindernisse <span>0</span>/6
    -- FR: Évite les obstacles <span>0</span>/6
    -- ES: Evita Los Obstaculos <span>0</span>/6
    -- PT: Esquiva os obstáculos <span>0</span>/6

    {label = "Collect checkpoints <span>0</span>/12", id = 13}, 
    -- DE: Sammle alle Kontrollpunkte ein <span>0</span>/12
    -- FR: Collecte les points de contrôle <span>0</span>/12
    -- ES: Recolecta los puntos <span>0</span>/12
    -- PT: Coleta os pontos de controlo <span>0</span>/12

    {label = "Park the boat", id = 25}, 
    -- DE: Parke das Boot
    -- FR: Gare le bateau
    -- ES: Parquea el Bote
    -- PT: Estaciona o barco

    {label = "Collect checkpoints <span>0</span>/47", id = 26}, 
    -- DE: Sammle alle Kontrollpunkte ein <span>0</span>/47
    -- FR: Collecte les points de contrôle <span>0</span>/47
    -- ES: Recolecta los puntos <span>0</span>/47
    -- PT: Coleta os pontos de controlo <span>0</span>/47
    
    {label = "Park the boat", id = 73}, 
    -- DE: Parke das Boot
    -- FR: Gare le bateau
    -- ES: Parquea el Bote
    -- PT: Estaciona o barco

    {label = "Moor the boat", id = 74}, 
    -- DE: Mache das Boot fest
    -- FR: Amarre le bateau
    -- ES: Amarra el Bote
    -- PT: Amarre o barco
}

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(-332.47, -2792.8, 5.0),
        marker = {
            id = 35, -- 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 = 356,
            display = 4,
            scale = 1.0,
            color = 43,
            name = "Boat School"
        }
    },
    ["return_vehicle"] = {
        marker = {
            coords = vector3(1317.16, 4233.76, 30.65),
            id = 1, -- https://docs.fivem.net/docs/game-references/markers/
            color = {255, 25, 25, 120}, -- R(ed), G(reen), B(lue), A(lpha)
            scale = vec(7.5, 7.5, 3.5),
            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,
            name = "Return Boat"
        }
    }
}

Config.Practical = {
    ['Vehicle'] = 'tropic2', -- https://docs.fivem.net/docs/game-references/vehicle-models/
    ['Marker'] = { -- https://docs.fivem.net/docs/game-references/markers/
        id = 25, 
        size = vec(0.35, 0.35, 0.35),
        rotate = {0.0, 180.0, 0.0},
        rgba = {255, 255, 0, 140},
        rotataing = false
    },
    ['Checkpoint'] = {
        id = 0,
        diameter = 7.0,
        rgba = {0, 255, 0, 175}
    },
    ['Blip'] = { -- https://docs.fivem.net/docs/game-references/blips/
        sprite = 270,
        display = 4,
        scale = 1.0,
        color = 43,
        name = "Point"
    },
    ['SpawnPoint'] = vector4(-327.73, -2802.06, 0.79, 270.23),
}

Last updated