Jump to content
  • 0

[SOLVED] help select + menu


Question

Posted (edited)

Good Day Everyone,

Please help me I want to make all cards in my inventory show in the select menu. 

Thank you so much, ~NOOB

prontera,164,200,4	script	selectcard	112,{
getinventorylist();
setarray .@menulist[0],0;
.@j = 0; 

	for (.@i = 0; .@i < @inventorylist_count; ++.@i)
	{
		.@idd = @inventorylist_id[.@i];
		.@type = getiteminfo(.@idd,2); 
			if (.@type == 6)
			{
			
			.@menulist[@j] = .@idd;
			
			.@j++;
	
			dispbottom .@menulist[@j]; 
			}
			
	}
	
	for (.@i = 0; .@i < getarraysize(.@menulist); ++.@i)
		{

		.@menu$ = .@menu$ + getitemname(.@menulist[.@i]);
		.@menu$ = .@menu$ + ":";
		.@part = .@menulist[select(.@menu$)];

		}
		.@part = .@menulist[select(.@menu$)];

end;	
}

 

Edited by namerpus18

3 answers to this question

Recommended Posts

  • 0
Posted
getinventorylist;
for (.@i = 0; .@i < @inventorylist_count; .@i++) {
	if (getiteminfo(@inventorylist_id[.@i], ITEMINFO_TYPE) == IT_CARD)
		.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]);
	.@menu$ = .@menu$ + ":";
}
.@i = select(.@menu$) - 1;
mes "Your selected card = " + getitemname(@inventorylist_id[.@i]);

you can also do this this way.

  • Love 1
  • 0
Posted

Hi, In the following line there's a missing .(dot) in the variable name:

.@menulist[@j] = .@idd;

To:

.@menulist[.@j] = .@idd;

 

In this part you wrote the same select command line twice:

	for (.@i = 0; .@i < getarraysize(.@menulist); ++.@i)
		{

		.@menu$ = .@menu$ + getitemname(.@menulist[.@i]);
		.@menu$ = .@menu$ + ":";
		.@part = .@menulist[select(.@menu$)];

		}
		.@part = .@menulist[select(.@menu$)];

Remove the first one, and add -1 in the second. Like this:

	for (.@i = 0; .@i < getarraysize(.@menulist); ++.@i)
		{

		.@menu$ = .@menu$ + getitemname(.@menulist[.@i]);
		.@menu$ = .@menu$ + ":";

		}
		.@part = .@menulist[select(.@menu$) - 1];

 

  • Love 1

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