[Free] ox_inventory - slot-based inventory with metadata


Showcase

A complete inventory system for FiveM, implementing items, weapons, shops, and more without any strict framework dependency.

:books: Documentation

:floppy_disk: Download

https://github.com/overextended/ox_inventory/releases/latest/download/ox_inventory.zip

Supported frameworks

We do not guarantee compatibility or support for third-party resources.

:sparkles: Features

  • Server-side security ensures interactions with items, shops, and stashes are all validated.
  • Logging for important events, such as purchases, item movement, and item creation or removal.
  • Supports player-owned vehicles, licenses, and group systems implemented by frameworks.
  • Fully synchronised, allowing multiple players to access the same inventory.

Items

  • Inventory items are stored per-slot, with customisable metadata to support item uniqueness.
  • Overrides default weapon-system with weapons as items.
  • Weapon attachments and ammo system, including special ammo types.
  • Durability, allowing items to be depleted or removed overtime.
  • Internal item system provides secure and easy handling for item use effects.
  • Compatibility with 3rd party framework item registration.

Shops

  • Restricted access based on groups and licenses.
  • Support different currency for items (black money, poker chips, etc).

Stashes

  • Personal stashes, linking a stash with a specific identifier or creating per-player instances.
  • Restricted access based on groups.
  • Registration of new stashes from any resource.
  • Containers allow access to stashes when using an item, like a paperbag or backpack.
  • Access gloveboxes and trunks for any vehicle.
  • Random item generation inside dumpsters and unowned vehicles.

Copyright

Copyright © 2024 Overextended https://github.com/overextended

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

114 Likes

:ox: :ox: :ox: :ox: :ox:

11 Likes

Best inventory out there

7 Likes

Sick looking inventory im 100% going to use this one. Could you add names for glovebox and trunk for cars. For example if you open a glovebox it shows ‘Glovebox’ and the same for vehicle trunks
?

7 Likes

The best inventory, nice :grin:

6 Likes

OX just on top.

6 Likes

Happy to see this project finally here.
Thanks for the insane work over the last months, you guys are awesome! :heart:
:ox:

6 Likes

Phenomenal Inventory System, Extremely Responsive and easily configurable.

5 Likes

rebuilt my server around it… it got everything i needed… thank you for this masterpiece

4 Likes

Best inventory, its in React TS to! loving it.

1 Like

I installed well, but there is no index.html for your inventory.

Fantastic inventory! Been trying out the experimental builds for a while now, and it’s easily the best inventory I’ve experienced :purple_heart:

2 Likes

The interface is written in TypeScript, you need to build it or download a pre-built copy.

or refer to documentation with instructions on using node and yarn.

2 Likes

Just pure curiosity here @Linden , but why separate out all the typing into diff files vs using a single index.d.ts?? On a diff note, nice release!

You’d have to ask @Dunak on that since he’s the TS nerd; I barely touched the interface outside of some minor style changes and durability calculations.

2 Likes

Since stumbling on this I’ve built my first server around it and the guys have been very helpful along the way! I’ve learnt so much!

3 Likes

Really wished this was for older versions of esx😭

3 Likes

Is it backward compatible? I mean in database we have stored items for normal esx. So ex. If player has 10 piece of bread etc… in storages will he able to use his items after installing this inventory? Our server runs more than a year everyone has lot of items in their storages and we dont want them to lose them.

1 Like

It’s difficult to know what people are running in order to run queries for converting all of their inventories; it wouldn’t be too difficult to convert some standard formats but it can easily get complicated depending on how they store items.

Right now, the only thing I can guarantee is player inventories; there’s also an export that I haven’t thoroughly tested that you could try to use. Considering the nature of this resource I would hope everybody is backing up before attempting anything.

--- Takes traditional item data and updates it to support ox_inventory, i.e.
---
--- Old: [{"cola":1, "bread":3}]
--- New: [{"slot":1,"name":"cola","count":1}, {"slot":2,"name":"bread","count":3}]
---
local function ConvertItems(playerId, items)
	if type(items) == 'table' then
		local returnData, totalWeight = table.create(#items, 0), 0
		local slot = 0
		for name, count in pairs(items) do
			local item = Items(name)
			local metadata = Items.Metadata(playerId, item, false, count)
			local weight = Inventory.SlotWeight(item, {count=count, metadata=metadata})
			totalWeight = totalWeight + weight
			slot += 1
			returnData[slot] = {name = item.name, label = item.label, weight = weight, slot = slot, count = count, description = item.description, metadata = metadata, stack = item.stack, close = item.close}
		end
		return returnData, weight
	end
end
exports('ConvertItems', ConvertItems)

For stuff like esx_addoninventory you could probably load all the items into a table and pass it through (it normally stores each item as a single entry in the database). After some time to let things settle and some relaxation I can look at implementing my own stuff for support.

The plan is to remove the dependency on ESX entirely; once I’ve done that I’ll be adding a guide so anybody could theoretically use it. However, considering the amount this resource affects your server I can’t recommend it for anything before ESX 1.2.

Considering ESX Legacy is almost entirely backwards compatible with 1.2, you would be better off updating everything.

2 Likes