Jump to content
  • 0
GodKnows Jhomz

Temporary Item Array

Question

Can anyone help me how to make an npc with temporary array.
The npc should be like this:

Talk to npc then selection of Add Item or Close.
After clicking Add Item, it will ask for Item ID then Item Amount.
Then it will show the item name and amount after clicking next.
( After next it will show the current item list and it will show the same menu (Add Item or Close) )
After clicking Add Item again, it will do the same then after adding item id and amount it will show the list again including the latest item added and the same menu.
When you click close, it will clear the array.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
izlude,128,124,0	script	dumb menu A	4_F_01,{
	mes "what do you want to do";
	while (true) {
		next;
		if (select( "^FF0000Add an item^000000", "Close" ) == 2)
			end;
		mes "Input Item ID :";
		input [email protected]_item;
		if (getitemname([email protected]_item) == "null") {
			mes "Invalid item ID " + [email protected]_item;
			continue;
		}
		mes "Input Amount :";
		input [email protected]_amount;
		if ([email protected]_amount == 0) {
			mes "Invalid amount.";
			continue;
		}
		[email protected]_id[ [email protected] ] = [email protected]_item;
		[email protected][ [email protected] ] = [email protected]_amount;
		[email protected]++;

		mes "Item list :";
		for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )
			mes ([email protected]+1) + "/ x" + [email protected][[email protected]] + " ^ff0000" + getitemname([email protected]_id[[email protected]]) + "^000000";
	}
}

 

  • MVP 2
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.