> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cc-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Drop the resource in, run three SQL migrations, ensure after the dependencies.

## Requirements

* A FiveM server running [ox\_lib](https://github.com/overextended/ox_lib) and [oxmysql](https://github.com/overextended/oxmysql).
* A working `cc_lib` resource (provides Core, Groups, Inventory, Target, and TaskUI wrappers).
* Optional: [cc\_minigames](/cc_minigames/index) if you want the default training sandbox entries to work.

## Steps

<Steps>
  <Step title="Place the resource">
    Copy the `cc_heistcontracts` folder into a resources directory the server already loads. The repo ships under `resources/[cc]/cc_heistcontracts/`.
  </Step>

  <Step title="Install the database schema">
    `config.autoInstallDatabase` in `shared/config.lua` is `true` by default — the resource auto-runs `sql/install.sql` on first start and creates the `heist_profiles` table if it doesn't exist. Leave it on for a hands-off install.

    If you'd rather apply the schema yourself, set `config.autoInstallDatabase = false` and run the file manually:

    ```bash theme={null}
    mysql your_db < sql/install.sql
    ```

    Or paste it into your MySQL client.
  </Step>

  <Step title="Ensure after the dependencies">
    Order matters in `server.cfg`:

    ```
    ensure oxmysql
    ensure ox_lib
    ensure cc_lib
    ensure cc_minigames
    ensure cc_heistcontracts
    ```

    Heist resources that integrate with `cc_heistcontracts` should declare it as a dependency in their `fxmanifest.lua` so FXServer starts them in the right order:

    ```lua theme={null}
    dependencies {
        'ox_lib',
        'cc_heistcontracts',
        'cc_lib',
    }
    ```

    Without this, a heist resource that boots before `cc_heistcontracts` will hit `SCRIPT ERROR: No such export RegisterContract in resource cc_heistcontracts`.
  </Step>

  <Step title="Register the heist_tablet item">
    The dashboard is opened by using an inventory item, not a key or chat command. With ox\_inventory, the shipped definition is:

    ```lua theme={null}
    heist_tablet = { label = 'Contracts Tablet', weight = 2800, stack = false, },
    ```
  </Step>

  <Step title="Verify in-game">
    Join the server, give yourself a `heist_tablet` (Contracts Tablet) item, and use it from your inventory. The dashboard should open and prompt you to pick an alias. The marketplace starts empty on a fresh boot — listings drip in one at a time on the configured interval (3 minutes by default), so the first contract appears after the first interval has elapsed.

    <Tip>
      Want listings immediately for testing? Lower `config.rotation.dripIntervalMs` in `shared/config.lua` to something like `5 * 1000` (5 seconds) and restart the resource.
    </Tip>
  </Step>
</Steps>
