# 🥦 Weed Laboratory

## INSTALLATION GUIDE

### <mark style="color:red;">Step 0 - First Steps</mark>

{% hint style="info" %}
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants)\
**2.** Unzip the `is-weed`folder and place this folder in your server's resource folder.\
**3.** Add the resource to your server start config (server.cfg): **ensure is-weed**\
If you are using a framework, it must be placed anywhere below your framework resource e.g., es\_extended, not above.

\
ensure es\_extended \
ensure is-weed
{% endhint %}

### <mark style="color:red;">Step 1 - Configure Resource</mark>

{% hint style="info" %}
You **MUST** read all configurable options inside th&#x65;**`[is-weed/config.lua]`** file and configure them to suit your server's needs.
{% endhint %}

### <mark style="color:red;">Step 2 - Adding Items</mark>

{% hint style="info" %}
For the script to function correctly, it's essential to add specific items to your game's database. This section guides you through adding these items, particularly focusing on the phone item and new drugs.
{% endhint %}

> #### Adding a New Item to <mark style="color:green;">ESX Framework</mark>

To add a new items, to your ESX server, follow these steps:

1. **Access the Database**: Log in to your server's database management tool (like phpMyAdmin).
2. **Navigate to the `items` Table**: In your database, find the `items` table. This is where all the items for the game are defined.
3. **SQL Command for Adding Items**: To quickly add the items, execute the following SQL command:

   ```sql
   INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
   ('ventilation', 'Ventilation', 1, 0, 1),
   ('ventilation_plus', 'Ventilation Plus', 1, 0, 1),
   ('heater', 'Heater', 1, 0, 1),
   ('heater_plus', 'Heater Plus', 1, 0, 1),
   ('pot', 'Pot', 1, 0, 1),
   ('pot_plus', 'Pot Plus', 1, 0, 1),
   ('watering_can', 'Watering Can', 1, 0, 1),
   ('water_bottle_big', 'Water Bottle', 1, 0, 1);
   ```

> #### Adding a New Item to <mark style="color:green;">QB-Core Framework</mark>

To add a new items, to your QB-Core server, follow these steps:

1. **Edit the QB-Core Shared File**:
   * Navigate to the `qb-core` folder.
   * Open the `shared` folder.
   * Add a line for the new items in the items list. For example:

     ```lua
     ['ventilation']                     = {['name'] = 'ventilation',                       ['label'] = 'Ventilation',               ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'ventilation.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'Cheap Equipment: Maximum operating time 24 hours, Maximum fan speed 1200 RPM, Modes - Economy, Balanced, Performance.'},
     ['ventilation_plus']                = {['name'] = 'ventilation_plus',                  ['label'] = 'Ventilation Plus',          ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'ventilation.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'Expensive Equipment: Maximum operating time 36 hours, Maximum fan speed 1600 RPM, Modes - Economy, Balanced, Performance.'},
     ['heater']                          = {['name'] = 'heater',                            ['label'] = 'Heater',                    ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'heater.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'Cheap Equipment: Maximum operating time 36 hours, Maximum temperature 22 degrees Celsius, Modes - Economy, Balanced, Performance.'},
     ['heater_plus']                     = {['name'] = 'heater_plus',                       ['label'] = 'Heater Plus',               ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'heater.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'Expensive Equipment: Maximum operating time 48 hours, Maximum temperature 26 degrees Celsius, Modes - Economy, Balanced, Performance.'},
     ['pot']                             = {['name'] = 'pot',                               ['label'] = 'Pot',                       ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'pot.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'Cheap Equipment: Enough for 2 plantings'},
     ['pot_plus']                        = {['name'] = 'pot_plus',                          ['label'] = 'Pot Plus',                  ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'pot.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'Expensive Equipment: Enough for 5 plantings.'},
     ['watering_can']                    = {['name'] = 'watering_can',                      ['label'] = 'Watering Can',              ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'watering_can.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'You will water the plants with this.'},
     ['water_bottle_big']                = {['name'] = 'water_bottle_big',                  ['label'] = 'Water Bottle',              ['weight'] = 0,            ['type'] = 'item',         ['image'] = 'water_bottle_big.png',                   ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,       ['combinable'] = nil,   ['description'] = 'You can fill the Water Tank with this in the Laboratory.'},
     ```
   * This line defines the item's properties like name, label, weight, and image file.
2. **Add Images to QB-Inventory**:
   * Go to the `qb-inventory` folder.
   * Place the image for the items in the appropriate directory (usually in `html/img`).
   * Ensure the image file name matches the one specified in the shared file.
   * [Download the Images Here.](https://drive.google.com/drive/folders/1egaui4ZcV__XBx4t-xtiJqmcphDUymBH?usp=sharing)
3. **Restart the Server**:
   * After making these changes, restart your FiveM server.
   * This is necessary for the server to recognize and load the new item configuration.

### <mark style="color:purple;">-</mark> <mark style="color:purple;">**Adding a Drugs Items**</mark>

**For ESX**:

1. **Database Entry**: Using an SQL command. Adjust the `name`, `label`, and other properties for the drug items.

   ```sql
   INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES 
   ('weed_white_widow_seed', 'White Widow Seed', 1, 0, 1),
   ('weed_og_kush_seed', 'OG Kush Seed', 1, 0, 1),
   ('weed_purple_haze_seed', 'Purple Haze Seed', 1, 0, 1),
   ('weed_gorilla_glue_seed', 'Gorilla Glue Seed', 1, 0, 1),
   ('weed_white_widow', 'White Widow', 1, 0, 1),
   ('weed_og_kush', 'OG Kush', 1, 0, 1),
   ('weed_purple_haze', 'Purple Haze', 1, 0, 1),
   ('weed_gorilla_glue', 'Gorilla Glue', 1, 0, 1);
   ```

**For QB-Core**:

1. **Shared File Update**:  Add your drug item in the `shared` folder of `qb-core`, customizing the properties. Set `useable` to `false` for drugs, unless they have a specific use case in the game.

   ```lua
   ['weed_white_widow_seed']           = {['name'] = 'weed_white_widow_seed',             ['label'] = 'White Widow Seed',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_seed.png',              ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,      ['combinable'] = nil,   ['description'] = 'Package of White Widow variety seeds.'},
   ['weed_og_kush_seed']               = {['name'] = 'weed_og_kush_seed',                 ['label'] = 'OG Kush Seed',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_seed.png',              ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,      ['combinable'] = nil,   ['description'] = 'Package of OG Kush variety seeds.'},
   ['weed_purple_haze_seed']           = {['name'] = 'weed_purple_haze_seed',             ['label'] = 'Purple Haze Seed',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_seed.png',              ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,      ['combinable'] = nil,   ['description'] = 'Package of Purple Haze variety seeds.'},
   ['weed_gorilla_glue_seed']          = {['name'] = 'weed_gorilla_glue_seed',            ['label'] = 'Gorilla Glue Seed',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_seed.png',              ['unique'] = false,         ['useable'] = true,     ['shouldClose'] = true,      ['combinable'] = nil,   ['description'] = 'Package of Gorilla Glue variety seeds.'},

   ['weed_white_widow']                = {['name'] = 'weed_white_widow',                  ['label'] = 'White Widow',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_baggy.png',              ['unique'] = false,         ['useable'] = false,     ['shouldClose'] = false,      ['combinable'] = nil,   ['description'] = 'A Bag with 1g of White Widow.'},
   ['weed_og_kush']                    = {['name'] = 'weed_og_kush',                      ['label'] = 'OG Kush',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_baggy.png',              ['unique'] = false,         ['useable'] = false,     ['shouldClose'] = false,      ['combinable'] = nil,   ['description'] = 'A Bag with 1g of OG Kush.'},
   ['weed_purple_haze']                = {['name'] = 'weed_purple_haze',                  ['label'] = 'Purple Haze',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_baggy.png',              ['unique'] = false,         ['useable'] = false,     ['shouldClose'] = false,      ['combinable'] = nil,   ['description'] = 'A Bag with 1g of Purple Haze.'},
   ['weed_gorilla_glue']               = {['name'] = 'weed_gorilla_glue',                 ['label'] = 'Gorilla Glue',            ['weight'] = 0,          ['type'] = 'item',         ['image'] = 'weed_baggy.png',              ['unique'] = false,         ['useable'] = false,     ['shouldClose'] = false,      ['combinable'] = nil,   ['description'] = 'A Bag with 1g of Gorilla Glue.'},
   ```
2. **Image Addition**: Place the drug image in the `qb-inventory` directory.\
   \- [Download the Images Here.](https://drive.google.com/drive/folders/1egaui4ZcV__XBx4t-xtiJqmcphDUymBH?usp=sharing)

* **Restart the Server**: After making these changes in either framework, restart your server to implement the new items.

### <mark style="color:red;">Step 3 - SQL Database</mark>

{% hint style="info" %}
To set up your database for the game, you'll need to create table: weed\_laboratories. Use the following SQL commands to create these tables:
{% endhint %}

```sql
CREATE TABLE `weed_laboratories` (
  `name` varchar(255) DEFAULT NULL,
  `coords` text DEFAULT NULL,
  `price` int(11) DEFAULT NULL,
  `player` varchar(255) DEFAULT NULL,
  `lab_keys` text DEFAULT NULL,
  `data` text DEFAULT NULL,
  `laptop_password` varchar(255) DEFAULT NULL,
  `darkweb_rep` int(11) DEFAULT NULL,
  `bill` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
```

### <mark style="color:red;">Step 4 - Install Dependencies</mark>

{% hint style="info" %}
**For the script to function properly, it requires the resources listed below.**

To avoid any issues with the script's performance, ensure that you're using the Latest Version of the Framework or Previous Versions that include the same features.
{% endhint %}

<mark style="color:blue;">inside-weed-models</mark> - You receive it with your purchase.

<mark style="color:blue;">inside-interactions</mark> - You receive it with your purchase.

[cd\_easytime](https://github.com/dsheedes/cd_easytime) - For time management in the interior\
\ <mark style="color:yellow;">**Also required: FiveM build 2802+ or higher**</mark>

## How can I change my notifications?

To properly set up the `clientNotify` and `serverNotify` functions in your FiveM script, follow these steps:

1. **Identify Your Notification System**: First, determine the notification system your server uses.
2. **Learn How to Trigger Notifications**: Once you've identified the notification system, find out how to trigger these notifications. Look for documentation or examples in your existing scripts. Pay attention to the format and arguments required for triggering notifications.&#x20;
3. **Modify the Notification Functions**:
   * In `clientNotify` and `serverNotify`, replace `QBCore:Notify`  or  `esx:showNotification` with the appropriate event or function call from your notification system.
   * Ensure you fill in the arguments correctly. Each notification system has its specific requirements for message text, notification type, duration, and possibly other parameters.
4. **Test Your Notifications**: After setting up, test the notifications in various scenarios to confirm they work correctly. This helps ensure that players receive the right messages at the right time.


---

# 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://inside-scripts.gitbook.io/documentation/paid-scripts/weed-laboratory.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.
