🥦 Weed Laboratory
Access a comprehensive guide that includes a detailed installation process, examples of code, previews of configurations.
INSTALLATION GUIDE
Step 0 - First Steps
Step 1 - Configure Resource
Step 2 - Adding Items
Adding a New Item to ESX Framework
To add a new items, to your ESX server, follow these steps:
Access the Database: Log in to your server's database management tool (like phpMyAdmin).
Navigate to the
items
Table: In your database, find theitems
table. This is where all the items for the game are defined.SQL Command for Adding Items: To quickly add the items, execute the following SQL command:
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 QB-Core Framework
To add a new items, to your QB-Core server, follow these steps:
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:
['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.
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.
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.
- Adding a Drugs Items
For ESX:
Database Entry: Using an SQL command. Adjust the
name
,label
, and other properties for the drug items.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:
Shared File Update: Add your drug item in the
shared
folder ofqb-core
, customizing the properties. Setuseable
tofalse
for drugs, unless they have a specific use case in the game.['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.'},
Image Addition: Place the drug image in the
qb-inventory
directory. - Download the Images Here.
Restart the Server: After making these changes in either framework, restart your server to implement the new items.
Step 3 - SQL Database
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;
Step 4 - Install Dependencies
inside-weed-models - You receive it with your purchase.
inside-interactions - You receive it with your purchase.
cd_easytime - For time management in the interior Also required: FiveM build 2802+ or higher
How can I change my notifications?
To properly set up the clientNotify
and serverNotify
functions in your FiveM script, follow these steps:
Identify Your Notification System: First, determine the notification system your server uses.
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.
Modify the Notification Functions:
In
clientNotify
andserverNotify
, replaceQBCore:Notify
oresx: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.
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.
Last updated