CodeM Inventory

Creating the Items

Go to codem-inventory/config/itemlist.lua, COPY and PASTE this items:

-- mg-jerrycan
    mg_jerrycan                    = { name = 'mg_jerrycan', label = 'Jerrycan 20L', weight = 20000, type = 'item', image = 'mg_jerrycan.png', unique = true, useable = true, shouldClose = true, description = 'A can full of Fuel' },
    empty_jerrycan                    = { name = 'empty_jerrycan', label = 'Empty Jerrycan', weight = 1000, type = 'item', image = 'empty_jerrycan.png', unique = false, useable = true, shouldClose = true, description = 'An empty jerrycan' },

Creating the Metadata

You must add the following line in codem-inventory/config/metadata.js:

} else if (item.name.match("mg_jerrycan")) {
        let infoData = [
            { label: "Fuel", value: iteminfo.fuel || "0" },
        ];
        returnString = infoData;

Default Item Metadata

Go to codem-inventory/editable/serverexport.lua and to give you the jerrycan item with metadata you have to modify your giveitem command.

Add this inside the AddItem function, arround line 590:

if itemData.name == 'mg_jerrycan' then
        info.fuel = 20 -- Or what fuel you want
    end

Last updated