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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock