[Release] Inventory System v2.1 (Personal Menu)

When our characters die the items in the inventory remains, how to delete the items at the time of death?

capacity update not work
im setup 100 in vdkinv.lua
ingame not work im pickup 100+ of item

1 Like

Have a look to item:Reset (it’s an event)

1 Like

Hi/Salut, error

Pourtant j’ai bien tout installer, je comprends pas d’ou ça vient, concrètement, une fois avoir choisi le métier “Mineur” en jeu le métier ce change bien, mais après aucun marqueur de récolte apparait …

I do not know where it comes from, actually, once you have chosen the trade “Miner” in play the job it changes well, but after no harvest marker appears …

Vdk why we can add or remove items ? Can you delete that?

2017-04-25 18:11:13.8246|ERROR|CitizenMP.Server|Error executing event handler for event item:reset in resource es_vdk_inventory: Exception has been thrown by the target of an invocation.
2017-04-25 18:11:13.8246|ERROR|CitizenMP.Server| at [U] System.Reflection.MonoMethod.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object[] parameters,CultureInfo culture)
2017-04-25 18:11:13.8246|ERROR|CitizenMP.Server| at [U] System.Reflection.MethodBase.Invoke(Object obj,Object[] parameters)
2017-04-25 18:11:13.8246|ERROR|CitizenMP.Server| at [U] System.Delegate.DynamicInvokeImpl(Object[] args)
2017-04-25 18:11:13.8246|ERROR|CitizenMP.Server| at [U] System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
2017-04-25 18:11:13.8246|ERROR|CitizenMP.Server| at [U] System.Delegate.DynamicInvoke(Object[] args)
2017-04-25 18:11:13.8248|ERROR|CitizenMP.Server| at [U] CitizenMP.Server.Resources.ScriptEnvironment.TriggerEvent(String eventName,String argsSerialized,Int32 source)
2017-04-25 18:11:13.8248|ERROR|CitizenMP.Server|Inner exception: Index was outside the bounds of the array.

I got this on player death. I don’t understand how can i solve it… any idea ?

Please check that in your gta5_gamemode_essential db the user_weapons exists

It is not item:reset but item:Reset (you have to modify this in the script)

c’est un inventaire, pas un script de traitement

Ty ! now i got this (my inv is still not empty after death)


2017-04-25 22:21:05.9055|WARN|CitizenMP.Server|A client tried to send an event of type item:Reset, but it was not gree                                                                         nlit for client invocation. You may need to call RegisterServerEvent from your script.

I modified the request to this but it’s still bug :frowning:

AddEventHandler("item:Reset", function()
    TriggerEvent('es:getPlayerFromId', playerId, function(user)
        local player = user.identifier
        local executed_query = MySQL:executeQuery("SELECT * FROM user_inventory JOIN items ON `user_inventory`.`item_id` = `items`.`id` WHERE user_id = '@username'", { ['@username'] = player })
        local result = MySQL:getResults(executed_query, { 'quantity', 'libelle', 'item_id' }, "item_id")
        if (result) then
            for _, v in ipairs(result) do
                MySQL:executeQuery("UPDATE user_inventory SET `quantity` = 0 WHERE `user_id` = '@username' AND `item_id` = @id", { ['@username'] = player, ['@qty'] = 0, ['@id'] = tonumber(v.item_id) })
            end
        end
    end)
end)

post an issue on github page

Up ! pls

The problem persists, when you open the inventory and press “enter” the menu closes and you can no longer open it.

I disable the code to “add 1” or “delete 1” (because people can “add 1” without being on the place of harvest)

Ty.

I have exactly the same problem please help us. Ty

Maximum capacity don’t work on my server

Me too maximum capacity doesn’t work

I try to find a fix but i have this problem. Requête SQL :

CREATE TABLE recolt (
ID int(11) unsigned NOT NULL AUTO_INCREMENT,
raw_id int(11) unsigned DEFAULT NULL,
treated_id int(11) unsigned DEFAULT NULL,
job_id int(11) DEFAULT NULL,
price int(11) DEFAULT NULL,
field_id int(10) unsigned DEFAULT NULL,
treatment_id int(10) unsigned DEFAULT NULL,
seller_id int(10) unsigned DEFAULT NULL,
PRIMARY KEY (ID),
KEY raw_id (raw_id),
KEY treated_id (treated_id),
KEY job_id (job_id),
KEY field_id (field_id),
KEY treatment_id (treatment_id),
KEY seller_id (seller_id),
CONSTRAINT recolt_ibfk_1 FOREIGN KEY (raw_id) REFERENCES items (id),
CONSTRAINT recolt_ibfk_2 FOREIGN KEY (treated_id) REFERENCES items (id),
CONSTRAINT recolt_ibfk_3 FOREIGN KEY (job_id) REFERENCES jobs (job_id),
CONSTRAINT recolt_ibfk_4 FOREIGN KEY (field_id) REFERENCES coordinates (id),
CONSTRAINT recolt_ibfk_5 FOREIGN KEY (treatment_id) REFERENCES coordinates (id),
[…]
MySQL a répondu: Documentation

#1215 - Impossible d’ajouter des contraintes d’index externe

i’m from quebec so you can talk me in english or french no problem

I got a bunch of errors and heidisql dont let me do it :confused:

Do you have install Inventory System and Job System ?

ty for share !

du you have code to see the inventory of other player ingame ?

I did not understand how to reset the inventory after death. Can you be more explicit?