question

Pat avatar image
Pat asked

Check to see if a player has an item already

Looking for a way to check to see if a player has an item already before they buy it. I don't want the player to be able to buy multiple items since there is no need for it.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

The way to do this would be by querying the user's inventory, either via GetUserInventory or GetUserCombinedInfo, assuming you're checking on the client.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pat avatar image
Pat answered

I have the catalog list and the inventory list, so is it just nested for loop to see if the player has it?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Yes, once you have the data, you would need to loop through it to determine what the player has and doesn't have.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.