REP
  • Welcome to Rep Scripts
  • Free Scripts
    • rep-talkNPC
    • rep-rental
  • Paid Scripts
    • rep-weed
      • Read Me
      • Installation
        • SQL
        • Joints, carry, player metadata
        • Inventory
          • ox_inventory
          • old-qb-inventory
          • new-qb-inventory
          • qs-inventory
    • rep-chopshop
Powered by GitBook
On this page
  • Add Items:
  • Display Metadata:
  • Dry:
  • Step 1:
  • Step 2:
  • Step 3:
  • Step 4:
  • Give Item with metadata:
  1. Paid Scripts
  2. rep-weed
  3. Installation
  4. Inventory

qs-inventory

Add Items:

  1. Copy the image files from the img folder to your inventory folder.

  2. Go to qs-inventory/shared/items.lua

	['femaleseed'] 					 = {['name'] = 'femaleseed', 			 	  	  	['label'] = 'Female Marijuana Seed', 					['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'weed-seed.png', 				['unique'] = true, 		['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'Surely I can just plant this, right?'},
	['maleseed'] 					 = {['name'] = 'maleseed', 			 	  	  	['label'] = 'Male Marijuana Seed', 					['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'weed-seed.png', 				['unique'] = false, 		['useable'] = false, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'Add this to a planted female seed to make it pregnant? You are pretty sure this seed has a penis.'},
	['wateringcan'] 					 = {['name'] = 'wateringcan', 			 	  	  	['label'] = 'Watering Can', 					['weight'] = 7000, 		['type'] = 'item', 		['image'] = 'wateringcan.png', 				['unique'] = true, 		['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'Fill this at a river or lake.'},
	['fertilizer'] 				 	 = {['name'] = 'fertilizer', 			  	  	['label'] = 'Fertilizer', 				['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'fertilizer.png', 			['unique'] = false, 	['useable'] = false, 	['shouldClose'] = false,	   ['combinable'] = nil,   ['description'] = 'Cool'},
	['wetbud'] 					 = {['name'] = 'wetbud', 			 	  	  	['label'] = 'Wet Bud (100 grams)', 					['weight'] = 35000, 		['type'] = 'item', 		['image'] = 'wet.png', 				['unique'] = true, 		['useable'] = false, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'THIS CANT BE DRIED WITHOUT STRAIN... Needs to be stored somewhere dry.'},
	['driedbud'] 					 = {['name'] = 'driedbud', 			 	  	  	['label'] = 'Dried Bud (100 Grams)', 					['weight'] = 10000, 		['type'] = 'item', 		['image'] = 'driedbud.png', 				['unique'] = true, 		['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'Pack It?'},
	['weedpackage'] 					 = {['name'] = 'weedpackage', 			 	  	  	['label'] = 'Suspicious Package', 					['weight'] = 25000, 		['type'] = 'item', 		['image'] = 'weedpackage.png', 				['unique'] = true, 		['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'Marked for Police Seizure'},
	['qualityscales'] 					 = {['name'] = 'qualityscales', 			 	  	  	['label'] = 'High a', 					['weight'] = 2000, 		['type'] = 'item', 		['image'] = 'qualityscales.png', 				['unique'] = true, 		['useable'] = false, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'Weighs Baggies with no loss'},
	['smallscales'] 					 = {['name'] = 'smallscales', 			 	  	  	['label'] = 'Small Scales', 					['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'smallscales.png', 				['unique'] = true, 		['useable'] = false, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'Weighs Baggies with minimal loss'},
	['emptybaggies'] 					 = {['name'] = 'emptybaggies', 			 	  	  	['label'] = 'Empty Baggies', 					['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'emptybaggies.png', 				['unique'] = false, 		['useable'] = false, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'Empty Baggies'},
	['joint'] 					 = {['name'] = 'joint', 			 	  	  	['label'] = '2g Joint', 					['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'joint.png', 				['unique'] = true, 		['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'Its a Joint, man.'},
	['weedbaggie'] 					 = {['name'] = 'weedbaggie', 			 	  	  	['label'] = 'Baggie (7g)', 					['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'weedbaggie.png', 				['unique'] = true, 		['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'Sold on the streets'},
	['rollingpaper'] 					 = {['name'] = 'rollingpaper', 			 	  	  	['label'] = 'Rolling Paper', 					['weight'] = 2000, 		['type'] = 'item', 		['image'] = 'rollingpaper.png', 				['unique'] = false, 		['useable'] = false, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'Required to roll joints!'},

Display Metadata:

Go to your qs-inventory/config/metadata.js

  1. Search for the following code block:

} else if (itemData.name == "harness") {
  1. Add the following code block directly underneath the code block in Step 2

        }else if (itemData.name == "joint") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Strain: </strong>" + itemData.info.strain + ".</p>"
            );
        }else if (itemData.name == "weedbaggie") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Strain: </strong>" + itemData.info.strain + ".</p>"
            );
        }else if (itemData.name == "femaleseed") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Strain: </strong>" + itemData.info.strain +".</p>"
            );
        }else if (itemData.name == "weedpackage") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Strain: </strong>" + itemData.info.strain +
   "</span></p><p><strong>Remain Weights: </strong><span>" +
          itemData.info.remainweight +" grams.</p>"
            );
        }else if (itemData.name == "driedbud") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Strain: </strong>" + itemData.info.strain +
   "</span></p><p><strong>Remain Weights: </strong><span>" +
          itemData.info.remainweight +" grams.</p>"
            );
        }else if (itemData.name == "wetbud") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Strain: </strong><span>" +
                itemData.info.strain +
                "</span></p><p><strong>Dry: </strong><span>" +
                itemData.info.dry +"%.</p>"
            );
        }else if (itemData.name == "wateringcan") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Water: </strong>" + itemData.info.water + "%.</p>"
            );}

Dry:

Step 1:

Go to your qs-inventory/server/custom/misc/ OpenInventory.lua

  1. Search for the following code:

TriggerClientEvent(Config.InventoryPrefix .. ':client:OpenInventory', src, {}, inventories[src], secondInv)
  1. Add the following code BEFORE the whole event:

TriggerEvent('rep-weed:server:checkDry',src, inventories[src], secondInv)

Step 2:

  1. Search for the following code:

TriggerClientEvent(Config.InventoryPrefix .. ':client:OpenInventory', src, {}, inventories[src])
  1. Add the following code BEFORE the whole event:

TriggerEvent('rep-weed:server:checkDry',src, inventories[src])

Step 3:

Go to your qs-inventory/server/custom/misc/ SaveInventory.lua

  1. Search for the following code:

function HandleSaveSecondInventories(src, type, id)
  1. Add the following code AFTER the whole function:

RegisterNetEvent('rep-weed:server:saveDry',function (type,id)
    if type == "trunk" then
        if IsVehicleOwned(id) then
            if Trunks[id.label] == "Trunk-None" or not Trunks[id].items then return end
                for _, item in pairs(Trunks[id].items) do
                    item.description = nil
                end
                MySQL.insert('INSERT INTO inventory_trunk (plate, items) VALUES (:plate, :items) ON DUPLICATE KEY UPDATE items = :items', {
                    ['plate'] = id,
                    ['items'] = json.encode(Trunks[id].items)
                })
                end
        elseif type == "glovebox" then
            if (IsVehicleOwned(id)) then
                if Gloveboxes[id].label == "Glovebox-None" or not Gloveboxes[id].items then return end
                for _, item in pairs(Gloveboxes[id].items) do
                    item.description = nil
                end
                MySQL.insert('INSERT INTO inventory_glovebox (plate, items) VALUES (:plate, :items) ON DUPLICATE KEY UPDATE items = :items', {
                    ['plate'] = id,
                    ['items'] = json.encode(Gloveboxes[id].items)
                })
            end
        elseif type == "stash" then
            if Stashes[id].label == "Stash-None" or not Stashes[id].items then return end
            for _, item in pairs(Stashes[id].items) do
                item.description = nil
            end
            MySQL.insert('INSERT INTO inventory_stash (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items', {
                ['stash'] = id,
                ['items'] = json.encode(Stashes[id].items)
            })
        end
end)

RegisterNetEvent('rep-weed:server:updateDry',function (type,id, slot, item)
    if type == 'player' then
        inventories[id][slot] = item
    elseif type == 'stash' then
        Stashes[id].items[slot] = item
    elseif type == 'trunk' then
        Trunks[id].items[slot] = item
    elseif type == "glovebox" then
        Gloveboxes[id].items[slot] = item
    end
end)

Step 4:

Go to your qs-inventory/server/custom/misc/ AddToStash.lua

  1. Search for the following code:

amount = tonumber(amount) or 1
  1. Add the following code AFTER

 if itemName == "wetbud" then
	if not info then
		info = {}
		info.time = os.time()
		info.dry = 0
	else
		if not info.time then info.time = os.time() end
		if not info.dry then info.dry = 0 end
	end
end
  1. (OPTIONAL) If you want weed to also dry in trunk, player or glove trunk, repeat the same process

Give Item with metadata:

Go to your qs-inventory/server/custom/misc/ GiveItemToPlayer.lua

  1. Search for the following code:

elseif itemData['name'] == 'harness' then
    info.uses = 20
  1. Add the following code AFTER

    elseif itemData['name'] == "femaleseed" then
        info.strain = "Unknown"
        info.n = 0
        info.p = 0
        info.k = 0
    elseif itemData['name'] == "driedbud" then
        info.strain = "Unknown"
        info.n = 0
        info.p = 0
        info.k = 0
        info.remainweight = 100
    elseif itemData['name'] == "weedpackage" then
        info.strain = "Unknown"
        info.n = 0
        info.p = 0
        info.k = 0
        info.remainweight = 100
    elseif itemData['name'] == "weedbaggie" then
        info.strain = "Unknown"
        info.n = 0
        info.p = 0
        info.k = 0
    elseif itemData['name'] == "wetbud" then
        info.strain = "Unknown"
        info.n = 0
        info.p = 0
        info.k = 0
        info.dry = 0
    elseif itemData['name'] == "joint" then
        info.strain = "Unknown"
        info.n = 0
        info.p = 0
        info.k = 0
    elseif itemData['name'] == "wateringcan" then
        info.water = 0
Previousnew-qb-inventoryNextrep-chopshop

Last updated 1 month ago