Weed#
Installing the resource#
- Make sure you have the dependencies listed above installed.
- Execute The 'database.sql' to your database.
- It is written according to the
itemNamevalues specified in Config. You can change it. Do not forget to change it on both sides. - You have to put the pictures yourself.
- Add item to shared items.lua
weed_seed = { name = "weed_seed", label = "Weed Seed", weight = 0, type = "item", image = "weed_seed.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Weed Seed"},
fertilizer_old = { name = "fertilizer_old", label = "Fertilizer Old", weight = 2000, type = "item", image = "fertilizer.png", unique = false, useable = true, shouldClose = true, combinable = nil, description = "Fertilizer Old"},
fertilizer_normal = { name = "fertilizer_normal", label = "Fertilizer Normal", weight = 2000, type = "item", image = "fertilizer.png", unique = false, useable = true, shouldClose = true, combinable = nil, description = "Fertilizer Normal"},
fertilizer_premium = { name = "fertilizer_premium", label = "Fertilizer Premium", weight = 2000, type = "item", image = "fertilizer.png", unique = false, useable = true, shouldClose = true, combinable = nil, description = "Fertilizer Premium"},
weed_plant = {name = "weed_plant", label = "Weed Branch", weight = 500, type = "item", image = "weed_plant.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Weed Plant"},
weed_brick = { name = "weed_brick", label = "Weed Brick", weight = 1000, type = "item", image = "weed_brick.png", unique = false, useable = false, shouldClose = true, description = "1KG Weed Brick to sell to large customers." },
- Add the images inside your inventory/html/images.
- Add this in you inventory /html/app.js :
case "weed_plant":
return `<p><strong>Genetics: </strong><span>${itemData.info.genetics}</span></p>
<p><strong>Dry: </strong><span>${itemData.info.dry}</span></p>`;
- It is written according to the
itemNamevalues specified in Config. You can change it. Do not forget to change it on both sides. - You have to put the pictures yourself.
- Add items to ox_inventory/data/items.lua
["weed_seed"] = {
label = "Weed Seed",
weight = 0,
stack = false,
close = true,
description = "Weed seed.",
client = {
image = "weed_seed.png",
}
},
["fertilizer_old"] = {
label = "Fertilizer Old",
weight = 2000,
stack = true,
close = true,
description = "Fertilizer old.",
client = {
image = "fertilizer.png",
}
},
["fertilizer_normal"] = {
label = "Fertilizer Normal",
weight = 2000,
stack = true,
close = true,
description = "Fertilizer normal.",
client = {
image = "fertilizer.png",
}
},
["fertilizer_premium"] = {
label = "Fertilizer Premium",
weight = 2000,
stack = true,
close = true,
description = "Fertilizer premium.",
client = {
image = "fertilizer.png",
}
},
["weed_plant"] = {
label = "Weed Plant",
weight = 500,
stack = false,
close = true,
description = "Weed Plant.",
client = {
image = "weed_plant.png",
}
},
["weed_brick"] = {
label = "Weed Brick",
weight = 1000,
stack = false,
close = true,
description = "Packaged Weed.",
client = {
image = "weed_brick.png",
}
},
- Add the images inside your ox_inventory/web/images.
- Add into ox_inventory/modules/items/client.lua
local dlc_weed_usable_items = {
[1] = "weed_seed",
[2] = "fertilizer_old",
[3] = "fertilizer_normal",
[4] = "fertilizer_premium",
}
for _, v in pairs(dlc_weed_usable_items) do
Item(v, function(data, slot)
ox_inventory:useItem(data, function(data)
if data then
TriggerEvent("0r-weed:Client:UseItem", slot.name, slot.slot, slot.metadata)
end
end)
end)
end
exports.ox_inventory:displayMetadata({
dry = 'Dry Value',
genetics = 'Genetics'
})