> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/core/cuxial-license/installation.md).

# Installation

Install Cuxial License step by step: dependencies, screencapture, items, convars and start order.

Cuxial License needs one extra resource for the photos, a few inventory items and one convar. It creates its own database tables on first start.

{% stepper %}
{% step %}

## Check the dependencies

These resources must be installed and working before you add the script:

* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, with QBox or QBCore
* `ox_inventory`, to use the cards as items
* A target resource supported by the bridge (`sleepless_interact`, `ox_target` or `qb-target`), for the office NPC

`cuxial_police` and `av_weather` are optional. With `cuxial_police` running, the card shown carries the wanted and dangerous marks of the character. `av_weather` drives the time-of-day selector of the photo session.
{% endstep %}

{% step %}

## Install screencapture

`screencapture` is a free, open-source resource that takes a screenshot of a player's game from the server. Cuxial License uses it to take the photo printed on each card, and will not start without it.

1. Download the latest **release** from [github.com/itschip/screencapture](https://github.com/itschip/screencapture/releases). Take the packaged release, not the source code: the resource must contain the `game/dist` folder.
2. Place the folder in your `resources` directory and keep its name as `screencapture`.
3. Start it before Cuxial License.

{% hint style="info" %}
`screencapture` declares itself as a replacement for `screenshot-basic`, so resources that depend on that one keep working with it. It runs on Node 22: use a recent server artifact.
{% endhint %}
{% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_license` folder inside your `resources` directory.

{% hint style="danger" %}
Keep the folder name `cuxial_license`. The inventory items call the script by that exact name and stop working if you rename it.
{% endhint %}
{% endstep %}

{% step %}

## Database

Nothing to import. The resource creates the tables `cuxial_cards` (card designs) and `cuxial_issued` (issued licences) when it starts.

If your database user cannot create tables, run `sql/install.sql` by hand once.
{% endstep %}

{% step %}

## Add the items

Add these items to `ox_inventory`. The first two are required; `job_badge` and `worker_id` are only needed if another resource of yours hands them out (see [Exports & events](/scripts/core/cuxial-license/developers.md#badge-and-worker-id-items)).

{% code title="ox\_inventory/data/items.lua" %}

```lua
['license_card'] = {
    label = 'License',
    weight = 5,
    stack = false,
    close = true,
    consume = 0,
    description = 'Identity document or license',
    client = {
        export = 'cuxial_license.useLicenseCard',
    },
},

['fake_id'] = {
    label = 'Fake ID',
    weight = 5,
    stack = false,
    close = true,
    consume = 0,
    description = 'Forged document',
    client = {
        export = 'cuxial_license.useFakeId',
    },
},

['job_badge'] = {
    label = 'Job badge',
    weight = 5,
    stack = false,
    close = true,
    consume = 0,
    description = 'Job credential',
    client = {
        export = 'cuxial_license.useJobBadge',
    },
},

['worker_id'] = {
    label = 'Worker ID',
    weight = 5,
    stack = false,
    close = true,
    consume = 0,
    description = 'Work identification',
    client = {
        export = 'cuxial_license.useWorkerId',
    },
},
```

{% endcode %}

{% hint style="warning" %}
`stack = false` is required. Every card stores its own data, so two cards can never share a slot.
{% endhint %}

Every card design is handed out as `license_card` unless you type another item name in the designer (for example `id_card`). Each item name you use needs its own definition with `export = 'cuxial_license.useLicenseCard'`; the designer shows the block ready to copy.

Item images are not included. Add your own to `ox_inventory/web/images/` with the item name (`license_card.png`, `fake_id.png`…).
{% endstep %}

{% step %}

## Set the convars

{% code title="server.cfg" %}

```cfg
# Fivemanage token used to store the photos
set cuxial:fivemanageToken "YOUR_FIVEMANAGE_TOKEN"

# Language (en and es are included)
setr ox:locale "en"
```

{% endcode %}

The photo is uploaded to your Fivemanage account and the card keeps its link. Without a token the script still works, but every card is issued without a photo.

{% hint style="info" %}
The photo is uploaded from the server. Write the token with `set`, not `setr`: it stays on the server and is never sent to the players.
{% endhint %}
{% endstep %}

{% step %}

## Start the resource

Start it after its dependencies, your framework and your inventory:

{% code title="server.cfg" %}

```cfg
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core or qb-core)
ensure ox_inventory
ensure ox_target
ensure cuxial_bridge
ensure screencapture
# optional
ensure cuxial_police
ensure cuxial_license
```

{% endcode %}

Replace the framework and target lines with the ones your server uses.
{% endstep %}

{% step %}

## Check that it works

1. Join with an account that has the `admin` permission of your framework and type `/license`. The management panel opens.
2. Create a card, enable **Charge money** in the last step and save it.
3. Go to the office NPC (the position is in `zones`) and buy the card. The photo studio opens.
4. Capture and submit. The item appears in your inventory.
5. Use the item. The card shows on screen with your photo; press <kbd>E</kbd> to put it away.
   {% endstep %}
   {% endstepper %}

Next: set the jobs, the office and the studio in [Configuration](/scripts/core/cuxial-license/configuration.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/core/cuxial-license/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
