ValentinFunk/Pointshop2

Can't equip items

BenitoTV opened this issue · 2 comments

Hey there,

unfortunately, players can't equip items to their Model, Trail, Hat or Accessory slots.
This issue first occured after the latest big TTT2 update, we use Pointshop on our TTT server.

This is our collection: https://steamcommunity.com/sharedfiles/filedetails/?id=2791902327 (there are sub-collections with some little server addons and maps)

This is the lua error from the console when equipping a new playermodel:

L 12/25/2023 - 21:13:06: Lua Error:
        addons/libk/lua/libk/server/sv_libk_database.lua:171: attempt to call local 'callback' (a table value)
                 1: Query (sqlText = "UPDATE `kinv_items` SET  `itemclass` = 'KInventory.Items.91',`data` = '{\"purchaseData\":{\"amount\":0.0,\"time\":1702416149.0,\"currency\":\"points\",\"origin\":\"LUA\"}}',`itempersistence_id` = '91',`inventory_id` = NULL WHERE `id` = '119'", callback = _R._LOADED.team:callback, errorCallback = function (error), blocking = nil) [addons/libk/lua/libk/server/sv_libk_database.lua: 171]
                 2: add (self = { _R._LOADED.team:LibK.TransactionSqlite.__instanceDict: 0xe9e84c72 }, sqlText = "UPDATE `kinv_items` SET  `itemclass` = 'KInventory.Items.91',`data` = '{\"purchaseData\":{\"amount\":0.0,\"time\":1702416149.0,\"currency\":\"points\",\"origin\":\"LUA\"}}',`itempersistence_id` = '91',`inventory_id` = NULL WHERE `id` = '119'") [addons/libk/lua/libk/server/sv_database_transaction.lua: 77]
                 3: s (slot = { _R._LOADED.team:Pointshop2.EquipmentSlot.__ins
        addons/libk/lua/libk/server/sv_libk_database.lua:171: attempt to call local 'callback' (a table value)
                 1: Query (sqlText = "UPDATE `kinv_items` SET  `itemclass` = 'KInventory.Items.91',`data` = '{\"purchaseData\":{\"amount\":0.0,\"time\":1702416149.0,\"currency\":\"points\",\"origin\":\"LUA\"}}',`itempersistence_id` = '91',`inventory_id` = NULL WHERE `id` = '119'", callback = _R._LOADED.team:callback, errorCallback = function (error), blocking = nil) [addons/libk/lua/libk/server/sv_libk_database.lua: 171]
                 2: add (self = { _R._LOADED.team:LibK.TransactionSqlite.__instanceDict: 0xe9e84c72 }, sqlText = "UPDATE `kinv_items` SET  `itemclass` = 'KInventory.Items.91',`data` = '{\"purchaseData\":{\"amount\":0.0,\"time\":1702416149.0,\"currency\":\"points\",\"origin\":\"LUA\"}}',`itempersistence_id` = '91',`inventory_id` = NULL WHERE `id` = '119'") [addons/libk/lua/libk/server/sv_database_transaction.lua: 77]
                 3: s (slot = { _R._LOADED.team:Pointshop2.EquipmentSlot.__instanceDict: 0xebb9feea }) [addons/poiLUA Error in Controller Pointshop2Controller action equipItem:

nil

And maybe it's also worth mentioning, that when I join the server, I get this error in the chat:
Bild_2023-12-25_212440928

The error when joining the server is fixed with removing the First-Person Body addon. But the issue with pointshop still persists

Looks like some code (TTT2 perhaps since you mentioned the update?) is using callback as a global variable which breaks any scripts trying to use that name. Not really anything I can do here - it needs to be fixed in the other addon