Giter VIP home page Giter VIP logo

ox_inventory's Introduction

ox_inventory

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

๐Ÿ“š Documentation

https://overextended.dev/ox_inventory

๐Ÿ’พ Download

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

โœจ 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.

Supported frameworks

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 small stashes when using an item, such as a paperbag.
  • 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/.

ox_inventory's People

Contributors

andyyy7666 avatar antond15 avatar bazookan avatar berkiebb avatar demetriomontalto avatar dependabot[bot] avatar dokadoka avatar dolutattoo avatar dunak-debug avatar far18 avatar fjamzoo avatar gamzky avatar github-actions[bot] avatar hsnnnnn avatar hyprell avatar jdimella avatar koolaiddtv avatar lil-loco avatar lukewastakenn avatar manason avatar mikigoalie avatar quickvalve avatar ruqen avatar skryptific avatar thelindat avatar tony-stark-17 avatar trey2k avatar ushifty avatar vwernay avatar zeta-gc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ox_inventory's Issues

TAB Menu

Is your feature request related to a problem? Please describe.
A TAB Menu which we can see the first five slot like in disc inventory would be great.

weapons cant get reloaded

Describe the bug
some weapons cant get reloaded, for example appistol

To Reproduce
Steps to reproduce the behavior:

  1. take weapon in hand
  2. use ammo-9 or use "R"
  3. you cant load the ap-pistol with 9mm ammo
  4. See error

Expected behavior
all weapons should be able to reload

esx_property snippet bug

Describe the bug
When applying the snipped from the site for ESX properties, the inventory will only open once and both the stash and players inventory will be wiped after a transaction is made

To Reproduce
Steps to reproduce the behavior:

  1. Apply the esx_property snippet
  2. Store something
  3. try and open it again and check your inventory

Additional context
Console errors

[MySQL:8.0.23] [ERROR] [linden_inventory] An error happens for query "SELECT * FROM linden_inventory WHERE name = ? AND owner = ? LIMIT 1 : ["3AltaStreet","license:License]": ER_BAD_FIELD_ERROR: Unknown column 'owner' in 'where clause'
SCRIPT ERROR: @linden_inventory/server/functions.lua:229: attempt to index a nil value (local 'result')

Item Drop

After I run the item, it can't be picked up (nothing is displayed on the ground)

Logs write wrong messages in evidence

Describe the bug
It's showing wrong messages in logs when i use the evidence.

To Reproduce
Steps to reproduce the behavior:

  1. Go to evidence-spot
  2. Type /evidence 1
  3. Put item inside
  4. you see that it writes taken from evidence although i put it inside the evidence

Expected behavior
It should show that i have put an item inside and not taken from evidence

stashes without job

At the moment you can only make stashes with a job inside the stashes config.

It would be awesome to have the option to leave out the job field so that everyone can use the stash but have their own inventory in it and not a shared one.

Identification Cards

Is your feature request related to a problem? Please describe.
No. It is just a suggestion.

Describe the solution you'd like
1.I think it would be better if you could change the "Sex: m" in id cards with "Sex: Male" or "Sex: Female".
2.You can add "Identity No" for every person in id cards.
3.And it would be better if you remove the steam hex from id the cards or could add a config for it like "Config.SteamHexInID = false".

Add traslations

A translation could be added, with a locale file

For mythic notifications

Using items with no use. Bugs inventory

Describe the bug
If you use a item that doesn't have a uses setup for it, it will bug out the system and you can no longer use any item in your inventory.

To Reproduce
Steps to reproduce the behavior:

Add any item to your server that has no use and its just a item for other scripts to check a item amount
try to use it and it will bug out the system. no other item can be used once this happens and you can A relog or B restart the inventory

Expected behavior
for nothing to happen and not bug out

Identification Card Problem

Describe the bug
When my friend drops his identification card, his name is written on the card but when he gives it me with the give button, my name is written on the card.

Items disappearing after dropping

Describe the bug
If I drop things and then open inventory with f2 again the item is disappeared that i dropped, so i cant pick it up anymore

To Reproduce
Steps to reproduce the behavior:

  1. Drop Item
  2. close inventory
  3. open inventory again
  4. no item in the drop window

Expected behavior
it should show the items that were dropped at this place

Different currencies for items in shops and other things

1. I would love to be able to set different currencies for items in shops.

E.g.:
Item 1 -> currency = money
Item 2 -> currency = black money
Item 3 -> currency = diamonds

2. Display of random items from pool in shops.

Just like the random prices in shops, it would be very cool, to only show x-amount of items from the shop-items pool

3. Multiple useage of items

E.g.:
Eating bread 3 times before it gets deleted.

Items in drop disappear

Describe the bug
Items in drop disappear

To Reproduce
Steps to reproduce the behavior:

  1. Put item in drop
  2. close inventory
  3. no marker got placed
  4. items disappeared

Expected behavior
marker should show up and items should be there still

Use empty png as image for no-image-declared items

Is your feature request related to a problem? Please describe.
No, this is not a problem maybe a feature to add if linden is okay with it

Describe the solution you'd like
Maybe a file like "empty.png" or "noimage.png" can be used instead of the broken image icon that shows on current update with this type of items

Describe alternatives you've considered
I cant see any other solution

Additional context
image

job restriction in stashes doesnt work

Describe the bug
I made a stash for lostmc but it's still accessible for everyone.

To Reproduce
Steps to reproduce the behavior:

  1. I put this in stashes.lua: { coords = vector3(976.73, -103.4, 74.85), slots = 70, name = 'LostMC-Lager', owner = false, job = 'lostmc' },
  2. Go Ingame put an item inside as lostmc
  3. make myself unemployed and still have access to lostmc stash
  4. no error!

Expected behavior
It should only allow people from lostmc to access the stash

Errors in console

I see an error in console during update Item weight inventory, it pass a string not a number. It's easy to fix

file SERVER-->player.lua --> replace all xItem.weight to tonumber(xItem.weight)

player.zip

Vehicle Trunk

Try to make the trunk open only when the player is out of the car and standing by the trunk

Problem with Weapon - Ammo

Is your feature request related to a problem? Please describe.

Yes it is. I found a bug or Its happening to me, when you have some gun with 1 ammo on the charger, you can Spam to recharge and It will fully recharge the gun ammo
(For example: You have 1 ammo, then you buy 1 ammo and spam the use button, the gun will be fully recharged and the bullet will be removed when the gun-bullets is already fully charged)
This is always happening (With 1 bullet, 2 bullets, 3 bullets)

Video proof: https://streamable.com/8srnh8

Describe the solution you'd like
Simply fixing that and reloading bullet per bullet (1 bullet 1 ammo like it should work)

Describe alternatives you've considered
none
Additional context
nothing

Weapons/items get removed randomly

Describe the bug
put weapon inside and then got removed from trunk

To Reproduce
Steps to reproduce the behavior:

  1. open trunk
  2. put weapon inside (here for example appistol)
  3. close trunk and let someone else watch inside
  4. weapon got removed

Expected behavior
it should stay inside

Screenshots
https://files.fm/f/jveqarjex <-- Video to show what have been done

Double Click to use & Automatic Move system

I have two suggestions for linden_inventory.

First one being Shift Clicking items would move it to the other inventory. Other inventory being glovebox, the ground, evidence lockers, etc. This would make things a lot quicker if you're trying to move a ton of items at a time.

Second one being Double clicking an item would use it. Once again this would be a lot more convenient if you're under pressure to use an item which isnt on your hotbar.

job stashes limit on job-grades

Describe the solution you'd like
it would be awesome to be able to create job stashes and limit on job-grades like all over grade 3 can have access to the job stash

weapons get removed when 0 ammo in it

Describe the bug
weapon get "unlimited" ammo because it get removed when 0 ammo in it

To Reproduce
Steps to reproduce the behavior:

  1. take weapon in hotbar
  2. use the key for taking the weapon from hotbar
  3. shoot out all ammo
  4. weapon gets removed, now pick it again with the key
  5. See error, the amount of ammo like it was before you taking it out --> "unlimited" ammo

Expected behavior
should save all ammo and dont remove the weapon

Inventory Getting Stuck

Describe the bug
https://i.vgy.me/aumGib.png

When closing the inventory sometimes, this happens. No idea why. This started happening after updating to 1.3.0

It doesnt happen all the time but I was testing things out with items and dropping them and then it just got stuck. I tried using the command to close my inventory but it kept posting this error

identification

Try to add, when a player creates a character he gets an item "identification". And please add weapon licence item with ownership information, which will be added to the inventory when you purchase the license.

Visual Bug - Item still droppable outside of inventory container

Describe the bug
Item can still be dropped in an overflow item box.

To Reproduce
Steps to reproduce the behavior:

  1. Drag inventory item
  2. Drop below inventory box container

Expected behavior
Item should return back to it's original item box similar to what happens when the function does not find any droppable item box in the mouse location.

Screenshots
https://streamable.com/3gx19i

Additional context
N/A works with any valid item and the bug is also present when drag/dropping on the right side inventory.

Let shop take money from society

Is your feature request related to a problem? Please describe.
No, Just a Suggest

Describe the solution you'd like
Can you add a option that can let shop take the money from society.

Describe alternatives you've considered

Additional context
nothing

Players still have components after death

Describe the bug
When a player has bought a weapon and has attached components on it, after he dies with a weapon on his hands and his inventory gets cleared with this event: TriggerEvent('linden_inventory:clearPlayerInventory', xPlayer), when the player goes and buys the same weapon it still has the attachments on it, although the inventory says that it has no components on him.

To Reproduce

  1. Buy a weapon
  2. Attach a component on it
  3. Kill your character with the weapon on his hands
  4. Respawn
  5. Buy the same weapon

Expected behavior
The player shouldn't have the components on his weapon after his inventory got cleared with the event 'linden_inventory:clearPlayerInventory'

Screenshots
https://i.imgur.com/Nk6JUbF.png

Additional context
The problem might be that because when the player dies with his weapon on his hand and the weapon falls on the ground, the metadata of it doesn't get cleared.

Hotbar no longer working after using weapon addon

Describe the bug
When you put a weapon addon like the Pistol Suppressor on your hotbar and activate it while no gun is out, the Action Bar no longer works.

To Reproduce

  1. Put a pistol suppressor on the hotbar and activate it by pressing the correct hotkey (make sure not to have your weapon in hand).
  2. Now try to activate anything else on the hotbar.

Expected behaviour
Message that you need the correct weapon in your hand and not bug out the hotbar.

Additional context
Add any other context about the problem here.

turn blip for each shop on or off

just simple it would be awesome to turn off the blip for each shop category manually in the config for example to turn off for blackmarket

Owned vehicle storage not being saved in data abse

Describe the bug
When items are stored in a owned vehicle they do not get stored in the database.

To Reproduce
Steps to reproduce the behavior:

  1. Store an item in a owned vehicle
  2. Restart linden inventory
  3. No entry in the database has been created and thus the item is gone

Expected behavior
It to be stored in database

Additional context
The core of the issue seems to be local result = exports.ghmattimysql:scalarSync('SELECT owner FROM owned_vehicles WHERE plate = @plate', { ['@plate'] = plate }) returning nil on line 204 of server/functions.lua

Weapon Fix

Is your feature request related to a problem? Please describe.
You can make a place or item that fixes the weapon and maximizes its durability. Especially for the police, it would be really good.

ID Card Problem

Describe the bug
Nothing writes on the id card.

Screenshots
unknown (1)

Job Grade Checking for Shops

Title. The script already checks for jobs themselves, it would be nice if they also checked for grade. Possibly in an array format to allow for multiple grades to access.

I am willing to do this and merge - when I have time.

Give button

Is your feature request related to a problem? Please describe.

Dropping items on the ground is not the most optimal roleplay action when trying to exchange items with another player.

Describe the solution you'd like

UI droppable give button

Additional context

I've roughly tried to add a give button on linden's previous fork of hsn-inventory and it worked. The only issue was that weapon metadata (esp. serial numbers) were being randomized upon giving. So I disabled the giving of weapons.

I understand that a give button is one of the weakest in terms of exploit vulnerability in esx inventories. But with the proper
checks this should be possible and secure.

Thanks!

Glove Box

Is your feature request related to a problem? Please describe.

No, wondering if you are planning on adding a glovebox for vehicles.

Item Durability Beside on weapons

Is your feature request related to a problem? Please describe.
Puting A durability on Items like in the esx_durability if Used 10times or more it will break
Like the item Radio if it used 5 times will break

Glovebox freeze

If I'm sitting in the car and open the glovebox and after closing i get stuck inside the car and can't leave it anymore.

When transferring items from the car to your inventory it bugs out

Describe the bug
When moving items from a car inventory and setting 1 as the number of items to move over it can cause the inventory to no longer allow you to stack the items.

To Reproduce
Steps to reproduce the behavior:

  1. Put the amount of items to transfer on 1.
  2. Move items over from your inventory to the car.
  3. Move the items back and the inventory no longer allows you to stack them and gives an error in the console.

Expected behavior
Stack items without any issues.

Screenshots
Errors:
image

Inventory:
image

Item stack splitting

Is your feature request related to a problem? Please describe.

If I want to quickly split half of my item stack to give to a friend, I have to manually input half of the item's count into the count box.

Describe the solution you'd like

Rust has a great solution to this since you can split your items by holding MMB on an item and dragging & dropping it to a vacant slot. This splits the item into halves seamlessly without additional user input. Also works with odd numbers (leaves 1 in the origin item stack).

Describe alternatives you've considered

Enable drag & drop with MMB that takes half of the item's count and adds it to the dropped slot (either left or right inv)

Additional context
rust-stack-split

I know this is just for ease-of-life but would be nice to have it ๐Ÿ’ฏ

Inventory gets wiped

Describe the bug
If a player gets disconnected while they are in their inventory it gets wiped. This only appears to happen with player inventories not vehicle inventories.

To Reproduce
Steps to reproduce the behavior:

  1. Open your inventory
  2. press F8 and quit
  3. Reconnect and your inventory is gone

Add search button

Hi!
I wanted to recommend a button for the inventory which can be used to search for items on slots.
Something like this:
image

Thanks linden for your work!

Allow Selling to shops

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
A way to let players sell to shops as well as buy from them.

Describe alternatives you've considered
Another shop type for selling would work as well

Issue with removing items that contain meta data

Describe the bug
Items with meta data cannot be removed from the inventory via the command or xPlayer.removeInventoryItem(). Passing no meta data to xPlayer.removeInventoryItem() also will not remove it.

To Reproduce
Steps to reproduce the behavior:
2. give it to yourself a water with metadata with /giveitem 1 water 1 pee
3. try to remove it with /removeitem 1 water 1 pee
4. try to remove it with /removeitem 1 water 1

Expected behavior
The stone to be removed

Screenshots
image
image
image

Inventory don't load after reconnect esx 1.final

Describe the bug

So all steps were followed all edits and so on and in game when i give item to myself like droping give works perfect but inventory save doesnt work well until i type /save and if i disconnect and reconnect it doesnt load inventory items

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Before giving item database:
image

After Giving item:
image
image

After typing /save
image

and then after reconnect there still items in database but inventory wont load and again if i disconnect with empty inventory my database also goes empty on Inventory table

Additional context
Add any other context about the problem here.

Add quick movement

Hello, Lindat.

I like so much your inventory, but I think it lacks a bit of speed when it comes to moving objects, therefore I suggest adding a quick movement with the right-click.

It basically consists on pressing the right click and automatically moving to the right inventory, as stores do.

Give Button

I would love to see a give button in this inventory.

it is really an awesome thing. You should add an donate button or something.
would donate something.

Thanks for taking over this project and doing such nice things with it <3

Also during the frequent updates which is nice it would be awesome to use a translation system with an file :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.