🔑 Vehicle Keys

Access a comprehensive guide that includes a detailed installation process, examples of code, previews of configurations.

INSTALLATION GUIDE

Step 0 - First Steps

Download is_vehiclekeys from CFX Portal and install is_bridge & is_lib.

Step 1 - Adding Lock Pick Item

Navigate to the following file and paste our code.

Overextended Inventory (QBox, ESX):

ox_inventory/data/items.lua

['carlockpick'] = {
    label = "Car Lockpick",
    weight = 1000,
    stack = true,
    close = true,
    description = "Perfect when you forget your keys... or have other plans",
    client = {
        image = "lockpick.png",
        event = "is_vehiclekeys:useLockPick",
    }
},

QBCore:

qb-core/shared/items.lua

Step 2 - Configure Resources

You must read and configure the config.lua file in is_vehiclekeys to meet your needs.

Adding Custom Vehicle

UGo to config.lua and find cfg.Custom. Here, you just need to create an object with the vehicle brand, model, and its logo.

  • vehicle: object

    • make?: string

    • model?: string

    • img?: string("images/yourimg.png" or Direct URL)

Example

Adding Key for Vehicle Class

Go to config.lua and find cfg.VehicleKeysType, where you can set the key type for each vehicle class. The available key types are: new_car, old_car, universal, and bike.

Example

Adding Custom Key

Go to config.lua and find cfg.Custom. Here, you just need to create an object with a specified key.

  • keys: string

Example

Adding Custom Settings for Vehicle

Go to config.lua and find cfg.Custom. Here, you just need to create an object with the specified data.

  • settings: object

    • alarm?: object

      • enabled: boolean

      • activeOnFailLockPick: boolean

      • activeOnSuccessLockPick: boolean

      • activeOnSearchingKeys: boolean

      • activeOnHotwiring: boolean

      • handlePull: boolean

      • toggleLockDeactivate: boolean

      • min: number

      • max: number

    • hotwiring?: object

      • successChance: number(0-100)

      • maxAttempts: number

      • min: number

      • max: number

    • keysearching?: object

      • successChance: number(0-100)

      • rewardChance: number(0-100)

      • rewards: array of objects

        • item: boolean

        • name: string(item name or "cash"/"bank")

        • label?: string

        • count: object

          • min: number

          • max: number

      • min: number

      • max: number

    • lockpick?: object

      • enabled: boolean

      • keyBreakOnSuccess: number(0-100)

      • keyBreakOnFail: number(0-100)

      • minigame: function

        • return: boolean

    • anim_lock?: function

    • anim_unlock?: function

Example

Last updated