Jump to content
  • 0

100 and over item check


Fresh prince

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

Hello rathena,

Can someone make a npc that checks if a player has 100 and over items in his/her inventory before proceeding?

Like:

If items are over 100;

Mes " you cannot continue because your items in your inventory is over 100 different items";

Else; proceed.

Something like this. Why? To prevent items from falling when getitem, if the players inv has 100+ different items.

Thanks!!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  


getinventorylist;

if ( @inventorylist_count >= 100 ) {

mes "You have 100 different items in ur inventory.";

close;

}

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   2
  • Joined:  01/16/13
  • Last Seen:  

Something like this man.. based of your question. You have to give more detail...

mes "[item Checker]";
if(countritem(502) > 100) goto L_Checker;


L_Checker:
mes "[item Checker]";
mes "you cannot continue because your items in your inventory is over 100 apples";
close;

if you want more then one item do this

if ((countritem(502) > 100) || (countritem(502) > 100) goto L_Checker;

Edited by Kenjic
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

Thank you for your response bro.

My question is this, if i have 100+ dofferent items in my inventory, and for example i opened an obb or ovb, it will drop to the ground.

Im looking for a script or an item script where it checks of a player has more than 100 different items in his inventory.

Anothe example is when you decard a compunded weapon, if you have more than 100+ items on your inventory, your cards from the decard will fall off the ground.

I need like:

Npc goes like checking a players inventory first if he has more than 100+ items on inventory if yes, close;

If not, proceed. Something like that.

Thanks you!!

Btw, 100+ different items means the maximum allowable different items a player can carry. My client was setup like that

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   2
  • Joined:  01/16/13
  • Last Seen:  

Ok I see.. it will have something to do with these command.. but I need to experiment..

getinventorylist;

This command sets a bunch of arrays with a complete list of whatever the
invoking character has in their inventory, including all the data needed to
recreate these items perfectly if they are destroyed. Here's what you get:

@inventorylist_id[] - array of item ids.
@inventorylist_amount[] - their corresponding item amounts.
@inventorylist_equip[] - whether the item is equipped or not.
@inventorylist_refine[] - for how much it is refined.
@inventorylist_identify[] - whether it is identified.
@inventorylist_attribute[] - whether it is broken.
@inventorylist_card1[] - These four arrays contain card data for the items.
@inventorylist_card2[] These data slots are also used to store names
@inventorylist_card3[] inscribed on the items, so you can explicitly check
@inventorylist_card4[] if the character owns an item made by a specific
craftsman.
@inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires.
@inventorylist_bound[] - whether it is bound to the character
@inventorylist_count - the number of items in these lists.

This could be handy to save/restore a character's inventory, since no other
command returns such a complete set of data, and could also be the only way to
correctly handle an NPC trader for carded and named items who could resell them
- since NPC objects cannot own items, so they have to store item data in
variables and recreate the items.

Notice that the variables this command generates are all temporary, attached to
the character, and integer.

Be sure to use @inventorylist_count to go through these arrays, and not
'getarraysize', because the arrays are not automatically cleared between runs
of 'getinventorylist'.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Use checkweight to make sure the total weight of the items does not exceed the character's carrying capacity and to check if he has a free 'inventory slot' (i.e. the quote)

 

it checks of a player has more than 100 different items in his inventory

  • Upvote 1
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...