> For the complete documentation index, see [llms.txt](https://fjsf-scripts.gitbook.io/fjsf-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fjsf-scripts.gitbook.io/fjsf-scripts-docs/scripts/fjsf_armour/configuration-file.md).

# Configuration File

Preview of config.lua file

{% code lineNumbers="true" %}

```lua
Config = {}

Config.Locale = 'en' -- en, es, fr, etc. (make sure to have the corresponding locale file in the locales folder)

Config.EnableDebug = false -- Enable debug print statements for development
Config.EnableDiscordLogs = false -- Enable logging of armour events to Discord, requires Config.DiscordWebhook to be set
Config.DiscordWebhook = '' -- Webhook URL for logging armour events to Discord, example: 'https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz'

Config.HeadshotEffect = true -- Enable camera shake on headshot damage to helmet, shake intensity is based on damage dealt (max shake at 100 damage)
Config.UseHelmetHUD = true -- Show helmet durability on HUD when equipped, requires Config.HUDPosition to be set to a valid position
Config.UseVestHUD = true -- Show vest durability on HUD when equipped, requires Config.HUDPosition to be set to a valid position
Config.HUDPosition = 'center-down' -- 'left-up', 'left-middle', 'left-down', 'center-up', 'center-middle', 'center-down', 'right-up', 'right-middle', 'right-down'

Config.Interaction = {type = '3dtextui', color = '#0561eca9', marker = false} -- textui, 3dtextui, fjsf_3dtextui

-- Custom Notify
--- @param {string} title The title/type of notification (e.g., 'Success', 'Error', 'Info')
--- @param {string} text The message to be displayed in the notification
--- @param {string} type The type of notification. Can be "success", "info", or "error"
Config.Notify = function(title, text, type)
    fjsf.notify({
        text = title,
        description = text,
        position = 'left-up',
        type = type
    })
end

-- Custom TextUI
--- @param {string} message The message to be displayed
--- @param {table} options Additional options like icon, position, size, etc.
Config.ShowTextUI = function(message, options)
    local opts = options or {}
    fjsf.showTextUI(message, {
        icon = opts.icon or 'fa-solid fa-spinner',
        position = opts.position or 'right-middle',
        size = opts.size or 'medium',
        bgColor = opts.bgColor or nil,
        textColor = opts.textColor or nil
    })
end

-- Hide TextUI
Config.HideTextUI = function()
    fjsf.hideTextUI()
end

Config.DefaultSkillCheck = {
    type = 'line', -- line, circle
    repeats = 4, -- number of times the skill check must be completed successfully
    difficulty = 'medium', -- easy, medium, hard, extreme
}

Config.RemoveArmourCommand = 'remarmour' -- Command to remove armour, can be used by players to remove their armour
Config.RemoveHelmetCommand = 'remhelmet' -- Command to remove helmet, can be used by players to remove their helmet

Config.Vests = {
    ['vest_basic'] = {
        durability = 50, -- amount of damage the vest can take before breaking
        useAppearance = true, -- whether to change the player's appearance when equipping this vest, requires a valid model and texture to be set
        returnOnDeath = true, -- whether the vest should be returned to the player on death, if false the vest will be lost on death
        model = 15, -- model ID to use for this vest, can be found in the GTA V model list
        texture = 0, -- texture ID to use for this vest, can be found in the GTA V texture list
        useTime = 3500 -- time in milliseconds it takes to equip the vest, during this time the player cannot perform other actions
    },

    ['vest_tactical'] = {
        durability = 75,
        useAppearance = true,
        returnOnDeath = true,
        model = 18,
        texture = 0,
        useTime = 3700
    },
    ['vest_advanced'] = {
        durability = 100,
        useAppearance = true,
        returnOnDeath = true,
        model = 34,
        texture = 0,
        useTime = 4000
    },
}

Config.Helmets = {
    ['helmet_basic'] = {
        durability = 50,
        useAppearance = true,
        returnOnDeath = true,
        model = 85,
        texture = 0,
        useTime = 2000,
    },
    ['helmet_tactical'] = {
        durability = 75,
        useAppearance = true,
        returnOnDeath = true,
        model = 150,
        texture = 0,
        useTime = 2200,
    },
    ['helmet_advanced'] = {
        durability = 100,
        useAppearance = true,
        returnOnDeath = true,
        model = 123,
        texture = 0,
        useTime = 2500,
    }
}

Config.Plates = {
    ['vest_plate'] = {
        value = 25,
        useTime = 3500,
    }
}
Config.Recipes = {
    vest_plate = {
        product = 'vest_plate', -- the item that will be given to the player on successful crafting
        label = 'Ballistic Plate', -- label to show in the crafting menu
        ingredients = { steel = 8, iron = 7 }, -- list of ingredients required to craft the item, format is {item_name = quantity}
        repairIngredients = {}, -- list of ingredients required to repair the item, format is {item_name = quantity}, if empty the item cannot be repaired
        skillCheck = { type = 'line', repeats = 3, difficulty = 'easy' }, -- skill check to perform when crafting the item, if the player fails the skill check the crafting will fail, format is {type = 'line' or 'circle', repeats = number of checks, difficulty = 'easy', 'medium', 'hard', 'extreme'}
    },
    vest_basic = {
        product = 'vest_basic',
        label = 'Basic Vest',
        ingredients = { vest_plate = 2, rubber = 4 },
        repairIngredients = { vest_plate = 1, rubber = 2 },
        skillCheck = { type = 'line', repeats = 4, difficulty = 'medium' },
    },
    vest_tactical = {
        product = 'vest_tactical',
        label = 'Tactical Vest',
        ingredients = { vest_plate = 3, rubber = 3, plastic = 2 },
        repairIngredients = { vest_plate = 1, rubber = 2, plastic = 1 },
        skillCheck = { type = 'line', repeats = 4, difficulty = 'medium' },
    },
    vest_advanced = {
        product = 'vest_advanced',
        label = 'Advanced Vest',
        ingredients = { vest_plate = 4, rubber = 3, aluminum = 4 },
        repairIngredients = { vest_plate = 2, rubber = 2, aluminum = 2 },
        skillCheck = { type = 'circle', repeats = 4, difficulty = 'hard' },
    },
    helmet_basic = {
        product = 'helmet_basic',
        label = 'Basic Helmet',
        ingredients = { metalscrap = 12, rubber = 4, plastic = 3 },
        repairIngredients = { metalscrap = 5, rubber = 2 },
        skillCheck = { type = 'line', repeats = 3, difficulty = 'medium' },
    },
    helmet_tactical = {
        product = 'helmet_tactical',
        label = 'Tactical Helmet',
        ingredients = { steel = 10, rubber = 5, plastic = 4 },
        repairIngredients = { steel = 4, rubber = 2, plastic = 2 },
        skillCheck = { type = 'line', repeats = 4, difficulty = 'medium' },
    },
    helmet_advanced = {
        product = 'helmet_advanced',
        label = 'Advanced Helmet',
        ingredients = { steel = 12, aluminum = 5, glass = 2, rubber = 3 },
        repairIngredients = { steel = 5, aluminum = 2, glass = 1, rubber = 1 },
        skillCheck = { type = 'circle', repeats = 4, difficulty = 'hard' },
    },
}

Config.RepairStations = {
    {   
        coords = vector3(451.72, -979.53, 30.69), -- coords of the repair station, used for interaction and blip
        distance = 5, -- distance from the coords at which the player can see the interaction marker
        interaction = 3, -- distance from the coords at which the player can interact with the station
        allowedJobs = {'police'}, -- list of jobs that are allowed to use the repair station, if empty all players can use it, {'police', 'ambulance'} or {police = 3, ambulance = 2} for job grade restrictions, in this example police of grade 3 and above can use the station and ambulance of grade 2 and above can use the station
        blip = true, -- whether to show a blip for the repair station on the map
        crafting = {
            'vest_plate', 'vest_basic', 'vest_tactical', 'vest_advanced',
            'helmet_basic', 'helmet_tactical', 'helmet_advanced'
        }, -- list of items that can be crafted at this station, must correspond to a key in Config.Recipes
        repair = {
            'vest_basic', 'vest_tactical', 'vest_advanced',
            'helmet_basic', 'helmet_tactical', 'helmet_advanced'
        }, -- list of items that can be repaired at this station, must correspond to a key in Config.Recipes, if empty no items can be repaired
    },
}
```

{% endcode %}
