> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/multi-framework/ak47_vehiclekeys/config.md).

# Config

Configuration Reference

All settings can be modified in [`config.lua`](file:///f:/Fivem%20Work/%5BAsset-Link%5D/%5Bmulti-framework%5D/ak47_vehiclekeys/config.lua). Below is a comprehensive breakdown of each configuration parameter.

***

### General Settings

| Variable                          | Type      | Default | Description                                                                      |
| --------------------------------- | --------- | ------- | -------------------------------------------------------------------------------- |
| `Config.Locale`                   | `string`  | `'en'`  | Active language locale code (matches file in `locales/`).                        |
| `Config.SignalRadius`             | `number`  | `100.0` | Maximum distance (meters) for key fob signals to reach the vehicle.              |
| `Config.LockNPCVehicles`          | `boolean` | `true`  | When `true`, random NPC-driven or parked ambient vehicles are locked by default. |
| `Config.VirtualNPCKey`            | `boolean` | `true`  | When `true`, players receive a virtual key when hijacking / carjacking an NPC.   |
| `Config.PreventAutoEngineOff`     | `boolean` | `true`  | Keeps the vehicle engine running after the driver exits.                         |
| `Config.EngineOffWithLockVehicle` | `boolean` | `true`  | Automatically shuts off vehicle engine when the vehicle is locked.               |

***

### Commands & Controls

```lua
Config.Commands = {
    givekey = 'givekey',         -- Command to transfer a virtual key
    engine = 'engine',           -- Command to toggle engine
    lockpick = 'lockpick',       -- Command to lockpick a vehicle
    togglevlock = 'togglevlock', -- Command to toggle lock/unlock
}

Config.LockUnlockKey = 'L' -- Default keybind for locking/unlocking
Config.EngineButton = 'G'  -- Default keybind for toggling engine
```

***

### Locksmith Settings

```lua
Config.LockSmith = {
    position = vector3(464.95, -750.57, 27.36), -- World coordinates for Locksmith shop
    heading = 90.0,                              -- NPC facing heading
    pedModel = 's_m_m_autoshop_01',              -- Ped model name
    interactionDistance = 2.5,                   -- Distance in meters to open menu
    blip = { 
        enable = true, 
        sprite = 134, 
        color = 1, 
        name = 'Locksmith', 
        scale = 1.0 
    },
    cost = {
        duplicatekey = 1500,                     -- Price to create duplicate physical key
        changelock = 5000,                       -- Price to change vehicle door lock
    },
}
```

***

### Search & Hotwiring Settings

```lua
Config.VehicleSearchTime = 10                  -- Seconds required to search glovebox
Config.VehicleHotwireTime = 20                 -- Seconds required to hotwire
Config.GetKeyBySearchingGloveboxChance = 25    -- % chance to find key when searching glovebox

Config.HotwireAlert = {
    enable = true,                             -- Trigger police alert on hotwire attempt
    chance = 70,                               -- % chance police are alerted
    playernotify = true,                       -- Notify player if activity was reported
}

Config.HotwireAlarmChance = 100                -- % chance car alarm sounds during hotwire
Config.HotwireSuccessChance = 90               -- % base chance for hotwire success
Config.HotwirePlayerOwnedVehicle = true        -- Allow hotwiring player-owned vehicles

Config.HotwireMinigame = function()
    -- Custom hotwire minigame function (returns true on success, false on fail)
    return math.random(1, 100) <= Config.HotwireSuccessChance
end
```

***

### Lockpicking Settings

```lua
Config.LockPickItem = nil                      -- Item required (e.g. 'lockpick') or nil if none
Config.LockPickBreakChanceOnFail = 70          -- % chance item breaks on failure
Config.EnableLockPickMinigame = true           -- Enable/disable lockpick minigame
Config.LockPickWaitTime = 10                   -- Seconds duration if minigame disabled
Config.LockPickAlarmChance = 100               -- % chance car alarm goes off
Config.LockPickPlayerOwnedVehicle = true       -- Allow lockpicking player-owned vehicles

Config.LockPickMinigame = function()
    -- Native Lib47 Tension minigame integration
    if not Config.EnableLockPickMinigame then return true end
    if Lib47.StartTensionMinigame then
        return Lib47.StartTensionMinigame('momentum', 'easy', {
            icon = 'fa-solid fa-key',
            barSize = 15
        })
    end
    return true
end

Config.LockPickAlert = {
    enable = true,                             -- Trigger police alert on lockpick attempt
    chance = 70,                               -- % chance police are alerted
    playernotify = true,                       -- Notify player if activity was reported
}
```

***

### Carjacking Disabled Weapons

List of weapons that players **cannot** use to threaten NPCs and carjack vehicles:

```lua
Config.DisabledCarjackWeapons = {
    [`WEAPON_UNARMED`] = true,
    [`WEAPON_FLASHLIGHT`] = true,
    [`WEAPON_NIGHTSTICK`] = true,
    [`WEAPON_STUNGUN`] = true,
    [`WEAPON_KNIFE`] = true,
    -- ... and other melee/thrown weapons
}
```

***

### Job & Ignored Vehicles

#### Job Vehicles

Whitelists vehicle models for specified jobs (job members can unlock & drive without needing specific key items):

```lua
Config.JobVehicles = {
    [`police`]    = {'police', 'sheriff'},
    [`sheriff`]   = {'police', 'sheriff'},
    [`ambulance`] = {'ambulance'},
}
```

#### Ignored Vehicles & Classes

Vehicles and vehicle classes that bypass the locking system (always unlocked and drivable):

```lua
Config.IgnoreVehicles = {
    [`bmx`]     = true,
    [`cruiser`] = true,
}

Config.IgnoreClass = {
    [13] = true, -- 13 = Cycles / Bicycles
}
```
