Giter VIP home page Giter VIP logo

qb-inventory's Introduction

qb-inventory

Dependencies

Features

  • Stashes (Personal and/or Shared)
  • Vehicle Trunk & Glovebox
  • Weapon Attachments
  • Shops
  • Item Drops

Documentation

https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-inventory

Installation

Manual

  • Download the script and put it in the [qb] directory.
  • Import qb-inventory.sql in your database
  • Add the following code to your server.cfg/resouces.cfg

Migrating from old qb-inventory

Database

Upload the new inventory.sql file to create the new inventories table

Use the provided migrate.sql file to migrate all of your saved inventory data from stashes, trunks, etc

Once complete, you can delete gloveboxitems stashitems and trunkitems tables from your database

CREATE TABLE IF NOT EXISTS `inventories` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `identifier` VARCHAR(50) NOT NULL,
  `items` LONGTEXT DEFAULT ('[]'),
  PRIMARY KEY (`identifier`),
  KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

License

QBCore Framework
Copyright (C) 2021 Joshua Eger

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/>

qb-inventory's People

Contributors

amantu-qbit avatar arsh939 avatar berkiebb avatar borreke0 avatar chatdisabled avatar christianbdev avatar d4isdavid avatar darknight2590 avatar evanillaa avatar ghzgarage avatar gutsoo avatar ihyajb avatar itsanobrainer avatar jnktechstuff avatar jonezkti avatar josh-tf avatar kamuikody avatar macky4546 avatar mataskc avatar mechomancer avatar r0adra93 avatar s33g avatar stolk88 avatar swkeep avatar t0r3tto avatar tom-osborne avatar ushifty avatar viruspc2002 avatar z3rio avatar zfbx 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

Watchers

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

qb-inventory's Issues

Suggestion

Make a "Give" button next to "Use". It would be way better then dropping and then taking it.

Shops not working anymore

[ script:qb-inventory] SCRIPT ERROR: @qb-inventory/server/main.lua:931: attempt to index a nil value (local 'itemInfo')
[ script:qb-inventory] > SetupShopItems (@qb-inventory/server/main.lua:931)
[ script:qb-inventory] > ref (@qb-inventory/server/main.lua:223)
[ script:qb-inventory] > ref (@qb-core/server/functions.lua:8)
[ script:qb-inventory] > (@ghmattimysql/ghmattimysql-server.js:1)

transfer item trick

let call owner car(1) is player1, him givekeys to player2(another player), and player2 on this vehicle , player1 depot the car(1), this old car(1) not disappear, and them can transer items from this car(1) trunk/glovebox, not made dupplicated

Icon bug

If you drop an item and then pick it up, the icon stays on the floor

add close button to inv

Hello, is it possible to add a cloase option to inv ?
Why give item suggestions are rejected, A favorite choice for many players

Sync Crafting Config and Inventory Config by using a shared config.

People forget how to add/remove/edit items in inventory config when they want to edit something in crafting configs.

The best way to do this would be, making a shared config in crafting for Item Crafting and Attachment Crafting and both of the scripts taking same config to avoid editing both of them.

I can make a PR if this makes sense.

Some Items Arent Stacking

In The Inventory sometimes items wont stack even though they have stacked before also i cannot get help from the QBCore Discord for some reason it doesnt say im banned but i just cant enter it Tkiljoy#7435

Why was the size of the inv reduced through html and css ?

Why was this thing done?
Why was the inv size reduced?
Why imitate other invs "linden_inventory"?
I hope the size of the bag will return to the screen as it was in the beginning

This size was perfect for the vision
Yes, it is now an annoying choice
https://camo.githubusercontent.com/abba3b2acc735f9945fcd11009c9c6ebef09287ce45e7109859c04ef8836a8c9/68747470733a2f2f696d6775722e636f6d2f6351577251344c2e706e67

https://ibb.co/895rd99

I wish the bag could be back in size

Huge issue

Was playing around with the inventory when I notice that whenever your want to drop an item but then changed your mind so you put your item back to your own inventory it will make the item either disappear or force the item to drop and not store in the player's inventory. The only way to put your item back to the player inventory is if the player closes their inventory after dropping the item only then they can open the drop inventory and put them back. Any work around this?

P.S. Please add durability to standard items.

bug inv

There is a general problem
It is when deleting an item from a file shared.lua
The server throws a black screen to the player
Not allowing him to join the server
There is a solution made by programmers esx
When the player enters the server, he checks if there are any items that are not present
It automatically deletes it from the database table player
Thus, he is allowed to cross

Player Reports

Player reported:

  • When cops search players they can only see the first two rows of their inventory
  • The rob command does not work
  • Sometimes does not give items unless fast slots are empty

help for bag size inventory

Is it possible to help get the bag size inventory into bigger squares and more screen usage? It's a bit small
What are the elements that control the size in css of the inventory on the screen?

Ground Icons

After you pick something up off of the ground the icon still stays there as if there is something still on the ground.

Missing Inventory Images

catfish.png
largemouthbass.png
weapon_c4.png
goldfish.png
redfish.png
grapejuice.png
tigersharkmeat.png
weapon_proximitymine.png
bluefish.png
weapon_garbagebag.png
salmon.png
weapon_remotesniper.png
killerwhalemeat.png
grape.png
stingraymeat.png
stripedbass.png
weapon_handcuffs.png

I am just wondering if we should exchange them with placeholders or if someone has them? I would open a PR.

Inventory Bug Items Duplicates after the first try

There's a bug in qb-inventory when you store items, the rows in database duplicates , that means the first saved item will keep coming back everytime you store or take new item, so player could lose their items and also they can spam/duplicate their item from stash to drag into players inventory

dsc

Prevent Inventory Spam Opening

Hey, I noticed an issue when playing with the inventory if you press and hold the tab it will spam the inventory opening animation.

To fix this should be simple:
in client/main.lua:114:

RegisterCommand('inventory', function()
    if not isCrafting then
        if not inInventory then
              -- PlayerData function.....
        end
    end
end)

Thanks, was going to make a PR but perhaps it might be a simple fix just to put in issues.

Stash errors [BUG]

[ script:oxmysql] [ERROR] qb-inventory was unable to execute a query!
[ script:oxmysql] Unknown column 'items' in 'field list'
[ script:oxmysql] SELECT items FROM stashitems WHERE stash = 'apartment32107'
[ script:qb-inventory] SCRIPT ERROR: @qb-inventory/server/main.lua:932: attempt to index a nil value (local 'result')
[ script:qb-inventory] > handler (@qb-inventory/server/main.lua:112)
[ script:qb-inventory] > safeCallback (webpack-internal:///./src/index.js:22)
[ script:qb-inventory] > eval (webpack-internal:///./src/index.js:44)
[ script:qb-inventory] > safeCallback (webpack-internal:///./src/index.js:22)
[ script:qb-inventory] > eval (webpack-internal:///./src/index.js:44)
[ script:qb-inventory] > safeCallback (webpack-internal:///./src/index.js:22)
[ script:qb-inventory] > eval (webpack-internal:///./src/index.js:44)

Slot 6 Hotbar

My inventory slots is on 40 because i did not wanted the locked 6 slot. In the inventory it self it's gone but the hotbar still shows it.
Check the .js file and it should remove it since the slots is less then 41.

How does the crafting work?

When i go to the location of the attachementcrafting, theres nothing there.

I looked into the client file, but i cannot find reference to how to craft.

Give script?

Hi

I just want to ask if you can add a give script on the inventory? So you can give items to any selected player in the game

[Suggestion] Move all items if number in the middle is to high

If the number in the middle is higher than what you currently have it would be nice if it would move all items instead.

Let's say you have 50 entered in the middle but currently only have 20 of the item you are trying to move it errors out.

I think it would be nice if it would just move those 20 items that you have.

[Bug] A Dupe Bug

Hi, I found a dupe bug that really easy to use

when you combine something and one of the items in a trunk, glovebox, other player inventory, stash
the item in the other inventory isn't removing but the inventory tries to remove the item from you

Inventory improvements

Actually the inventory is little buggy when you hit it with tab, also the gun ammo disappearing, it will be really nice if you add a cooldown to open inventory, cooldown to use the item and fix the ammo issue.

bug when using stash

When this order is used
It works correctly
The second time is the output null stash

TriggerEvent("inventory:client:SetCurrentStash", "ganga")
        TriggerServerEvent("inventory:server:OpenInventory", "stash", "ganga", {
            maxweight = 20000,
            slots = 5,
        })

Huge Issue Duplicate Item

It happen when you move all your items to stash/trunk (nothing left in personal inventory) then log out. when you log in everything in your inventory still in your personal inventory also in stash/trunk

Help me,plz

When i tried to import the database,it show:
mysql bug
how can I fix it

When you drag items they disapear

When you drag items or 'switch' places both items will disappear and be removed from the inventory, especially with weapons, but also with phones, food etc.

drop marker is not dissapering after picking up items.

Describe the bug
when dropping items on the ground and some other player is picking up the same item, so there is no more items left on the ground, the red marker is still vissible on the ground.

To Reproduce
Steps to reproduce the behavior:
1: player 1 drops a item.
2: player 2 picks up item.

Expected behavior
marked should dissapear.

Screenshots
na

Questions (please complete the following information):
-i have pushed all the latest github releases.
i only standalone addons. like 3dme.

Additional context
i think this happends more often when u get the error showing u have 0 of an item u actually have more than 0 of.

Problems with trunk and glovebox

Hi, I'm getting this error after updating to oxmysql and then updating the inventory to the latest release. I havn't touched anything in the resource.

4ed2180aefd0eb66b2dd7297c35963bf

Inventory shops bug

when buying items from a shop the middle inventory number is a nonfactor when it should be a factor when using the right mouse click to buy items

Reproduction of the issue:

  • go to the shop
  • put the 1 or 20 or 40 whatever number in the middle of the inventory and buy items with a right mouse click
  • it will buy all selected items from the shop instead of using the middle inventory number as a factor of how many items should the player buy if == 0 notify you cant buy 0 items :D

Expected:

  • to buy the number of items that middle inventory number is

Solution:

  • Make a middle inventory number to be a factor when buying from shops with click and drag or with the right mouse button

items that are increased in the bag

When the checkout is through the apartment
There are items that are increased in the bag
I don't know if this problem happened once, or more, or by chance
I have not tried it more than once

Swapping items from main inventory and stash

Hello i noticed a bug where if you try to swap 2 items that are the same but not stackable like weapons you lose one of the two.
Example.
One on the main inventory slot 5 and the other one on stash inventory slot 5 if you try to swap them one will disappear.
That happens only if they are on the same slot. If they are on different slot both get into stash instead of swapping.

Video:
https://streamable.com/du2pv3

Suggestion

  1. Make guns use ammo available on inventory, instead of associating a number of ammo to weapon and only being able to use that ammo on reload. Just like linden_inventory. Much more intuitive and real solution. While you have ammo on inventory you can reload your weapon.

  2. Optimize the way you can give items to other players. I think the only available option atm is to put things on the ground for other to pick up?! Make some option to give what you want to players.

Can't change key for inventory

I am trying to change the key for the qb-inventory as I personally do not like how it's currently TAB to open and close.
I have been trying for the past 10 minutes trying to replace the keybind with something other than tab.
Each time I've done this, I've either restarted the server, or the resource to update it and nothing works.

In case anyone is wondering where I am changing the keybind, I am changing it in qb-inventory/client/client.lua and if you scroll down some, you'll see this:
RegisterKeyMapping('inventory', 'Open Inventory', 'keyboard', 'TAB')

Now, I've replaced the TAB part with a test key like "j", but after a restart of the resource, it is still binded to TAB

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.