G1R:MP Forum Alpha
Log in Join
Gothic 1 Remake Multiplayer

The Colony Forum

News, support, development discussions, server communities, and stories from beyond the Barrier.

Colony discussion

getPlayerItemCount

Started by Gummik in Scripting Help

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
08-31-2026, 08:13 AM (This post was last modified: 08-31-2026, 09:05 AM by Gummik.)
#1



Hi, I have a small issue with getPlayerItemCount.
I know I might be showing this like a complete idiot, but according to the
Code:
getPlayerItemCount
results, my framework doesn't seem to detect changes in the inventory.
I'm not even sure why I'm showing the database value there Big Grin What I'm mainly trying to point out is that towards the end, you can see that I drop the item, but the console still says that I have it. (It's still in the database because it simply isn't being removed from the engine's inventory.)
Am I just being dumb and have something configured incorrectly? I also tried the
Code:
hasPlayerItem
function, and it returns
Code:
true
for the items.

(The code and how I’m using it are shown in the video.)











Edit : Second test picked items from ground [Image: 1788165616_0527.png]




Third edit : 
I found out that if I give myself an item and remove it using the function, it works really well. But it only works with giveitem/removeItem.
The problem occurs when, for example, I pick up an item from the ground — the value doesn't get updated. The same happens when I drop an item — the value doesn't get updated and stays the same. Smile
Forum Jump: