Jump to content
  • 0

Problem with getinventorylist;


Snow

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   34
  • Joined:  05/30/12
  • Last Seen:  

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
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

add

deletearray @inventorylist_expire;

before getinventorylist;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   34
  • Joined:  05/30/12
  • Last Seen:  

i tried this, but the script still continues instead of closing :(

Link to comment
Share on other sites


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


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

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;
   }
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   34
  • Joined:  05/30/12
  • Last Seen:  

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
Link to comment
Share on other sites


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

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   34
  • Joined:  05/30/12
  • Last Seen:  

alright, thank you for the fast response @ll :>

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