qbcore-framework / qb-traphouse

Player Trap Houses For QB-Core
GNU General Public License v3.0
31 stars 128 forks source link

[BUG] #49

Closed brunomtr5 closed 1 year ago

brunomtr5 commented 1 year ago

Hello, I've got an error when trying to place an item in the traphouse inventory.

[ script:qb-traphouse] SCRIPT ERROR: @qb-traphouse/server/main.lua:109: attempt to index a nil value (field '?') [ script:qb-traphouse] > ref (@qb-traphouse/server/main.lua:109) [ script:qb-traphouse] > handler (@qb-inventory/server/main.lua:1599) [ script:qb-inventory] SCRIPT ERROR: @qb-inventory/server/main.lua:1599: [ script:qb-inventory] An error occurred while calling export GetInventoryData in resource qb-traphouse:

The item doesn't go to the stash inventory. When I open the inventory the item is still there. There is no 'cleaning' procedure.

Best regards, Bruno Pereira

adzboo commented 1 year ago

i have the same issue

AvilaBG commented 1 year ago

So the problem its not in the qb-traphouse its in qb-inventory, before calling the export "GetInventoryData" to get the traphouse id they split a string and the character used for the split its wrong.

To solve it go to line 1602 of latest qb-inventory/server and replace this: local traphouseId = QBCore.Shared.SplitStr(toInventory, "-")[2] For this: local traphouseId = QBCore.Shared.SplitStr(toInventory, "_")[2]

This should solve your problems with the traphouse

brunomtr5 commented 1 year ago

Many thanks, I will update it.

Best regards, Bruno Pereira

jnccloud commented 1 year ago

Latest PR fixes this issue as well: https://github.com/qbcore-framework/qb-traphouse/commit/058ba3fea7b86c2872eadd31eedca59b59fc491b

fransdg commented 1 year ago

So the problem its not in the qb-traphouse its in qb-inventory, before calling the export "GetInventoryData" to get the traphouse id they split a string and the character used for the split its wrong.

To solve it go to line 1602 of latest qb-inventory/server and replace this: local traphouseId = QBCore.Shared.SplitStr(toInventory, "-")[2] For this: local traphouseId = QBCore.Shared.SplitStr(toInventory, "_")[2]

This should solve your problems with the traphouse

it doesn't work for me got also the same errors