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;
}