> For the complete documentation index, see [llms.txt](https://zloma-scripts.gitbook.io/zloma-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zloma-scripts.gitbook.io/zloma-scripts/zloma_keys-free-escrow/installation.md).

# Installation

## Requirements

Start these resources before `zloma_keys`:

```cfg
ensure ox_lib
ensure oxmysql
ensure zloma_core
ensure zloma_keys
```

Optional hotwire dependency:

```cfg
ensure ez_electricminigame
```

If `ez_electricminigame` is missing, hotwire uses the built-in `ox_lib` fallback automatically.

`zloma_keys` also expects:

* `zloma_core` keys/inventory wrappers to be working on your framework
* a supported target resource only if you enable `Config.UseTarget`
* a supported dispatch resource only if you enable police alerts

## Inventory Item

Create a `keys` item in your inventory.

### ox\_inventory

```lua
['keys'] = {
    label = 'Vehicle Key',
    weight = 15,
    stack = false,
    close = true,
    description = 'Key for vehicle',
    client = {
        export = 'zloma_keys.useKey'
    }
}
```

### qb-inventory / ps-inventory / qs-inventory

```lua
['keys'] = {
    ['name'] = 'keys',
    ['label'] = 'Vehicle Key',
    ['weight'] = 0,
    ['type'] = 'item',
    ['image'] = 'keys.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Physical vehicle key'
},
```

Add `keys.png` to the image folder used by your inventory.

The key item must preserve metadata, because plate/model/label data is stored on the item itself.

## Start Order

Recommended order:

```cfg
ensure ox_lib
ensure oxmysql
ensure zloma_core
ensure ez_electricminigame
ensure zloma_keys
```

`ez_electricminigame` can be omitted if you want to rely only on the fallback.

If you use a separate dispatch resource, make sure it is already running before `zloma_core`, so alert detection resolves correctly.

## First Test Checklist

1. Spawn a vehicle and give yourself a key.
2. Test lock and unlock with the configured keybind.
3. Use the key item from inventory near the vehicle.
4. Sit in a vehicle without keys and verify hotwire starts.
5. Aim at an NPC driver with a supported weapon and verify carjack works.
6. Confirm police alerts reach your dispatch system through `zloma_core` dispatch detection.
7. Test one owned database vehicle and one non-owned vehicle if `Config.OwnedVehiclesNeedKeys = false`, because those two paths behave differently by design.

## Common Notes

* Current shipped default locale is `hr`.
* If `ez_electricminigame` is unavailable, the resource automatically falls back to `ox_lib` skill checks without additional config.
* Hotwire and ownership state use short-lived caches, so when testing config changes it is safer to re-enter the vehicle than to rely on the previous state staying current.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zloma-scripts.gitbook.io/zloma-scripts/zloma_keys-free-escrow/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
