Skip to content

Val3ro/redemrp_inventory

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redemrp_inventory 2023.01

1. Requirements

redem-roleplay redemrp_charselect redemrp_respawn

2. Installation

  • Add ensure redemrp_inventory in server.cfg after redem_roleplay, redem_charselect

3. How to use

Press [B] to open inventory

  • /giveitem name count - to give yourself an item. You cant give more than limit

4. 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)
  • 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",


    }

5. Developing

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

6. Credits

Ktos93

youngsinatra99

Join discord to get support! - https://discord.gg/FKH4uwb

About

An Inventory System for RedEM:RP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 74.3%
  • JavaScript 19.0%
  • CSS 5.4%
  • HTML 1.3%