Jump to content
  • 0

[help]read all castle lords


Question

Posted

telos panton thelw na kanw 1 command gm , pou na dinei gia paradigma 5 bogs se olous tous castle lords, to mono pou de kserw ine pos tha diavazei olous tous castle lords?

for (player: edw ti?) ti kanw?help!

3 answers to this question

Recommended Posts

  • 0
Posted

telos panton thelw na kanw 1 command gm , pou na dinei gia paradigma 5 bogs se olous tous castle lords, to mono pou de kserw ine pos tha diavazei olous tous castle lords?

for (player: edw ti?) ti kanw?help!

 

ta alla ftiaxta monos sou :)prosexe auto edw se sena mporei na einai diaforetika etc litourgi o code sto pack mou...

final L2PcInstance[] players = L2World.getInstance().getAllPlayersInArray();

 

 

 

 

 

 

else if (command.startsWith("admin_give_item_to_castlelords"))
	{
		String val = command.substring(22);
		StringTokenizer st = new StringTokenizer(val);
		int idval = 0;
		int numval = 0;
		if (st.countTokens() == 2)
		{
			String id = st.nextToken();
			idval = Integer.parseInt(id);
			String num = st.nextToken();
			numval = Integer.parseInt(num);
		} 
		else if (st.countTokens() == 1) {
			String id = st.nextToken();
			idval = Integer.parseInt(id);
			numval = 1;
		}
		int counter = 0;
		L2Item template = ItemTable.getInstance().getTemplate(idval);
		if (template == null) {
			activeChar.sendMessage("This item doesn't exist.");
			return false;
		}
		if (numval > 10 && !template.isStackable()) 
		{
			activeChar.sendMessage("This item does not stack - Creation aborted.");
			return false;
		}
		final L2PcInstance[] players = L2World.getInstance().getAllPlayersInArray();
		for(L2PcInstance onlinePlayer : players)
		{
				if (activeChar != onlinePlayer && onlinePlayer.isOnline() && onlinePlayer.getClan() != null && onlinePlayer.getClan().getHasCastle() > 0  && onlinePlayer.isClanLeader() && (onlinePlayer.getClient() != null && !onlinePlayer.getClient().isDetached()))
				{
					onlinePlayer.getInventory().addItem("Admin", idval,numval, onlinePlayer, activeChar);
					onlinePlayer.sendMessage("Admin spawned " + numval+ " " + template.getName()+ " in your inventory.");
					counter++;
				}
			}
		activeChar.sendMessage(counter + " players rewarded with " + template.getName());
	}
	return true;
}

 

 

 

 

 

 

  • 0
Posted

ta alla ftiaxta monos sou :)prosexe auto edw se sena mporei na einai diaforetika etc litourgi o code sto pack mou...

final L2PcInstance[] players = L2World.getInstance().getAllPlayersInArray();

 

 

 

 

 

 

else if (command.startsWith("admin_give_item_to_castlelords"))
	{
		String val = command.substring(22);
		StringTokenizer st = new StringTokenizer(val);
		int idval = 0;
		int numval = 0;
		if (st.countTokens() == 2)
		{
			String id = st.nextToken();
			idval = Integer.parseInt(id);
			String num = st.nextToken();
			numval = Integer.parseInt(num);
		} 
		else if (st.countTokens() == 1) {
			String id = st.nextToken();
			idval = Integer.parseInt(id);
			numval = 1;
		}
		int counter = 0;
		L2Item template = ItemTable.getInstance().getTemplate(idval);
		if (template == null) {
			activeChar.sendMessage("This item doesn't exist.");
			return false;
		}
		if (numval > 10 && !template.isStackable()) 
		{
			activeChar.sendMessage("This item does not stack - Creation aborted.");
			return false;
		}
		final L2PcInstance[] players = L2World.getInstance().getAllPlayersInArray();
		for(L2PcInstance onlinePlayer : players)
		{
				if (activeChar != onlinePlayer && onlinePlayer.isOnline() && onlinePlayer.getClan() != null && onlinePlayer.getClan().getHasCastle() > 0  && onlinePlayer.isClanLeader() && (onlinePlayer.getClient() != null && !onlinePlayer.getClient().isDetached()))
				{
					onlinePlayer.getInventory().addItem("Admin", idval,numval, onlinePlayer, activeChar);
					onlinePlayer.sendMessage("Admin spawned " + numval+ " " + template.getName()+ " in your inventory.");
					counter++;
				}
			}
		activeChar.sendMessage(counter + " players rewarded with " + template.getName());
	}
	return true;
}

 

 

 

 

 

 

gamises file :D to katafera poli eukola, stin ousia epsaxna mono  auta ta dio lines pou dn skeftika pos na ta kanw:

final L2PcInstance[] players = L2World.getInstance().getAllPlayersInArray();

for(L2PcInstance onlinePlayer : players)

locked

Guest
This topic is now closed to further replies.


×
×
  • Create New...