🪴hd-drugmaking
Compatibility
Frameworks Supports QBCore & ESX Can also be setup as Standalone to use any other framework Inventories Currently supports qb-inventory, ox_inventory, origen_inventory and qs_inventory If your inventory is not supported, just make a ticket in my discord and I'll add support for it
Installation
Download the asset from your keymaster https://keymaster.fivem.net/
Drag en drop the script into your resources folder
Make sure you have the following structure in you server.cfg:
ensure ox_lib
ensure hd-drugmaking-props
ensure hd-drugmaking
Download the images and put them in your inventory images folder
Run the SQL
SQL
CREATE TABLE IF NOT EXISTS `drugmaking_plants` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`coords` longtext NOT NULL,
`stage` int(11) NOT NULL DEFAULT 0,
`type` varchar(50) NOT NULL DEFAULT '0',
`soil` double NOT NULL DEFAULT 0,
`seed` double NOT NULL DEFAULT 0,
`water` double NOT NULL DEFAULT 0,
`fertilizer` double NOT NULL DEFAULT 0,
`bucket` int(11) NOT NULL DEFAULT 0,
`rack_coords` longtext NOT NULL DEFAULT '{}',
`light_coords` longtext NOT NULL DEFAULT '{}',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
CREATE TABLE IF NOT EXISTS `drugmaking_stations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`coords` varchar(255) DEFAULT NULL,
`bucket` int(11) DEFAULT NULL,
`type` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
Copy and paste all the items into. If you´re using ox_inventory, choose the Ox inventory items If you´re using qb-inventory, choose the QB items
Ox inventory items
['hd_packaging_table'] = {
label = 'Packaging Station',
weight = 3000,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_packaging_table'
}
},
['hd_mixing_station'] = {
label = 'Mixing Station',
weight = 3000,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_mixing_station'
}
},
['hd_cauldron'] = {
label = 'Cauldron',
weight = 3000,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_cauldron'
}
},
['hd_drug_pot_empty'] = {
label = 'Empty Pot',
weight = 250,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_drug_pot_empty'
}
},
['hd_weed_seed'] = {
label = 'Weed Seed',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_seed'] = {
label = 'Cocaine Seed',
weight = 100,
stack = true,
close = false,
},
['hd_empty_wateringcan'] = {
label = 'Empty Watering Can',
weight = 150,
stack = false,
close = false,
},
['hd_full_wateringcan'] = {
label = 'Full Watering Can',
weight = 500,
stack = false,
close = false,
},
['hd_soil_bag'] = {
label = 'Soil Bag',
weight = 500,
stack = true,
close = false,
},
['hd_fertilizer_bag'] = {
label = 'Fertilizer Bag',
weight = 500,
stack = true,
close = false,
},
['hd_pot_rack'] = {
label = 'Rack',
weight = 1000,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_pot_rack'
}
},
['hd_pot_growlamp'] = {
label = 'Grow Lamp',
weight = 1000,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_pot_growlamp'
}
},
['hd_weed_bud'] = {
label = 'Weed Bud',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_leaf'] = {
label = 'Cocaine Leaf',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_bud'] = {
label = 'Cocaine Bud',
weight = 100,
stack = true,
close = false,
},
['hd_zipbag'] = {
label = 'Zipbag',
weight = 100,
stack = true,
close = false,
},
-- Ingredients / drugs
['hd_gasoline'] = {
label = 'Gasoline',
weight = 200,
stack = true,
close = false,
},
['hd_sprunk'] = {
label = 'Sprunk',
weight = 200,
stack = true,
close = false,
},
['hd_weed_gasoline'] = {
label = 'Weed Gasoline',
weight = 100,
stack = true,
close = false,
},
['hd_weed_gasoline_sprunk'] = {
label = 'Weed Gasoline Sprunk',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_gasoline'] = {
label = 'Cocaine Gasoline',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_gasoline_sprunk'] = {
label = 'Cocaine Gasoline Sprunk',
weight = 100,
stack = true,
close = false,
},
-- Zipped Drugs
['hd_weed_bud_zipped'] = {
label = 'Weed Zipbag',
weight = 100,
stack = true,
close = false,
},
['hd_weed_gasoline_zipped'] = {
label = 'Weed Gasoline Zipbag',
weight = 100,
stack = true,
close = false,
},
['hd_weed_gasoline_sprunk_zipped'] = {
label = 'Weed Gasoline Sprunk Zipbag',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_bud_zipped'] = {
label = 'Cocaine Zipbag',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_gasoline_zipped'] = {
label = 'Cocaine Gasoline Zipbag',
weight = 100,
stack = true,
close = false,
},
['hd_cocaine_gasoline_sprunk_zipped'] = {
label = 'Cocaine Gasoline Sprunk Zipbag',
weight = 100,
stack = true,
close = false,
},
['hd_meth_table'] = {
label = 'Meth Table',
weight = 3000,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_meth_table'
}
},
['hd_meth_oven'] = {
label = 'Meth Oven',
weight = 3000,
stack = false,
close = true,
server = {
export = 'hd-drugmaking.hd_meth_oven'
}
},
['hd_meth_poor'] = {
label = 'Meth Poor',
weight = 200,
stack = true,
close = true,
},
['hd_meth_poor_gasoline'] = {
label = 'Meth Poor Gasoline',
weight = 200,
stack = true,
close = true,
},
['hd_meth_poor_gasoline_sprunk'] = {
label = 'Meth Poor Gasoline Sprunk',
weight = 200,
stack = true,
close = true,
},
['hd_meth_standard'] = {
label = 'Meth Standard',
weight = 200,
stack = true,
close = true,
},
['hd_meth_premium'] = {
label = 'Meth Premium',
weight = 200,
stack = true,
close = true,
},
['hd_meth_poor_zipped'] = {
label = 'Meth Poor Zipbag',
weight = 200,
stack = true,
close = true,
},
['hd_meth_poor_gasoline_zipped'] = {
label = 'Meth Poor Gasoline Zipbag',
weight = 200,
stack = true,
close = true,
},
['hd_meth_poor_gasoline_sprunk_zipped'] = {
label = 'Meth Poor Gasoline Sprunk Zipbag',
weight = 200,
stack = true,
close = true,
},
['hd_meth_standard_zipped'] = {
label = 'Meth Standard Zipbag',
weight = 200,
stack = true,
close = true,
},
['hd_meth_premium_zipped'] = {
label = 'Meth Premium Zipbag',
weight = 200,
stack = true,
close = true,
},
['hd_acid'] = {
label = 'Acid',
weight = 100,
stack = true,
close = true,
},
['hd_phosphorus'] = {
label = 'Phosphorus',
weight = 100,
stack = true,
close = true,
},
['hd_redpills'] = {
label = 'Red Pills',
weight = 100,
stack = true,
close = true,
},
['hd_meth_liquid_poor'] = {
label = 'Meth Liquid Poor',
weight = 100,
stack = true,
close = true,
},
['hd_meth_liquid_standard'] = {
label = 'Meth Liquid Standard',
weight = 100,
stack = true,
close = true,
},
['hd_meth_liquid_premium'] = {
label = 'Meth Liquid Premium',
weight = 100,
stack = true,
close = true,
},
QB items
hd_packaging_table = {
weight = 3000,
shouldClose = "true",
image = "hd_packaging_table.png",
name = "hd_packaging_table",
type = "item",
label = "Packaging Station",
useable = "true",
},
hd_mixing_station = {
weight = 3000,
shouldClose = "true",
image = "hd_mixing_station.png",
name = "hd_mixing_station",
type = "item",
label = "Mixing Station",
useable = "true",
},
hd_cauldron = {
weight = 3000,
shouldClose = "true",
image = "hd_cauldron.png",
name = "hd_cauldron",
type = "item",
label = "Cauldron",
useable = "true",
},
hd_drug_pot_empty = {
weight = 250,
shouldClose = "true",
image = "hd_drug_pot_empty.png",
name = "hd_drug_pot_empty",
type = "item",
label = "Empty Pot",
useable = "true",
},
hd_weed_seed = {
weight = 100,
shouldClose = "false",
image = "hd_weed_seed.png",
name = "hd_weed_seed",
type = "item",
label = "Weed Seed",
useable = "false",
},
hd_cocaine_seed = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_seed.png",
name = "hd_cocaine_seed",
type = "item",
label = "Cocaine Seed",
useable = "false",
},
hd_empty_wateringcan = {
weight = 150,
shouldClose = "false",
image = "hd_empty_wateringcan.png",
name = "hd_empty_wateringcan",
type = "item",
label = "Empty Watering Can",
useable = "false",
},
hd_full_wateringcan = {
weight = 500,
shouldClose = "false",
image = "hd_full_wateringcan.png",
name = "hd_full_wateringcan",
type = "item",
label = "Full Watering Can",
useable = "false",
},
hd_soil_bag = {
weight = 500,
shouldClose = "false",
image = "hd_soil_bag.png",
name = "hd_soil_bag",
type = "item",
label = "Soil Bag",
useable = "false",
},
hd_fertilizer_bag = {
weight = 500,
shouldClose = "false",
image = "hd_fertilizer_bag.png",
name = "hd_fertilizer_bag",
type = "item",
label = "Fertilizer Bag",
useable = "false",
},
hd_pot_rack = {
weight = 1000,
shouldClose = "true",
image = "hd_pot_rack.png",
name = "hd_pot_rack",
type = "item",
label = "Rack",
useable = "true",
},
hd_pot_growlamp = {
weight = 1000,
shouldClose = "true",
image = "hd_pot_growlamp.png",
name = "hd_pot_growlamp",
type = "item",
label = "Grow Lamp",
useable = "true",
},
hd_weed_bud = {
weight = 100,
shouldClose = "false",
image = "hd_weed_bud.png",
name = "hd_weed_bud",
type = "item",
label = "Weed Bud",
useable = "false",
},
hd_cocaine_leaf = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_leaf.png",
name = "hd_cocaine_leaf",
type = "item",
label = "Cocaine Leaf",
useable = "false",
},
hd_cocaine_bud = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_bud.png",
name = "hd_cocaine_bud",
type = "item",
label = "Cocaine Bud",
useable = "false",
},
hd_zipbag = {
weight = 100,
shouldClose = "false",
image = "hd_zipbag.png",
name = "hd_zipbag",
type = "item",
label = "Zipbag",
useable = "false",
},
-- Ingredients / drugs
hd_gasoline = {
weight = 100,
shouldClose = "false",
image = "hd_gasoline.png",
name = "hd_gasoline",
type = "item",
label = "Gasoline",
useable = "false",
},
hd_sprunk = {
weight = 100,
shouldClose = "false",
image = "hd_sprunk.png",
name = "hd_sprunk",
type = "item",
label = "Sprunk",
useable = "false",
},
hd_weed_gasoline = {
weight = 100,
shouldClose = "false",
image = "hd_weed_gasoline.png",
name = "hd_weed_gasoline",
type = "item",
label = "Weed Gasoline",
useable = "false",
},
hd_weed_gasoline_sprunk = {
weight = 100,
shouldClose = "false",
image = "hd_weed_gasoline_sprunk.png",
name = "hd_weed_gasoline_sprunk",
type = "item",
label = "Weed Gasoline Sprunk",
useable = "false",
},
hd_cocaine_gasoline = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_gasoline.png",
name = "hd_cocaine_gasoline",
type = "item",
label = "Cocaine Gasoline",
useable = "false",
},
hd_cocaine_gasoline_sprunk = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_gasoline_sprunk.png",
name = "hd_cocaine_gasoline_sprunk",
type = "item",
label = "Cocaine Gasoline Sprunk",
useable = "false",
},
hd_weed_bud_zipped = {
weight = 100,
shouldClose = "false",
image = "hd_weed_bud_zipped.png",
name = "hd_weed_bud_zipped",
type = "item",
label = "Weed Zipbag",
useable = "false",
},
hd_weed_gasoline_zipped = {
weight = 100,
shouldClose = "false",
image = "hd_weed_gasoline_zipped.png",
name = "hd_weed_gasoline_zipped",
type = "item",
label = "Weed Gasoline Zipbag",
useable = "false",
},
hd_weed_gasoline_sprunk_zipped = {
weight = 100,
shouldClose = "false",
image = "hd_weed_gasoline_sprunk_zipped.png",
name = "hd_weed_gasoline_sprunk_zipped",
type = "item",
label = "Weed Gasoline Sprunk Zipbag",
useable = "false",
},
hd_cocaine_bud_zipped = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_bud_zipped.png",
name = "hd_cocaine_bud_zipped",
type = "item",
label = "Cocaine Zipbag",
useable = "false",
},
hd_cocaine_gasoline_zipped = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_gasoline_zipped.png",
name = "hd_cocaine_gasoline_zipped",
type = "item",
label = "Cocaine Gasoline Zipbag",
useable = "false",
},
hd_cocaine_gasoline_sprunk_zipped = {
weight = 100,
shouldClose = "false",
image = "hd_cocaine_gasoline_sprunk_zipped.png",
name = "hd_cocaine_gasoline_sprunk_zipped",
type = "item",
label = "Cocaine Gasoline Sprunk Zipbag",
useable = "false",
},
hd_meth_table = {
weight = 3000,
shouldClose = "true",
image = "hd_meth_table.png",
name = "hd_meth_table",
type = "item",
label = "Meth Table",
useable = "true",
},
hd_meth_oven = {
weight = 3000,
shouldClose = "true",
image = "hd_meth_oven.png",
name = "hd_meth_oven",
type = "item",
label = "Meth Oven",
useable = "true",
},
hd_meth_poor = {
weight = 200,
shouldClose = "false",
image = "hd_meth_poor.png",
name = "hd_meth_poor",
type = "item",
label = "Meth Poor",
useable = "false",
},
hd_meth_poor_gasoline = {
weight = 200,
shouldClose = "false",
image = "hd_meth_poor_gasoline.png",
name = "hd_meth_poor_gasoline",
type = "item",
label = "Meth Poor Gasoline",
useable = "false",
},
hd_meth_poor_gasoline_sprunk = {
weight = 200,
shouldClose = "false",
image = "hd_meth_poor_gasoline_sprunk.png",
name = "hd_meth_poor_gasoline_sprunk",
type = "item",
label = "Meth Poor Gasoline Sprunk",
useable = "false",
},
hd_meth_standard = {
weight = 200,
shouldClose = "false",
image = "hd_meth_standard.png",
name = "hd_meth_standard",
type = "item",
label = "Meth Standard",
useable = "false",
},
hd_meth_premium = {
weight = 200,
shouldClose = "false",
image = "hd_meth_premium.png",
name = "hd_meth_premium",
type = "item",
label = "Meth Premium",
useable = "false",
},
hd_meth_poor_zipped = {
weight = 200,
shouldClose = "false",
image = "hd_meth_poor_zipped.png",
name = "hd_meth_poor_zipped",
type = "item",
label = "Meth Poor Zipbag",
useable = "false",
},
hd_meth_poor_gasoline_zipped = {
weight = 200,
shouldClose = "false",
image = "hd_meth_poor_gasoline_zipped.png",
name = "hd_meth_poor_gasoline_zipped",
type = "item",
label = "Meth Poor Gasoline Zipbag",
useable = "false",
},
hd_meth_poor_gasoline_sprunk_zipped = {
weight = 200,
shouldClose = "false",
image = "hd_meth_poor_gasoline_sprunk_zipped.png",
name = "hd_meth_poor_gasoline_sprunk_zipped",
type = "item",
label = "Meth Poor Gasoline Sprunk Zipbag",
useable = "false",
},
hd_meth_standard_zipped = {
weight = 200,
shouldClose = "false",
image = "hd_meth_standard_zipped.png",
name = "hd_meth_standard_zipped",
type = "item",
label = "Meth Standard Zipbag",
useable = "false",
},
hd_meth_premium_zipped = {
weight = 200,
shouldClose = "false",
image = "hd_meth_premium_zipped.png",
name = "hd_meth_premium_zipped",
type = "item",
label = "Meth Premium Zipbag",
useable = "false",
},
hd_acid = {
weight = 100,
shouldClose = "false",
image = "hd_acid.png",
name = "hd_acid",
type = "item",
label = "Acid",
useable = "false",
},
hd_phosphorus = {
weight = 100,
shouldClose = "false",
image = "hd_phosphorus.png",
name = "hd_phosphorus",
type = "item",
label = "Phosphorus",
useable = "false",
},
hd_redpills = {
weight = 100,
shouldClose = "false",
image = "hd_redpills.png",
name = "hd_redpills",
type = "item",
label = "Red Pills",
useable = "false",
},
hd_meth_liquid_poor = {
weight = 100,
shouldClose = "false",
image = "hd_meth_liquid_poor.png",
name = "hd_meth_liquid_poor",
type = "item",
label = "Meth Liquid Poor",
useable = "false",
},
hd_meth_liquid_standard = {
weight = 100,
shouldClose = "false",
image = "hd_meth_liquid_standard.png",
name = "hd_meth_liquid_standard",
type = "item",
label = "Meth Liquid Standard",
useable = "false",
},
hd_meth_liquid_premium = {
weight = 100,
shouldClose = "false",
image = "hd_meth_liquid_premium.png",
name = "hd_meth_liquid_premium",
type = "item",
label = "Meth Liquid Premium",
useable = "false",
},
ESX items
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('hd_cauldron', 'Cauldron', 1, 0, 1),
('hd_cocaine_bud', 'Cocaine Bud', 1, 0, 1),
('hd_cocaine_bud_zipped', 'Cocaine Zipbag', 1, 0, 1),
('hd_cocaine_gasoline', 'Cocaine Gasoline', 1, 0, 1),
('hd_cocaine_gasoline_sprunk', 'Cocaine Gasoline Sprunk', 1, 0, 1),
('hd_cocaine_gasoline_sprunk_zipped', 'Cocaine Gasoline Sprunk Zipbag', 1, 0, 1),
('hd_cocaine_gasoline_zipped', 'Cocaine Gasoline Zipbag', 1, 0, 1),
('hd_cocaine_leaf', 'Cocaine Leaf', 1, 0, 1),
('hd_cocaine_seed', 'Cocaine Seed', 1, 0, 1),
('hd_drug_pot_empty', 'Empty Pot', 1, 0, 1),
('hd_empty_wateringcan', 'Empty Watering Can', 1, 0, 1),
('hd_fertilizer_bag', 'Fertilizer Bag', 1, 0, 1),
('hd_full_wateringcan', 'Full Watering Can', 1, 0, 1),
('hd_gasoline', 'Gasoline', 1, 0, 1),
('hd_mixing_station', 'Mixing Station', 1, 0, 1),
('hd_packaging_table', 'Packaging Station', 1, 0, 1),
('hd_pot_growlamp', 'Grow Lamp', 1, 0, 1),
('hd_pot_rack', 'Rack', 1, 0, 1),
('hd_soil_bag', 'Soil Bag', 1, 0, 1),
('hd_sprunk', 'Sprunk', 1, 0, 1),
('hd_weed_bud', 'Weed Bud', 1, 0, 1),
('hd_weed_bud_zipped', 'Weed Zipbag', 1, 0, 1),
('hd_weed_gasoline', 'Weed Gasoline', 1, 0, 1),
('hd_weed_gasoline_sprunk', 'Weed Gasoline Sprunk', 1, 0, 1),
('hd_weed_gasoline_sprunk_zipped', 'Weed Gasoline Sprunk Zipbag', 1, 0, 1),
('hd_weed_gasoline_zipped', 'Weed Gasoline Zipbag', 1, 0, 1),
('hd_weed_seed', 'Weed Seed', 1, 0, 1),
('hd_zipbag', 'Zipbag', 1, 0, 1)
('hd_meth_table', 'Meth Table', 1, 0, 1)
('hd_meth_oven', 'Meth Oven', 1, 0, 1)
('hd_meth_poor', 'Meth Poor', 1, 0, 1)
('hd_meth_poor_gasoline', 'Meth Poor Gasoline', 1, 0, 1)
('hd_meth_poor_gasoline_sprunk', 'Meth Poor Gasoline Sprunk', 1, 0, 1)
('hd_meth_standard', 'Meth Standard', 1, 0, 1)
('hd_meth_premium', 'Meth Premium', 1, 0, 1)
('hd_meth_poor_zipped', 'Meth Poor Zipbag', 1, 0, 1)
('hd_meth_poor_gasoline_zipped', 'Meth Poor Gasoline Zipbag', 1, 0, 1)
('hd_meth_poor_gasoline_sprunk_zipped', 'Meth Poor Gasoline Sprunk Zipbag', 1, 0, 1)
('hd_meth_standard_zipped', 'Meth Standard Zipbag', 1, 0, 1)
('hd_meth_premium_zipped', 'Meth Premium Zipbag', 1, 0, 1)
('hd_acid', 'Acid', 1, 0, 1)
('hd_phosphorus', 'Phosphorus', 1, 0, 1)
('hd_redpills', 'Red Pills', 1, 0, 1)
('hd_meth_liquid_poor', 'Meth Liquid Poor', 1, 0, 1)
('hd_meth_liquid_standard', 'Meth Liquid Standard', 1, 0, 1)
('hd_meth_liquid_premium', 'Meth Liquid Premium', 1, 0, 1);
Config
Config.lua
Config = {}
Config.Debug = false
-- Setting the Framework to qb will require qb-inventory.
-- Setting the Framework to esx will require esx_inventory.
-- Setting Config.Inventory to 'ox_inventory' will overwrite the framework functions and use the inventory functions instead.
Config.Framework = 'qb' -- qb or esx
Config.Inventory = 'ox_inventory' -- ox_inventory, origen_inventory, qs-inventory or nil to use framework functions
Config.ImagesPath = 'nui://ox_inventory/web/images/item_name.png' -- "nui://ox_inventory/web/images/item_name.png" or "nui://qb-inventory/html/images/item_name.png" or your own path
Config.Target = 'ox_target' -- qb-target or ox_target
Config.Locale = 'en' -- en or sv
Config.MaxPlaceDistance = 10.0 -- Sets the maximum distance from the ped at which a prop can be placed
Config.OutlineObjects = true -- If objects should display an outline drawing the prop or not.
Config.RackGrowthBonus = 0.25 -- Faster growth with rack + growlight. Default: 25%
Config.BaseGrowthTimePerStage = 5 -- Base growth time in minutes per stage. Default: 5 minutes
Config.WaterConsumptionPercent = 40 -- How much water that is consumed per stage. This means that somewhere in stage 2 the plant will need to be watered. Default: 40%
Config.MixingTime = 10 -- How many seconds it takes to mix one item. Fully maxed mixing then means 10x10 = 100 seconds
Config.CauldronTime = 10 -- How many seconds it takes to cauldron one item. Fully maxed mixing then means 10x10 = 100 seconds
Config.OvenTime = 60 -- How many seconds it takes for items in the oven to finish. Default: 60 seconds
Config.AllowExplosion = false -- If the explosion should be allowed when overheating at the methtable.
Config.CopAlerts = { -- Dispatch alerts for for each action. Add your own alerts in client/open/open_functions.lua
['planting'] = { chance = 0.2, enabled = false }, -- Chance of the function being called. 0.2 = 20% chance
['harvesting'] = { chance = 0.2, enabled = false },
['cauldron'] = { chance = 0.2, enabled = false },
['meth_table'] = { chance = 0.2, enabled = false },
['meth_oven'] = { chance = 0.2, enabled = false },
['mixing'] = { chance = 0.2, enabled = false },
['packaging'] = { chance = 0.2, enabled = false },
}
Config.Harvesting = {
['weed'] = {
template = 'weed', -- The template used for this process. 'weed' or 'cocaine' is available as of right now
budModel = 'hd_prop_weed_harvestbud', -- The model of the bud that will be displayed when the plant is harvested
outputItem = 'hd_weed_bud', -- The item that will be added when plant has been harvested
defaultBuds = 6, -- The number of buds that will be visually displayed with a fertilized plant
fertilizerBuds = 10, -- The number of buds that will be visually displayed when the plant is not fertilized
outcomePerBud = 1, -- The amount of items that the player will recieve per bud harvested
requiredItems = {
[0] = 'hd_soil_bag',
[1] = 'hd_weed_seed',
[2] = 'hd_full_wateringcan',
[3] = 'hd_fertilizer_bag'
},
prepPropStages = {
[0] = 'hd_prop_pot_empty',
[1] = 'hd_prop_pothole',
[2] = 'hd_prop_pot_full',
[3] = 'hd_prop_pot_full',
[4] = 'hd_prop_pot_full',
},
propStages = {
[0] = 'hd_prop_pot_full',
[1] = 'hd_prop_weed_stage_01',
[2] = 'hd_prop_weed_stage_02',
[3] = 'hd_prop_weed_stage_03',
[4] = 'hd_prop_weed_stage_04',
},
},
['cocaine'] = {
template = 'cocaine',
budModel = 'hd_prop_coke_leaf',
outputItem = 'hd_cocaine_leaf',
defaultBuds = 6,
fertilizerBuds = 10,
outcomePerBud = 1,
requiredItems = {
[0] = 'hd_soil_bag',
[1] = 'hd_cocaine_seed',
[2] = 'hd_full_wateringcan',
[3] = 'hd_fertilizer_bag'
},
prepPropStages = {
[0] = 'hd_prop_pot_empty',
[1] = 'hd_prop_pothole',
[2] = 'hd_prop_pot_full',
[3] = 'hd_prop_pot_full',
[4] = 'hd_prop_pot_full',
},
propStages = {
[0] = 'hd_prop_pot_full',
[1] = 'hd_prop_coke_stage_01',
[2] = 'hd_prop_coke_stage_02',
[3] = 'hd_prop_coke_stage_03',
[4] = 'hd_prop_coke_stage_04',
},
},
}
Config.MethTable = {
['meth'] = {
requiredItems = { -- The items that are required to start the process
{
name = 'hd_acid', -- The name of the item that is required
amount = 1 -- The amount of the item that is required
},
{
name = 'hd_phosphorus',
amount = 1
},
{
name = 'hd_redpills',
amount = 1
}
},
outputItem = 'hd_meth_liquid', -- The item that will be added when the process is finished
outputItemLabel = 'Liquid Meth',
outputItemAmount = 10, -- The outcome amount of the outputItem item
purity = { -- If none of the values are met, the purity will be set to 'poor'
['standard'] = {
acid = { lowest = 30, highest = 60 },
phosphorus = { lowest = 50, highest = 100 },
},
['premium'] = {
acid = { lowest = 60, highest = 90 },
phosphorus = { lowest = 100, highest = 150 },
},
}
},
}
Config.MethOven = {
['hd_meth_poor'] = { -- The name of the item that will be added when the process is finished
liquidAmount = 1, -- The amount of the liquid item that is required to start the process
liquid = 'hd_meth_liquid_poor', -- The item that is required to start the process
outputAmount = 10, -- The amount of the outputItem item that will be added when the process is finished
},
['hd_meth_standard'] = {
liquidAmount = 1,
liquid = 'hd_meth_liquid_standard',
outputAmount = 10,
},
['hd_meth_premium'] = {
liquidAmount = 1,
liquid = 'hd_meth_liquid_premium',
outputAmount = 10,
},
}
Config.Cauldron = {
[1] = {
itemToCauldron = 'hd_cocaine_leaf',
itemToMix = 'hd_gasoline', -- Only removes 1 item
outputItem = 'hd_cocaine_bud',
propType = 'hd_prop_coke_leaf',
},
}
Config.Items = {
['drug_pot_empty'] = {
label = 'Tom kruka',
model = 'hd_prop_pot_empty',
},
['packaging_table'] = {
label = 'Packstation',
model = 'hd_prop_weed_table',
},
['mixing_station'] = {
label = 'Mixing Station',
model = 'hd_prop_mixingbot',
},
['cauldron'] = {
label = 'Kruka',
model = 'hd_prop_cauldron',
},
['meth_table'] = {
label = 'Meth Table',
model = 'hd_prop_methtable',
},
['meth_oven'] = {
label = 'Meth Oven',
model = 'hd_props_oven',
},
}
Config.PublicStations = { -- Add public stations here
['mixing_stations'] = {
--[[
{
coords = vector4(-321.6, 180.77, 87.92, 181.96),
bucket = 0,
},
]]
},
['packaging_stations'] = {
--[[
{
coords = vector4(-322.21, 176.42, 87.92, 16.41),
bucket = 0,
}
]]
},
['cauldrons'] = {
--[[
{
coords = vector4(-317.07, 178.83, 87.92, 97.15),
bucket = 0,
}
]]
},
['meth_tables'] = {
--[[
{
coords = vector4(-972.44, -2962.45, 12.95, 344.52),
bucket = 0,
}
]]
},
['meth_ovens'] = {
--[[
{
coords = vector4(-967.95, -2962.12, 12.95, 9.71),
bucket = 0,
}
]]
},
}
Config.PrepPropStagesUndefined = { -- This is only used if the plant is not yet defined with a drug type. [0] and [1] should be the only ones needed
[0] = 'hd_prop_pot_empty',
[1] = 'hd_prop_pothole',
[2] = 'hd_prop_pot_full',
[3] = 'hd_prop_pot_full',
[4] = 'hd_prop_pot_full',
}
Config.Packaging = { -- Items that can be packaged into bags
emptyBag = 'hd_zipbag', -- Define your own item name or leave as is
-- Weed buds
['hd_weed_bud'] = {
model = 'hd_prop_weed_bud', -- The bud drag model
outcomeItem = 'hd_weed_bud_zipped', -- The item that will be added when the packaging is finished
},
['hd_weed_gasoline'] = {
model = 'hd_prop_weed_bud',
outcomeItem = 'hd_weed_gasoline_zipped',
},
['hd_weed_gasoline_sprunk'] = {
model = 'hd_prop_weed_bud',
outcomeItem = 'hd_weed_gasoline_sprunk_zipped',
},
-- Cocaine buds
['hd_cocaine_bud'] = {
model = 'hd_prop_cocaine_bud',
outcomeItem = 'hd_cocaine_bud_zipped',
},
['hd_cocaine_gasoline'] = {
model = 'hd_prop_cocaine_bud',
outcomeItem = 'hd_cocaine_gasoline_zipped',
},
['hd_cocaine_gasoline_sprunk'] = {
model = 'hd_prop_cocaine_bud',
outcomeItem = 'hd_cocaine_gasoline_sprunk_zipped',
},
-- Meth Crystals
['hd_meth_poor'] = {
model = 'hd_prop_meth_crystal',
outcomeItem = 'hd_meth_poor_zipped',
},
['hd_meth_poor_gasoline'] = {
model = 'hd_prop_meth_crystal',
outcomeItem = 'hd_meth_poor_gasoline_zipped',
},
['hd_meth_poor_gasoline_sprunk'] = {
model = 'hd_prop_meth_crystal',
outcomeItem = 'hd_meth_poor_gasoline_sprunk_zipped',
},
['hd_meth_standard'] = {
model = 'hd_prop_meth_crystal',
outcomeItem = 'hd_meth_standard_zipped',
},
['hd_meth_premium'] = {
model = 'hd_prop_meth_crystal',
outcomeItem = 'hd_meth_premium_zipped',
},
}
Config.MixingTypes = {
['weed'] = {
model = 'hd_prop_weed_bud',
},
['cocaine'] = {
model = 'hd_prop_cocaine_bud',
},
['meth'] = {
model = 'hd_prop_meth_crystal',
},
}
Config.Mixing = {
-- Example strain for weed (2 stages)
[1] = {propType = 'weed', drugItem = 'hd_weed_bud', mixItem = 'hd_gasoline', outputItem = 'hd_weed_gasoline'},
[2] = {propType = 'weed', drugItem = 'hd_weed_gasoline', mixItem = 'hd_sprunk', outputItem = 'hd_weed_gasoline_sprunk'},
-- Example strain for cocaine (2 stages)
[3] = {propType = 'cocaine', drugItem = 'hd_cocaine_bud', mixItem = 'hd_gasoline', outputItem = 'hd_cocaine_gasoline'},
[4] = {propType = 'cocaine', drugItem = 'hd_cocaine_gasoline', mixItem = 'hd_sprunk', outputItem = 'hd_cocaine_gasoline_sprunk'},
-- Example strain for meth (2 stages) Only configed with poor purity
[5] = {propType = 'meth', drugItem = 'hd_meth_poor', mixItem = 'hd_gasoline', outputItem = 'hd_meth_poor_gasoline'},
[6] = {propType = 'meth', drugItem = 'hd_meth_poor_gasoline', mixItem = 'hd_sprunk', outputItem = 'hd_meth_poor_gasoline_sprunk'},
}
How can I add new drugs?
It is possible to add new drugs, however, due to the complex object handling for each drug, you can only use the premade templates when creating new ones. Weed and cocaine follow a similar structure. The available templates under Config.Drugs is "weed" and "cocaine". Below, I’ll explain the process of creating new drugs in more detail.
IMPORTANT The ['example-drug'] and [1] = 'your-seed-item' must be unique and cannot share names with any other drug. This is because, when planting, the script checks which seed item was used and refers back to the corresponding ['example-drug'], which then handles all related processes.
['example-drug'] = {
template = 'weed', -- The template used for this process. 'weed' or 'cocaine' is available as of right now
budModel = 'hd_prop_weed_harvestbud', -- The model of the bud that will be displayed when the plant is harvested
outputItem = 'your-output-item', -- The item that will be added when plant has been harvested
defaultBuds = 6, -- The number of buds that will be visually displayed with a fertilized plant
fertilizerBuds = 10, -- The number of buds that will be visually displayed when the plant is not fertilized
outcomePerBud = 1, -- The amount of items that the player will recieve per bud harvested
requiredItems = {
[0] = 'hd_soil_bag', -- Required item in first stage planting
[1] = 'your-seed-item', -- Required item in second stage planting
[2] = 'hd_full_wateringcan', -- Required item in third stage planting
[3] = 'hd_fertilizer_bag' -- Required item in fourth stage planting
},
prepPropStages = { -- I highly recommend not to edit the props below since it will cause issues with positions
[0] = 'hd_prop_pot_empty',
[1] = 'hd_prop_pothole',
[2] = 'hd_prop_pot_full',
[3] = 'hd_prop_pot_full',
[4] = 'hd_prop_pot_full',
},
propStages = { -- I highly recommend not to edit the props below since it will cause issues wit
[0] = 'hd_prop_pot_full',
[1] = 'hd_prop_weed_stage_01',
[2] = 'hd_prop_weed_stage_02',
[3] = 'hd_prop_weed_stage_03',
[4] = 'hd_prop_weed_stage_04',
},
},
For Developers
Bucketing
Use the following event when you switch buckets for players in your housing/apartment.
The event should be triggered from the client.
Replace bucket
with the new bucket
TriggerServerEvent('hd-drugmaking:server:setPlayerBucket', bucket)
The following event checks for deleted objects and incorrect positions. It can be called from for example your housing script when a players enters an interior. This loads deleted objects and fix incorrect positions.
Below are all the editable functions
Client Functions
OpenFunctions = {
--@param message string
--@param type string (success, error, info)
ShowNotification = function(message, type)
local data = {
description = message,
type = type
}
lib.notify(data)
end,
--@param action string (harvesting, mixing, packaging, cauldron)
--@return boolean (true if action is allowed, false otherwise)
IsActionAllowed = function(action)
return true
end,
--@param type string (planting, harvesting, cauldron, meth_table, meth_oven, mixing, packaging)
DispatchAlert = function(type)
-- Add your dispatch alerts here
--print('Dispatching alert for ' .. type)
end,
--@return boolean
IsPlayerInAllowedArea = function()
-- Implement you own logic here to check for example if the player is inside a house/apartment
return true
end,
}
Server Functions
OpenFunctions = {
--@param data table
--@field source number
--@field action string (harvesting, mixing, packaging, meth_table, meth_oven, cauldron)
--@field item string (item recieved)
--@field amount number (amount of item recieved)
--@field drugType string (only for harvesting)
OnActionCompleted = function(data)
-- This function is called every time an action is completed and can be implemented in your own scripts to for example give rep/xp
-- print(json.encode(data))
end,
--@param src number
--@param message string
--@param type string (success, error, info)
ShowNotification = function(src, message, type)
local data = {
description = message,
type = type
}
TriggerClientEvent('ox_lib:notify', src, data)
end,
}
Last updated