[Release] [RedEM:RP] Inventory System 2.0

RedEM: Roleplay

RedEM:RP Inventory 2.0

Version: 2.0.0

GitHub: https://github.com/RedEM-RP/redemrp_inventory/

Documentation: https://docs.kanersps.pw/docs/redem/

Description

RedEM: RP Inventory is a resource for RedM which adds a inventory system to your RedM server.

Features:

  • Custom Labels, descriptions, icons.
  • Weight System
  • Lockers
  • Define what items can be dropped and used
  • Item limit
  • Drag’n’drop
  • Easy CSS
  • Compatibility with crafting system (Minecraft like)

Requirements

RedEM:RP
RedEM:RP Identity
RedEM:RP Respawn
pNotify

Credits

Main contributors: Ktos and @amakuu
Secondary contributor/code quality assurance: @Kanersps

And of course all contributors from GitHub!

Preview

1 Like

So I just put this on a development server to test it out, and right away am getting an error at line 65 of the Create_items.lua stating…

SCRIPT ERROR: @redemrp_inventory/server/Create_items.lua:65: invalid vector field: meta
> CreateInventory (@redemrp_inventory/server/Create_items.lua:65)
> ref (@redemrp_inventory/server/sv_main.lua:25)
>  (@mysql-async/mysql-async.js:14431)

Any input on that? Both database tables are uploaded, and i reverted my inventory back to the stock 3 bread and 3 water just to start off with.

“reverted my inventory back to the stock 3 bread and 3 water” Dont do it. You need empty DB. Do not put any information in the database

What is causing the problem and how can I fix it?

this is not problems, only prints.

1 Like

Is anyone made the lockers working? After i create a locker, i cant open it, but i still have the open text at the bottom.

data = {}
TriggerEvent(“redemrp_inventory:getData”,function(call)
data = call
end)

local lockerzone = {
{id=“private”, x=1117.42, y=-1300.58, z=66.38, job=nil}
}

Citizen.CreateThread(function()
while true do
for k,v in pairs(lockerzone) do
data.createLocker(v.id, v.x, v.y, v.z, v.job)
data.updateLockers(-1)
end
break
end
end)

Lockers still not working? I’ve tried everything and it doesn’t work: S

Try now after new commit

Why am i getting this error when trying to add items?

Captura

For ml_needs to work with redemrp_inventory V2, in server.lua you have to do like this:

instead of having this for RegisterUsableItem:

data.delItem(_source, "bread", 1)

you have to put this instead:

local ItemData = data.getItem(_source, 'bread')
ItemData.RemoveItem(1)

and for everything that is refund, instead:

data.addItem(source,"cookedfish", 1)

you have to put this in place for everything:

local ItemData = data.getItem(_source, 'cookedfish')
ItemData.AddItem(1)
1 Like

Thanks for the answer, really helpful!

I’m trying to make this weaponshop to work with the new inventory, maybe you can help me with that

data = {}
TriggerEvent("redemrp_inventory:getData",function(call)
    data = call
end)

RegisterServerEvent('fredweap:buyweapon')
AddEventHandler( 'fredweap:buyweapon', function ( args )

    local _src   = source
    local _price = args['Price']
    local _level = args['Level']
    local _model = args['Model']
    local _qty = args['Cantidad']
    --local _gold = args['Gold']


    TriggerEvent('redemrp:getPlayerFromId', _src, function(user)
        u_identifier = user.getIdentifier()
        u_level = user.getLevel()
        u_charid = user.getSessionVar("charid")
        u_money = user.getMoney()
        u_gold = user.getGold()
    end)

    if u_money < _price then
        TriggerClientEvent("redemrp_notification:start", source, Config.NoMoney, 1, "error")       

        return
    end

    --Para Tienda de Oro
    --if u_gold <= _gold then
    --    TriggerClientEvent( 'UI:DrawNotification', _src, Config.NoMoney )
    --    return
    --end

    if u_level < _level then
        --TriggerClientEvent( 'UI:DrawNotification', _src, Config.LevelMissing )  
        TriggerClientEvent("redemrp_notification:start", source, Config.LevelMissing, 1, "error")             
        return
    end

    data.addItem(_src, _model, _qty, GetHashKey(_model)) 
    TriggerClientEvent("redemrp_notification:start", source, Config.Buy, 1, "success")
    TriggerEvent('redemrp:getPlayerFromId', _src, function(user)
        user.removeMoney(_price)
        --user.removeGold(_gold)
    end)

end)

je regarde mais je vois avec inventory v2.3 le shop item marche plus les 2 je comprend pas j ai fait les modif mais sa veut pas il y en a un a me proposai fonctionnel Merci

I do not understand French, sorry :frowning:

Hello
Put this :

local ItemData = data.getItem(_src, GetHashKey(_model))
ItemData.AddItem(_qty)

in place of:

data.addItem(_src, _model, _qty, GetHashKey(_model)) 
2 Likes

Thanks!

Anyone else having issues with the weapons in the inventory not displaying?
NVM Check your config.lua and make sure usable, and limit exist.

Hımm. I guess somethings wrong. Any ideas

When I press b and open the inventory, when I close it, the cursor stays on the screen.