# Weed Type

### Blip

{% hint style="info" %}
Adding blip to the center coordinate of stage zone. `Not required`
{% endhint %}

<table><thead><tr><th width="135">Property</th><th width="104">Type</th><th width="94">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>active</code></td><td>boolean</td><td><code>false</code></td><td>Blip will show or hide</td></tr><tr><td><code>scale</code></td><td>number</td><td><code>0.85</code></td><td>Scale of the blip</td></tr><tr><td><code>color</code></td><td>number</td><td><code>0</code></td><td><a href="https://docs.fivem.net/docs/game-references/blips/#blip-colors">Color of the blip</a></td></tr><tr><td><code>sprite</code></td><td>number</td><td><code>469</code></td><td><a href="https://docs.fivem.net/docs/game-references/blips">Sprite ID of the blip</a></td></tr><tr><td><code>text</code></td><td>string</td><td><code>nil</code></td><td>Text displayed on the blip</td></tr></tbody></table>

### Prop

{% hint style="info" %}
Prop to be added to the pad's hand when playing animation. `Not Required`
{% endhint %}

{% hint style="info" %}
If you want to define multiple props, you can pass them as individual tables (array of objects)
{% endhint %}

<table><thead><tr><th width="146">Property</th><th width="167">Type</th><th>Default</th></tr></thead><tbody><tr><td><code>model</code></td><td>hash</td><td><mark style="color:red;"><code>required</code></mark></td></tr><tr><td><code>bone</code></td><td>number</td><td><code>60309</code></td></tr><tr><td><code>pos</code></td><td>vector3</td><td><mark style="color:red;"><code>required</code></mark></td></tr><tr><td><code>rot</code></td><td>vector3</td><td><mark style="color:red;"><code>required</code></mark></td></tr><tr><td><code>rotOrder</code></td><td>number</td><td><code>0</code></td></tr></tbody></table>

### Animation

{% hint style="info" %}
Defines animation settings for interactions. [Animations](https://forge.plebmasters.de/animations) `Not Required`
{% endhint %}

<table><thead><tr><th width="139">Property</th><th width="96">Type</th><th width="142">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>dict</code></td><td>string</td><td><mark style="color:red;"><code>required</code></mark></td><td>Animation dictionary.</td></tr><tr><td><code>clip</code></td><td>string</td><td><mark style="color:red;"><code>required</code></mark></td><td>Animation clip.</td></tr><tr><td><code>flag</code></td><td>number</td><td><code>0</code></td><td>Animation flag.</td></tr><tr><td><code>prop</code></td><td><a href="#prop">Prop</a></td><td><code>nil</code></td><td>Prop settings for the animation.</td></tr><tr><td><code>scenario</code></td><td>string</td><td><code>nil</code></td><td>Must specify either scenario or <code>dict</code>.</td></tr></tbody></table>

### Object

{% hint style="info" %}
Defines an in-game object. [Objects](https://forge.plebmasters.de/objects) `Not Required`
{% endhint %}

<table><thead><tr><th width="176">Property</th><th width="97">Type</th><th width="126">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>model</code></td><td>string</td><td><mark style="color:red;"><code>required</code></mark></td><td>Model of the object.</td></tr><tr><td><code>rotation</code></td><td>vector3</td><td><mark style="color:red;"><code>required</code></mark></td><td>Rotation of the object.</td></tr><tr><td><code>offset</code></td><td>vector3</td><td><code>nil</code></td><td>Offset of the object.</td></tr><tr><td><code>respawnTime</code></td><td>number</td><td><code>nil</code></td><td>After interacting with the object, the object will be deleted and will recreated at the end of the time</td></tr></tbody></table>

### OnCompleted

{% hint style="info" %}
Defines actions that occur upon completion of an interaction. `Not required`
{% endhint %}

<table><thead><tr><th width="183">Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>giveItems</code></td><td>string | string[] | table&#x3C;string, number></td><td>Items to give on completion.</td></tr><tr><td><code>removeItems</code></td><td>string | string[] | table&#x3C;string, number></td><td>Items to remove on completion.</td></tr><tr><td><code>exp</code></td><td>number</td><td>Experience points to stage on completion.</td></tr></tbody></table>

### CanInteract

{% hint style="info" %}
Defines conditions required to interact with an option. `Not Required`
{% endhint %}

<table><thead><tr><th width="244">Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>items</code></td><td>string | string[] | table&#x3C;string, number></td><td>Items required to interact.</td></tr><tr><td><code>job</code></td><td>string | string[] | table&#x3C;string, number></td><td>Jobs allowed to interact.</td></tr><tr><td><code>level</code></td><td>number</td><td>Minimum level required.</td></tr><tr><td><code>reputationLevel</code></td><td>number</td><td>Minimum reputation level required.</td></tr><tr><td><code>requiredPoliceCount</code></td><td>number</td><td>Number of police needed for this option.</td></tr></tbody></table>

### Options

{% hint style="info" %}
Defines interaction options for a stage.

* `icon` value applies to [font-awesome](https://fontawesome.com/icons)
* if you set a `minigame`, the ox\_progressbar will appear and prompt you to press \[E] 3 times in the correct position
* `policeAlertChange`, probability to notify police when target is completed

{% endhint %}

| Property            | Type                        | Description                                  |
| ------------------- | --------------------------- | -------------------------------------------- |
| `label`             | string                      | Label for the interaction option.            |
| `icon`              | string                      | Icon for the interaction option.             |
| `minigame`          | boolean                     | Whether a minigame is required.              |
| `duration`          | number                      | Duration of the interaction in milliseconds. |
| `animation`         | [Animation](#animation)     | Animation to play during interaction.        |
| `onCompleted`       | [OnCompleted](#oncompleted) | Actions to perform on completion.            |
| `canInteract`       | [CanInteract](#caninteract) | Conditions to allow interaction.             |
| `cooldown`          | number                      | Cooldown time in milliseconds.               |
| `policeAlertChange` | number                      | Percentage chance of alerting police.        |

### OnItemUsed

{% hint style="info" %}
Defines actions triggered when an `useableItem` is used. `Not Required`

* When using an item you can trigger an event or simulate an `option`
  {% endhint %}

| Property         | Type             | Description             |
| ---------------- | ---------------- | ----------------------- |
| `event`          | string           | Client-side event name. |
| `serverEvent`    | string           | Server-side event name. |
| `simulateOption` | number \| string | Option table key.       |

### WeedStage

{% hint style="info" %}
Defines a stage in the weed processing system.

* If you set `useableItem`, `onItemUsed` will be triggered when you use that item. You may prefer this for operations like *rolling* for example.
* `zones` are required if no `useableItem`. Each added zone will be checked separately for all processes. You can add as many as you want.
* If you set the `radius` value, the `object` will spawn at a random position inside that `zone`. `radius` is not required and if not set, the `object` will spawn at the exact position of the `zones`
* `Options` are the options you will see when you interact with the `object` with target

{% endhint %}

<table><thead><tr><th width="173">Property</th><th width="310">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>active</code></td><td>boolean</td><td>Whether the stage is active (default: true).</td></tr><tr><td><code>label</code></td><td>string</td><td>Descriptive label for the stage.</td></tr><tr><td><code>blip</code></td><td><a href="#blip">Blip</a></td><td>Blip settings for the stage.</td></tr><tr><td><code>zones</code></td><td>table&#x3C;key, vector3> <mark style="color:red;"><code>required</code></mark></td><td>Zones where the stage can be performed.</td></tr><tr><td><code>radius</code></td><td>number</td><td>Radius for random object placement.</td></tr><tr><td><code>object</code></td><td><a href="#object">Object</a></td><td>Object to be spawned in the zone.</td></tr><tr><td><code>options</code></td><td><a href="#options">table&#x3C;key, Options></a></td><td>Interaction options for the stage.</td></tr><tr><td><code>useableItem</code></td><td>string <code>Not Required</code></td><td>Item required for interaction. <code>item name</code></td></tr><tr><td><code>onItemUsed</code></td><td><a href="#onitemused">OnItemUsed</a></td><td>Actions to perform when using the <code>useableItem</code>.</td></tr></tbody></table>

### Weed

{% hint style="info" %}
Defines a type of weed and its processing stages.
{% endhint %}

| Property      | Type                                 | Description                                      |
| ------------- | ------------------------------------ | ------------------------------------------------ |
| `active`      | boolean                              | Whether the weed type is active (default: true). |
| `label`       | string                               | Descriptive label for the weed.                  |
| `imagePath`   | string                               | Image for UI.                                    |
| `description` | string                               | Description of the weed type.                    |
| `stages`      | [table\<key, WeedStage>](#weedstage) | Stages for processing the weed.                  |

***

## Examples

{% tabs %}
{% tab title="#1" %}

```lua
[1] = {
    label = 'Sativa',
    description = 'Harvest, process, roll and deliver orders',
    imagePath = 'sativa_leaf.png',
    stages = {
        [1] = {
            label = 'Harvesting',
            blip = { active = true, color = 5, sprite = 469 },
            zones = {
                vector3(2852.3779, 4585.1973, 46.1),
                vector3(2849.0, 4577.0, 46.1),
                vector3(2849.0, 4577.0, 47.0),
                vector3(2845.0, 4588.0, 47.0),
                vector3(2862.9404, 4582.7388, 47.4004),
                vector3(2882.1274, 4639.1616, 48.6372),
                vector3(2871.7822, 4636.5459, 48.7074),
                vector3(2872.9092, 4622.3071, 48.7116),
                vector3(2887.6401, 4624.7578, 48.7442),
            },
            radius = 8.0,
            object = { model = 'prop_weed_02', respawnTime = 10000, },
            options = {
                {
                    label = 'Harvest',
                    icon = 'fa-solid fa-leaf',
                    minigame = true,
                    duration = 3000,
                    animation = {
                        dict = 'amb@world_human_gardener_plant@female@base',
                        clip = 'base_female',
                        prop = {
                            model = 'prop_cs_trowel',
                            pos = vector3(0.03, 0.03, 0.02),
                            rot = vector3(0.0, 0.0, -1.5),
                            bone = 28422,
                        },
                    },
                    onCompleted = {
                        giveItems = 'sativa_leaf',
                        exp = 20,
                    },
                },
            },
        },
        [2] = {
            label = 'Processing',
            blip = { active = true, color = 5, sprite = 469 },
            zones = {
                vector3(1905.5717, 4914.5806, 47.85),
            },
            object = { model = 'bkr_prop_weed_table_01a', rotation = 247.2577 },
            options = { {
                label = 'Process Sativa',
                icon = 'fa-solid fa-leaf',
                minigame = true,
                duration = 3000,
                cooldown = 5000,
                animation = {
                    dict = 'mp_fbi_heist',
                    clip = 'loop',
                },
                canInteract = { items = 'sativa_leaf' },
                onCompleted = {
                    removeItems = { ['sativa_leaf'] = 2 },
                    giveItems = { ['sativa_pure'] = 3 },
                    exp = 20,
                },
            }, },
        },
        [3] = {
            label = 'Rolling',
            options = { {
                duration = 7500,
                animation = {
                    scenario = 'PROP_HUMAN_PARKING_METER',
                },
                canInteract = {
                    items = {
                        ['sativa_pure'] = 1,
                        ['rolling_paper'] = 1,
                    },
                },
                onCompleted = {
                    removeItems = { 'sativa_pure', 'rolling_paper' },
                    giveItems = 'sativa_rolled',
                    exp = 30,
                },
            } },
            useableItem = 'sativa_pure',
            onItemUsed = { simulateOption = 1, }
        },
        [4] = {
            label = 'Packaging',
            blip = { active = true, color = 5, sprite = 469 },
            zones = {
                vector3(1545.8186, 6335.7173, 23.1),
            },
            object = { model = 'bkr_prop_weed_table_01a', rotation = 275.0 },
            options = { {
                label = 'Sativa Packaging',
                icon = 'fa-solid fa-cube',
                duration = 3000,
                cooldown = 5000,
                animation = { dict = 'mp_fbi_heist', clip = 'loop', },
                canInteract = { items = { ['sativa_rolled'] = 5 } },
                onCompleted = {
                    removeItems = { ['sativa_rolled'] = 5 },
                    giveItems = 'sativa_packed',
                    exp = 50,
                },
            }, },
        },
        [5] = {
            label = 'Usage',
            useableItem = 'sativa_rolled',
            onItemUsed = {
                simulateOption = 1,
                event = 'wasd-mixweed:weed:useRolledWeed',
            },
            options = { {
                duration = 5000,
                animation = {
                    scenario = 'WORLD_HUMAN_SMOKING_POT',
                },
                canInteract = { items = 'sativa_rolled' },
                onCompleted = { removeItems = 'sativa_rolled' },
            } }
        },
    },
},
```

{% endtab %}

{% tab title="#2" %}

```lua
[2] = {
    label = 'Processing',
    blip = { active = true, color = 5, sprite = 469 },
    zones = {
        vector3(1905.5717, 4914.5806, 47.85),
    },
    object = { model = 'bkr_prop_weed_table_01a', rotation = 247.2577 },
    options = { 
        {
            label = 'Process Sativa',
            icon = 'fa-solid fa-leaf',
            minigame = true,
            duration = 3000,
            cooldown = 5000,
            animation = {
                dict = 'mp_fbi_heist',
                clip = 'loop',
            },
            canInteract = { items = 'sativa_leaf' },
            onCompleted = {
                removeItems = { ['sativa_leaf'] = 2 },
                giveItems = { ['sativa_pure'] = 3 },
                exp = 20,
            },
        }, 
    },
},
```

{% endtab %}

{% tab title="#3" %}

```lua
[3] = {
    label = 'Rolling',
    options = { 
        {
            duration = 7500,
            animation = {
                scenario = 'PROP_HUMAN_PARKING_METER',
            },
            canInteract = {
                items = {
                    ['sativa_pure'] = 1,
                    ['rolling_paper'] = 1,
                },
            },
            onCompleted = {
                removeItems = { 'sativa_pure', 'rolling_paper' },
                giveItems = 'sativa_rolled',
                exp = 30,
            },
        },
    },
    useableItem = 'sativa_pure',
    onItemUsed = { simulateOption = 1, }
},

```

{% endtab %}

{% tab title="#4" %}

```lua
[4] = {
    label = 'Packaging',
    blip = { active = true, color = 5, sprite = 469 },
    zones = {
        vector3(1545.8186, 6335.7173, 23.1),
    },
    object = { model = 'bkr_prop_weed_table_01a', rotation = 275.0 },
    options = { 
        {
            label = 'Sativa Packaging',
            icon = 'fa-solid fa-cube',
            duration = 3000,
            cooldown = 5000,
            animation = { dict = 'mp_fbi_heist', clip = 'loop', },
            canInteract = { items = { ['sativa_rolled'] = 5 } },
            onCompleted = {
                removeItems = { ['sativa_rolled'] = 5 },
                giveItems = 'sativa_packed',
                exp = 50,
            },
        },
     },
},
```

{% endtab %}

{% tab title="#5" %}

```lua
[5] = {
    label = 'Usage',
    useableItem = 'sativa_rolled',
    onItemUsed = {
        simulateOption = 1,
        event = 'wasd-mixweed:weed:useRolledWeed',
    },
    options = { 
        {
            duration = 5000,
            animation = {
                scenario = 'WORLD_HUMAN_SMOKING_POT',
            },
            canInteract = { items = 'sativa_rolled' },
            onCompleted = { removeItems = 'sativa_rolled' },
        },
    },
},
```

{% endtab %}
{% endtabs %}


---

# 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://wasd-dev.gitbook.io/wasd/resources/mix-weed/modules/weed-type.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.
