# Installation

### 1. Download

Grab the resource from your customer panel and extract it into your resources folder.

```bash
cd resources/
unzip origen_ilegalv2.zip -d [origen]/origen_ilegalv2
```

### 2. Import the database

The schema is located at `database.sql` in the root of the resource.

```bash
mysql -u your_user -p your_database < [origen]/origen_ilegalv2/database.sql
```

Open HeidiSQL → connect to your database → **File → Load SQL file** → select `database.sql` → press **F9** to execute.

The resource also auto-verifies the schema on every boot using \`server/classes/database.lua\`. If a table or column is missing it will be created automatically. The \`database.sql\` file is the source of truth — keep it in sync if you change the data model.

### 3. Configure

Open `config/general.lua` and set your language:

```lua
Config.Debug    = false
Config.Language = 'en'  -- 'en' | 'es'
```

Optionally open `config_sv.lua` for server-side settings such as Fivemanage logging tokens.

\`config\_sv.lua\` contains sensitive tokens. Do \*\*not\*\* expose its contents in logs or public repositories.

### 4. Register the `ilegal_cad` item

Add the CAD item to your inventory resource item list:

```lua
['ilegal_cad'] = {
    label  = 'Gang CAD',
    weight = 100,
    stack  = false,
},
```

> The first CAD is delivered automatically when a gang is created. Additional units are purchased from the gang dashboard.

### 5. Add to `server.cfg`

Start your **framework** (`es_extended`, `qb-core`, or `qbx_core`), your **inventory** (if you use one of the supported bridges), and any other resources **origen\_ilegalv2** relies on for auto-detection — **target**, **dispatch**, **voice**, etc. — **before** `origen_ilegalv2`. Detection only sees providers that are already running. See Dependencies for the full matrix.

```bash
# Framework + inventory + optional bridges (examples — use your actual resource names)
# ensure qbx_core
# ensure ox_inventory

ensure oxmysql
ensure ox_lib
ensure origen_ilegalv2
```

Load order matters. \`oxmysql\` and \`ox\_lib\` must start \*\*before\*\* \`origen\_ilegalv2\`, and your framework / inventory / bridged resources must start \*\*before\*\* \`origen\_ilegalv2\` so auto-detection can resolve them.

### 6. Verify

Start the server and check the console. On first boot you should see:

```bash
[origen_ilegalv2]
* Framework: qb-core
* Inventory: ox_inventory
* Language: en
* Debug: Disabled
* Version: 1.0.0  Latest Version
```

All detected dependencies print with their active provider name. Any `✗` indicates a missing or non-started resource.

{% hint style="warning" %}
We recommend uploading our script files without using FileZilla, as the upload process may corrupt our scripts. As a recommendation, please use WinSCP or other reliable programs to upload the files.
{% endhint %}


---

# Agent Instructions: 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://docs.origennetwork.store/origen-ilegal/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.
