Skip to content

Joeystrmz/qb-inventory

 
 

Repository files navigation

WHY DID I RENAMED THE FOLDER ?

It was causing problem with the latest qb-core function, Core function was looking for qb-inventory

And motive to make this drag and drop for lovely qb peoples

You should name the folder to qb-inventory not (qb-inventory-withdecay)

ADDED EXAMPLE OF ITEMS.LUA

qb-core/shared/items.lua

If you are lazy to put. You can use mine replace your items.lua with the one i provided and just modify the ["decay"] = 1.0 = 1 day

Inventory Decay

image

Credits:

aj - aj-inventory

loljoshie - lj-inventory

qbcore - qb-inventory

Jimathy - Toggle Item

Treey and Jay - For introducing decay system

How to install lj-inventory

  • Download source files from github
  • Drag source files into your resources folder
  • Rename folder from qb-inventory-withdecay-main to qb-inventory

TO DO

you need to add a decay and created value in your qb-core/shared/items for all items, the decay is set to be the days the item lasts

["created"] = nil
["decay"] = 28.0 -- for 28 days

REPLACE ADDITEM EVENT

TriggerServerEvent("QBCore:Server:AddItem, item, 1)

TO

exports['qb-inventory']:toggleItem(1, itemName, 1)

REPLACE REMOVEITEM EVENT

TriggerServerEvent("QBCore:Server:RemoveItem, item, 1)

TO

exports['qb-inventory']:toggleItem(0, itemName, 1)

REPLACE HASITEM CALLBACK

QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
        if hasitem then
              -- Has Item
        end
end, "sandwich")

TO

      if QBCore.Functions.HasItem("sandwich") then
             -- Has Item
      end

About

LJ-INV FORGERY BRANCH

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 69.5%
  • JavaScript 24.5%
  • CSS 3.9%
  • HTML 2.1%