Jump to content

Question

Posted

Hello guys,

 

so i would like to know how to create a combobox that reads xml for a GmShop so for example

 

if on the list there is ArmorS then show player xxx.xml ....

 

Does anybody know how this works i only found an example on AdminCreate in L2Jacis pack but it works with intregers so it is not quite the same could somebody give me an example or how is this supposed to be implimented on java...

 

 

Thank you very much :P 

3 answers to this question

Recommended Posts

  • 0
Posted

If you check how it rly works ull find your answer :D All vars are strings... Next step is to make them integer with checks.. take a look in the example u said..

private static int getCoinId(String name)
	{
		if (name.equalsIgnoreCase("adena"))
			return 57;
		
		if (name.equalsIgnoreCase("ancientadena"))
			return 5575;
		
		if (name.equalsIgnoreCase("festivaladena"))
			return 6673;
		
		return 0;
	}
  • 0
Posted

 

If you check how it rly works ull find your answer :D All vars are strings... Next step is to make them integer with checks.. take a look in the example u said..

private static int getCoinId(String name)
	{
		if (name.equalsIgnoreCase("adena"))
			return 57;
		
		if (name.equalsIgnoreCase("ancientadena"))
			return 5575;
		
		if (name.equalsIgnoreCase("festivaladena"))
			return 6673;
		
		return 0;
	}

 

Does this actually apply for xml i mean should i write if (name.equalsIgnoreCase("ArmorS"))

                                                                                              return ? what the xml number/name for example 25040.xml

  • 0
Posted (edited)

if you are working on acis you can check how admin gm shop works..

try
{
	final int val = Integer.parseInt(command.substring(10));
	
	final NpcBuyList list = BuyListTable.getInstance().getBuyList(val);
	if (list == null)
		activeChar.sendMessage("Invalid buylist id.");
	else
		activeChar.sendPacket(new BuyList(list, activeChar.getAdena(), 0));
}
catch (Exception e)
{
	activeChar.sendMessage("Invalid buylist id.");
}
Edited by melron

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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