redem-roleplay redemrp_charselect redemrp_respawn
ensure redemrp_inventory
in server.cfg after redem_roleplay, redem_charselectPress [B] to open inventory
RegisterServerEvent("RegisterUsableItem:your_item_name")
AddEventHandler("RegisterUsableItem:your_item_name", function(source)
print("test")
end)
["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