> 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_stance-free-escrow/installation.md).

# Installation

## Requirements

| Resource     | Version | Link                                                 |
| ------------ | ------- | ---------------------------------------------------- |
| `ox_lib`     | Latest  | [GitHub](https://github.com/overextended/ox_lib)     |
| `oxmysql`    | Latest  | [GitHub](https://github.com/overextended/oxmysql)    |
| `zloma_core` | 1.0.0+  | [GitHub](https://github.com/ZlomaScripts/zloma_core) |

**Optional:**

| Resource    | Purpose                                                |
| ----------- | ------------------------------------------------------ |
| `ox_target` | Needed for `Target` and `TargetProp` interaction modes |

***

## Step 1 - Place The Resource

```
resources/
  [zloma]/
    zloma_core/
    zloma_stance/
```

***

## Step 2 - Start Order

Add this to your `server.cfg` in this order:

```cfg
ensure ox_lib
ensure oxmysql
ensure zloma_core
ensure zloma_stance
```

`zloma_core` must start before `zloma_stance`.

If you plan to use `Target` or `TargetProp` mode, make sure `ox_target` is also started before `zloma_stance`.

***

## Step 3 - Database Setup

zloma\_stance uses an automatic schema check on resource start.

On first start it:

* detects whether your server uses ESX, QBCore, or QBox
* picks the correct vehicle table automatically
* creates the `wheels` column if it does not already exist

Framework table mapping:

| Framework | Vehicle Table     |
| --------- | ----------------- |
| ESX       | `owned_vehicles`  |
| QBCore    | `player_vehicles` |
| QBox      | `player_vehicles` |

No SQL import is required.

***

## Step 4 - Configure `config.lua`

The most important first-start settings are:

* `Config.Locale`
* `Config.UseMethod`
* `Config.Command`
* `Config.TargetProp`
* `Config.FitmentZones`

Your interaction method decides what else you need:

| Method       | Extra Requirement | Notes                                               |
| ------------ | ----------------- | --------------------------------------------------- |
| `TextUI`     | None              | Uses an `E` prompt while inside a fitment zone      |
| `Command`    | None              | Registers `/stance` or your custom command          |
| `Target`     | `ox_target`       | Uses a targetable box zone                          |
| `TargetProp` | `ox_target`       | Spawns a prop and attaches target interaction to it |

***

## Step 5 - Configure Zones

Every stance station lives in `Config.FitmentZones`.

Each zone should define:

* `coords` for the actual stance pad area
* `heading` for the pad direction and optional target prop direction
* `radius` for zone detection
* `target.coords` and `target.size` if you use a target-based method
* `price` if you want to store a value for your own logic or future expansion
* `job` if the station should be job-locked
* `allowedIdentifiers` if specific players should be whitelisted

Example:

```lua
Config.FitmentZones = {
    ["mechanic_main"] = {
        coords = vector3(-912.56, -783.78, 14.40),
        heading = 250.19,
        radius = 3.0,
        target = {
            coords = vector3(-910.69, -785.92, 14.60),
            size = vec3(2, 2, 2)
        },
        price = 0,
        job = 'mechanic',
        allowedIdentifiers = {}
    }
}
```

***

## Step 6 - Spawn Integration

If another resource spawns owned vehicles, call the server export after spawn so fitment reapplies immediately:

```lua
exports['zloma_stance']:ApplyOnSpawn(source, netId, plate)
```

This is especially useful for garage systems and dealership delivery flows.

***

## Post-Install Check

After first startup, verify:

* the resource starts without errors
* the `wheels` column exists in your vehicle table
* the stance menu opens at your configured zone
* saved fitment is reapplied after respawning the vehicle

If target interaction does not appear, check that `ox_target` is installed and that `Config.UseMethod` matches your intended interaction style.


---

# 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_stance-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.
