Jump to content
  • 0

array problem


ohyono

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   15
  • Joined:  01/10/12
  • Last Seen:  

Hello rAthena, How are you.

The reason why I write is because I have a problem with a script. 

In this part of the script from an array a menu is generated with only the items you have in inventory. for later delete the selected item. The problem is that I can't find how to make the selected item in the menu was deleted.

 

post-1433-0-31377200-1466566537_thumb.png  post-1433-0-51239600-1466566536_thumb.png  post-1433-0-70772800-1466566535_thumb.png

 

Of course , if all the items in the array are present in the inventory , it works fine , but if any is missing the start , conditions are no longer the error occurs In this part of the script from an array a menu with only the items you have in inventory is generated

 

 

post-1433-0-02311300-1466566535_thumb.png

 

Thank you , I hope you can help me , because I have a few days with this problem.

 

-Van

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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

for ( .@c = 0; .@c < getarraysize( $@ingot ); .@c++ ) {
	if ( countitem( $@ingot[.@c] ) ) {
		.@menu$ = .@menu$ + getitemname( $@ingot[.@c] );
	}
	.@menu$ = .@menu$ + ":";
}

always append a semicolon even if the item doesn't exist in the inventory.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   15
  • Joined:  01/10/12
  • Last Seen:  

Yes is working. Thank you Emistry

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