redem-roleplay redemrp_charselect redemrp_respawn
- Add
ensure redemrp_inventory
in server.cfg after redem_roleplay, redem_charselect
Press [B] to open inventory
- /giveitem name count - to give yourself an item. You cant give more than limit
- 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)
- You need also to add usable item in redemrp_inventory config.lua file (example provided below)
["bread"] =
{
label = "Bread",
description = "?????????",
weight = 0.1,
canBeDropped = true,
canBeUsed = true,
requireLvl = 0,
limit = 20,
imgsrc = "items/bread.png",
type = "item_standard",
}
If you want to delete, add or check item amount you need use an example provided below (server-side)
data = {}
TriggerEvent("redemrp_inventory:getData",function(call)
data = call
end)
Functions examples:
local ItemData = data.getItem(_source, 'bread') -- this give you info and functions
print(ItemData.ItemAmount)
ItemData.RemoveItem(2)
ItemData.AddItem(7)
local ItemInfo = data.getItemData('bread') -- return info from config
========================
local playerInventory = data.getPlayerInventory(source) --- return player items
data.removePlayerInventory(source) -- remove player inventory
TriggerEvent("redemrp_inventory:SearchPlayer", target) -- search player
Join discord to get support! - https://discord.gg/FKH4uwb