Configuration Guide

Welcome to the configuration section of NPC Mechanic. This page will guide you through setting up and customizing the script to fit your server's needs.

lib.locale('en')

cfg = {}

---@type 'auto' | 'qb' | 'esx'
cfg.framework = 'auto'

---@type 'auto' | 'ox_target' | 'qb-target' | false
cfg.target = 'auto'

---@type 'ox_lib' | 'qb' | 'esx' | 'okokNotify' | 'ps-ui'
cfg.notification = 'ox_lib'

---@type 'ox_lib' | 'esx' | 'qb' | 'okokTextUI' | 'jg-textui'
cfg.textUI = 'ox_lib'

---@type 'ox_lib' | 'qb' | 'esx' | false
cfg.progressbar = 'ox_lib'

cfg.interaction = {
    controlId = 38, ---@type number
    text = 'E', ---@type string
    colors = {
        background = { r = 241, g = 93, b = 56, a = 255 }, ---@type { r: number, g: number, b: number, a: number }
        text = { r = 226, g = 232, b = 240, a = 255 }, ---@type { r: number, g: number, b: number, a: number }
    },
}

cfg.npcs = {
    ['mechanic'] = {
        coords = {
            vehicle = vec4(-362.839844, -119.355042, 38.201218, 345.500000), ---@type vector4
            idle = vec4(-357.902222, -120.594521, 38.601257, 75.000000), ---@type vector4
            rack = vec4(-356.260162, -121.034515, 37.701302, 74.999992), ---@type vector4
        },
        model = `mp_m_waremech_01`, ---@type number
        blip = false, ---@type boolean | { sprite: number, color: number, scale: number, label: string }
        label = 'Mechanic', ---@type string
    },
}

cfg.moneyType = 'cash' ---@type string

cfg.prices = {
    repair = {
        engine = 0.2, ---@type number -- damage amount * this value | damage amount can be maximum 1000
        petroltank = 0.1, ---@type number -- damage amount * this value | damage amount can be maximum 1000
        body = 0.1, ---@type number -- damage amount * this value | damage amount can be maximum 1000
        tire = 20, ---@type number -- broken tire * this value
        door = 25, ---@type number -- broken door * this value
        window = 7, ---@type number
    },
    clear = 2, ---@type number -- dirt level * this value | dirt level can be maximum 15
}

cfg.items = {
    wash_cloth = 'rm_washcloth', ---@type string
    engine_repairkit = 'rm_enginerepairkit', ---@type string
}

-- deactivate the sales menu, equate cfg.buy to empty table
cfg.buy = {
    [cfg.items.wash_cloth] = {
        label = 'Wash Cloth', ---@type string
        price = 50, ---@type number
    },
    [cfg.items.engine_repairkit] = {
        label = 'Engine Repairkit', ---@type string
        price = 250, ---@type number
    },
}

cfg.durations = {
    engine = 10, ---@type number -- seconds
    body = 10, ---@type number -- seconds
    windows = 10, ---@type number -- seconds
    door = 10, ---@type number -- seconds
    tyre = 10, ---@type number -- seconds
    clear = 15, ---@type number -- seconds
}

cfg.disableDefaultItems = false ---@type boolean
cfg.removeItemOnUse = true ---@type boolean

cfg.editorCommand = 'mn_editor' ---@type string
cfg.editorAlloweds = {
    -- ['steam:00000000a000a00'] = true,
    -- ['license:0aa00a00a00aa000a000000a00000a00a00aa000'] = true,
    -- ['license2:0aa00a00a00aa000a000000a00000a00a00aa000'] = true,
    -- ['fivem:0000000'] = true,
}

cfg.callMechanicPedModel = `mp_m_waremech_01` ---@type number
cfg.callMechanicVehicleModel = `towtruck2` ---@type number
cfg.callMechanicCommand = 'callmech' ---@type string | false -- If false, the command will be deactivated

cfg.rackModel = `imp_prop_impexp_parts_rack_02a` ---@type number

if not lib.checkDependency('ox_lib', '3.23.1') then print('^3[WARN] ox_lib version 3.23.1 or higher is required for the script to run stably, please update') end

Last updated