Jump to content
  • 0

Problem with getinventorylist;


Question

Posted (edited)

I added this to make the npc check for rental items, and it all worked as intended.

	   	 getinventorylist;
	if (@inventorylist_expire[0]) {
		mes "You have rental items in your inventory. Please come back with non rental ones.";
	close;
	}

But after the server restart, it doesn't work anymore o_o No error at start up or anything. The Script is just going on now, instead of closing..

First i thought it's because of some src files, but no changes to them. Tested different stuff for more than 4 hours now..

Anyone knowing a reason for this?

Edited by Snow

7 answers to this question

Recommended Posts

Posted

try this to check all item in array

getinventorylist;
for ( set .@i, 0; .@i < @inventorylist_count; set .@i, .@i +1 ){
   if (@inventorylist_expire[.@i]) {
       mes "You have rental items in your inventory. Please come back with non rental ones.";
       close;
   }
}

Posted (edited)

hay emistry. yeah i tried this as well (like you mentioned in the pm) but this only checking for equipped rentals, not for quest related in the inventory (in my current case, it's a quest to exchange Sunglasses[1] to another slotted mid.

I use getequipexpiretick in the item signer, but as i said it won't work for this :/

Most confusing is, like i said, the script in the 1st post worked already.. till the restart.

edit:

thank you QQfoolsorellina, it works now again

Edited by Snow
Posted (edited)

after review back your 1st post ....

the script is actually working ....just checked the wrong items..

@inventorylist_expire[0]

you only checked for the very first items in the array ...but not the rest ~

so you have to add a loop like what QQfoolsorellina did....


if you need to check for certain item with rental....it would be like this..

getinventorylist;
for ( set .@i, 0; .@i < @inventorylist_count; set .@i, .@i +1 )
if(@inventorylist_expire[.@i] && @inventorylist_id[.@i] == <itemID>){
 mes "Please make sure you dont have "+getitemname(@inventorylist_id[.@i])+" as rental items.";
 close;
}

Edited by Emistry

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...