Kad Darem Docs
Search
⌃K
Links
📦

Inventory (WIP)

Documentation relating to the kd_inventory.
​
​

1. Installation

  • kd_inventory works with RedEM:RP. Be sure you use this framework. VORPcore & GBR will be added soon.
  • Drag and drop the folder in your resources folder
    • kd_inventory
  • Add this ensure in your server.cfg
    • ensure kd_inventory
  • Insert the .sql file into your database
CREATE TABLE `user_inventory` (
`identifier` varchar(50) COLLATE utf8mb4_bin NOT NULL,
`charid` int(11) NOT NULL,
`items` varchar(16000) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
​
​
CREATE TABLE `user_locker` (
`identifier` varchar(50) COLLATE utf8mb4_bin NOT NULL,
`charid` int(11) NOT NULL,
`items` varchar(16000) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
​
  • Think to remove your previous inventory
  • Congratulation, the Inventory script is ready to be use !

2. Usage

Press B to open the inventory
/giveitem name count - to give yourself an item. You cant give more than limit

3. Usable items

  • To Register usable item, use an example provided below (server-side)
RegisterServerEvent("RegisterUsableItem:your_item_name")
AddEventHandler("RegisterUsableItem:your_item_name", function(source)
print("test")
end)

4. Config file

Config = {}
​
Config.debug = false
​
-- Size of containers
Config.grids = {
--Player inventory
inventory = {
row = 10,
column = 8
},
-- Size for unsetuped containers
default = {
row = 8,
column = 5
}
}
​
Config.Items = {
--item example
["water"] =
{
label = "Water", -- Item label
description = "Clean water", -- Description
canBeDropped = true, -- If the item can be dropped
canBeUsed = true, -- If the item can be used
requireLvl = 0, -- require level to get the item
stack = 32, -- Maximum of item in the same place
imgsrc = "items/consumable_offal.png", -- img of the item
type = "item_standard", -- type of the item
width = 1, -- number of width case
height = 2 -- number of height case
},
}