Jump to content
  • 0

inventory checks


johnbond

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Hello guys,

 

What line(s) can I use to check if the character has something in inventory when he clicks NPC? I mean the character should not have anything in his inventory/equip before he can talk to NPC. Not weight (because some items have 0 weight) but item(s) in inventory.

 

Thanks.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

Getinventorylist
to obtain the list of the items the player is currently holding in their inventory.
use

if (@inventorylist_count) {
mes "please drop all of your items first";
close;
}

to check if there is an item in it or not.
this will return 0 if there's no item in it, and a positive integer if is.
 using this statement, it will ask the player to drop the items first, if they have at least 1 item in their inventory.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Getinventorylist

to obtain the list of the items the player is currently holding in their inventory.

use

if (@inventorylist_count) {
mes "please drop all of your items first";
close;
}

to check if there is an item in it or not.

this will return 0 if there's no item in it, and a positive integer if is.

 using this statement, it will ask the player to drop the items first, if they have at least 1 item in their inventory.

 

 

Awesome its working!

 

Reputation given.

 

Thanks! :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...