Jump to content
  • 0
johnbond

inventory checks

Question

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

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

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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.