> 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/gangs/cuxial-gang/installation.md).

# Installation

Install Cuxial Gang step by step: dependencies, items, convars, staff permission and start order.

Cuxial Gang needs no SQL import. It creates and updates its own tables on every start. You only add the items and the staff permission.

{% stepper %}
{% step %}

## Check the dependencies

These resources must be installed and working first:

* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, connected to QBox or QBCore
* OneSync enabled on the server
* `ox_inventory` and a target resource supported by the bridge

{% hint style="warning" %}
Cuxial Gang requires `ox_inventory`. Organization stashes, extra stashes, supply points, raids on a stash and searching a player are built on it.
{% endhint %}

Optional resources are listed in the [Overview](/scripts/gangs/cuxial-gang.md#requirements). Install the ones you want before starting Cuxial Gang.
{% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_gang` folder inside your `resources` directory. Keep the folder name as it is.
{% endstep %}

{% step %}

## Database

Nothing to run. On start, the resource creates every `cuxial_gang_*` table and the two `cuxial_extort_*` tables, and adds three columns to `player_vehicles`: `gang`, `configName` and `vehicleid`.

{% hint style="info" %}
The database user needs permission to create and alter tables.
{% endhint %}
{% endstep %}

{% step %}

## Add the items

Add these items to your inventory. Names can be changed in the file shown in the last column; labels, weights and images are up to you.

| Item                                                                                          | Used for                                          | Name set in            |
| --------------------------------------------------------------------------------------------- | ------------------------------------------------- | ---------------------- |
| `spray_can`                                                                                   | Paint a graffiti                                  | `data/graffiti.lua`    |
| `spray_remover`                                                                               | Remove a graffiti                                 | `data/graffiti.lua`    |
| `burnerphonedrug`                                                                             | Call a buyer to sell drugs                        | `data/drugselling.lua` |
| `crime_tablet`                                                                                | Open the tablet, only with `tablet.asItem = true` | `shared/config.lua`    |
| `arsenal_blueprint`                                                                           | Blueprint handed out when the arsenal levels up   | `data/arsenal.lua`     |
| `arsenal_barrel`, `arsenal_frame`, `arsenal_spring`, `arsenal_polymer`, `arsenal_electronics` | Arsenal parts                                     | `data/arsenal.lua`     |
| `black_money`                                                                                 | Dirty money                                       | Fixed                  |
| `cash`                                                                                        | Clean money paid out by the laundering route      | Fixed                  |

The drugs listed in `data/drugselling.lua` and the rewards in `data/missions.lua` and `data/airdrop.lua` are examples. Replace them with items that exist on your server.

The resource registers the spray, the remover and the tablet (with `tablet.asItem = true`) as usable items through the bridge, and the burner phone the same way. If your inventory does not pick that up, point the item at the client export instead. With `ox_inventory`:

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

```lua
['spray_can'] = {
    label = 'Spray can',
    weight = 300,
    client = { export = 'cuxial_gang.useSpray' },
},

['spray_remover'] = {
    label = 'Graffiti remover',
    weight = 300,
    client = { export = 'cuxial_gang.useRemover' },
},

['crime_tablet'] = {
    label = 'Tablet',
    weight = 500,
    client = { export = 'cuxial_gang.openCrimeTablet' },
},

['rope'] = {
    label = 'Rope',
    weight = 200,
    client = { export = 'cuxial_gang.openHandcuffsMenu' },
},
```

{% endcode %}

Use one path per item, not both. The `rope` item is optional and only works through its export: it opens the same interaction menu as the key.
{% endstep %}

{% step %}

## Set the convars and the staff permission

All convars are optional.

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

```cfg
# Language of the texts
setr ox:locale "en"

# Discord webhooks: player actions and staff actions
set cuxial_gang_webhook "https://discord.com/api/webhooks/..."
set cuxial_gang_webhook_admin "https://discord.com/api/webhooks/..."

# Steam Web API key, to show staff avatars in the panel
set cuxial_gang_steam_key "YOUR_KEY"

# Debug traces in the console
setr cuxial_gang_debug "0"
```

{% endcode %}

The staff panel and its commands check the ACE named in `admin.ace`, `mod` by default. Grant it to your staff group:

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

```cfg
add_ace group.mod mod allow
add_principal group.admin group.mod
```

{% endcode %}

{% hint style="info" %}
Webhooks and the Steam key go in `server.cfg`, never in `shared/config.lua`. The config only holds the names of the convars.
{% endhint %}
{% endstep %}

{% step %}

## Start the resource

Start Cuxial Gang after its dependencies, your framework and the optional integrations you use:

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

```cfg
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core or qb-core)
ensure ox_inventory
ensure cuxial_bridge
# optional integrations
ensure cuxial_garages
ensure cuxial_medical
ensure cuxial_appearance
ensure cuxial_police
ensure cuxial_gang
```

{% endcode %}
{% endstep %}

{% step %}

## Check that it works

1. Join with a staff account and type `/crimeadmin`. The staff panel opens.
2. Create an organization and place its boss menu point.
3. Type `/setcrimejob <your id> <organization id> boss`. You join as boss.
4. Walk to the boss menu point and open it.
5. Type `/crimetablet`. The tablet opens.
   {% endstep %}
   {% endstepper %}

Next: adjust the script to your server in [Configuration](/scripts/gangs/cuxial-gang/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/gangs/cuxial-gang/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.
