> For the complete documentation index, see [llms.txt](https://igris-script.gitbook.io/igris-script/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://igris-script.gitbook.io/igris-script/paid-script/igris-petrole.md).

# Igris Petrole

<figure><img src="https://2862342791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFnkzyjlqOP6UGw1GyN62%2Fuploads%2Fk6l1J6HnPI0x5T5EpOWm%2FPetrole.png?alt=media&amp;token=e5a32ef7-7eee-4c36-923f-8250cfdfbeeb" alt=""><figcaption></figcaption></figure>

A complete oil job for **RedM** servers running the **VORP** framework. Players clock in, harvest crude oil, refine it, fill oil barrels and (optionally) sell them for money.

* **Version:** 1.0.0
* **Framework:** VORP
* **Game:** RedM (rdr3)
* **Store:** <https://igris-script-store.tebex.store/>

***

### 📦 Dependencies

Make sure the following resources are installed and **started before** `igris_petrole`:

| Resource           | Usage                                     |
| ------------------ | ----------------------------------------- |
| `vorp_core`        | Player / character data, job check, money |
| `vorp_inventory`   | Adding / removing items                   |
| `vorp_progressbar` | Harvest progress bar                      |
| `oxmysql`          | Database (required by VORP)               |

### ⚙️ Installation

1. **Download** the resource from your [Cfx.re Keymaster](https://keymaster.fivem.net/) (Granted Assets).
2. **Extract** the `igris_petrole` folder into your `resources` folder.
3. **Import the items** into your database by running the `item.sql` file (see Items).
4. **Add the images** from the `_image` folder to your inventory images folder: `vorp_inventory/html/img/items/`
5. **Add the resource** to your `server.cfg`, **after** the VORP resources:

cfg

```cfg
ensure oxmysql
ensure vorp_core
ensure vorp_inventory
ensure vorp_progressbar

ensure igris_petrole
```

6. **Configure** `config.lua` and `server/webhooks.lua` to your liking.
7. **Restart** your server.

> ✅ When the script starts correctly, you will see `[Igris Petrol Job] Successfully Loaded` in the server console and in the F8 client console.

***

### 🎒 Items

The `item.sql` file adds the following items to the `items` table:

| Item name         | Label                         | Weight | Limit |
| ----------------- | ----------------------------- | ------ | ----- |
| `petrolebrut`     | Petrole Brut (Crude Oil)      | 0.25   | 25    |
| `petroleraffiner` | Petrole Raffine (Refined Oil) | 0.25   | 25    |
| `barilepetrole`   | Baril de Petrole (Oil Barrel) | 0.25   | 25    |

> 💡 You can rename the labels directly in the database (e.g. `Crude Oil`, `Refined Oil`, `Oil Barrel`). If you change the **item names**, also update `Config.Items` in `config.lua`.

***

### 🔄 How it works

1. **Clock in** — Go to the service point and press **SPACE** to start (or stop) working. If `Config.AutorizedJob = true`, only players with the job `Config.JobName` can clock in.
2. **Harvest** — In the harvest zone, hold **SPACE** to collect crude oil (progress bar + animation). ➜ gives `5x petrolebrut`
3. **Process** — In the processing zone, hold **SPACE** to refine the oil (on-screen countdown). ➜ `5x petrolebrut` becomes `5x petroleraffiner`
4. **Barreling** — In the barreling zone, hold **SPACE** to fill a barrel. ➜ `5x petroleraffiner` becomes `1x barilepetrole`
5. **Sell** *(optional)* — In the sell zone, hold **SPACE** to sell a barrel. ➜ `1x barilepetrole` gives `Config.Price`

Zone blips only appear while the player is on duty, and are removed when clocking out.

***

### 🛠️ Configuration (`config.lua`)

#### Job / Permissions

lua

```lua
Config.AutorizedJob = true      -- true = job required to clock in | false = everyone can work
Config.JobName = "petroleus"    -- Name of the required job
```

#### Money

lua

```lua
Config.SellEnabled = false  -- true = enable oil barrel selling
Config.Price = 1000.0       -- Price per barrel
Config.MoneyType = 0        -- 0 = dollar | 1 = gold | 2 = roll
```

#### Utils

lua

```lua
Config.Debug = false    -- Enables the /debugp command (starts the job without clocking in)
Config.DrawTxt = true   -- Shows on-screen text (on duty + timers). false = uses VORP notifications
Config.Freeze = true    -- Freezes the player during actions
```

#### Items & amounts

lua

```lua
Config.Items = {
    petrol_raw   = 'petrolebrut',     -- Crude oil
    petrol_ref   = 'petroleraffiner', -- Refined oil
    oil_barrel   = 'barilepetrole',   -- Oil barrel
}

Config.Counts = {
    petrol_raw   = 5, -- Crude oil given per harvest / required to process
    petrol_ref   = 5, -- Refined oil given per process / required to fill a barrel
    oil_barrel   = 1, -- Barrels given per barreling / sold per sale
}
```

#### Durations (in milliseconds)

lua

```lua
Config.Durations = {
    harvest   = 30000, -- Harvest (30 s)
    process   = 20000, -- Processing (20 s)
    barreling = 20000, -- Barreling (20 s)
}
```

#### Texts / Translations

All in-game texts are in `Config.Text`. The default texts are in French — simply replace them to translate the script.

lua

```lua
Config.Text = {
    service_help  = "~t1~[Oil] ~e~SPACE ~q~to clock in | or stop working",
    in_service    = "~t6~You are on duty. Get to work!",
    out_service   = "~t6~You are no longer on duty",
    still_service = "~t6~You are still on duty",
    no_job        = "~e~You don't have the required job.",

    prompt_harvest = "Harvest oil",
    prompt_process = "Refine oil",
    prompt_barrel  = "Fill oil barrel",
    prompt_sell    = "Sell oil",

    pb_harvest = "Harvesting oil...",

    timer_process = "Refining in progress %s seconds", -- %s = remaining seconds
    timer_barrel  = "Barreling in progress %s seconds",

    blip_company = "Oil Company",
    blip_harvest = "Harvest zone (Oil)",
    blip_process = "Processing zone (Oil)",
    blip_barrel  = "Barreling zone (Oil)",
    blip_sell    = "Sell zone (Oil)",
}
```

> ⚠️ Keep the `%s` in `timer_process` and `timer_barrel`: it is replaced by the remaining seconds.

#### Points / Zones / Blips

Each zone can be moved and resized:

lua

```lua
Config.Points = {
    service = {
        coords = vector3(496.4, 672.9, 121.0), -- Clock-in point
        dist = 1.0,                            -- Interaction radius
        marker = { enabled = true, size = 0.8 },
    },

    companyBlip = {
        enabled = false,                       -- Permanent company blip
        coords = vector3(498.6969, 674.5578, 121.0911),
        sprite = 1264416627,
        scale  = 10.0,
        text   = "blip_company",               -- Key in Config.Text
    },

    harvest = {
        coords = vector3(586.5, 580.6, 110.5),
        dist = 8.3,
        blip = { enabled = true, sprite = 688589278, scale = 0.2, text = "blip_harvest" },
    },

    process = {
        coords = vector3(471.1, 704.2, 117.3),
        dist = 8.3,
        blip = { enabled = true, sprite = 688589278, scale = 0.2, text = "blip_process" },
    },

    barrel = {
        coords = vector3(461.1, 667.1, 116.7),
        dist = 8.3,
        blip = { enabled = true, sprite = 688589278, scale = 0.2, text = "blip_barrel" },
    },

    sell = {
        coords = vector3(2677.1, -858.5, 42.2),
        dist = 8.3,
        blip = { enabled = false, sprite = 688589278, scale = 0.2, text = "blip_sell" },
    },
}
```

| Field          | Description                           |
| -------------- | ------------------------------------- |
| `coords`       | Position of the zone (`vector3`)      |
| `dist`         | Interaction radius in meters          |
| `blip.enabled` | Show / hide the blip                  |
| `blip.sprite`  | Blip icon hash                        |
| `blip.scale`   | Blip size                             |
| `blip.text`    | Key of the blip name in `Config.Text` |

### 📜 Discord logs (`server/webhooks.lua`)

The script can send a Discord embed for every successful action. Paste your webhook URLs:

lua

```lua
IgrisWebhooks = {
    harvest = "https://discord.com/api/webhooks/...", -- Oil collection
    process = "https://discord.com/api/webhooks/...", -- Refining and barreling
    sell    = "https://discord.com/api/webhooks/...", -- Oil barrel sales
}
```

> 💡 Leave a URL empty (`""`) to disable that log. ⚠️ Don't leave the default `"url_webhooks"` value, otherwise an error will be printed in the console on each action.

This file is **server-side only**, so your webhook URLs are never sent to players.

***

### 🐞 Debug

Set `Config.Debug = true`, then use the client command:

```
/debugp
```

It starts / stops all job zones without having to clock in — useful to test your coordinates. **Disable it on a live server.**

***

### ❓ FAQ / Troubleshooting

**I can't clock in, "You don't have the required job" appears.** Your character doesn't have the job set in `Config.JobName`. Set the job with your admin menu, or set `Config.AutorizedJob = false`.

**I don't receive any items.** Check that `item.sql` was imported and that the item names match `Config.Items`. Also make sure the player has enough inventory space / item limit.

**Items have no image in the inventory.** Copy the `.png` files from the `_image` folder into `vorp_inventory/html/img/items/`.

**The progress bar doesn't show / error about `vorp_progressbar`.** Install `vorp_progressbar` and make sure it starts **before** `igris_petrole`.

**The sell zone doesn't appear.** Set `Config.SellEnabled = true`. To show its blip, also set `Config.Points.sell.blip.enabled = true`.

**Which files can I edit?** `config.lua` and `server/webhooks.lua` are open. The other files are protected by escrow.
