Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if (_command.startsWith("do_announce"))
- {
- String text = _command.substring(12);
- int ITEM_IDS[] = { 700007 };
- if (text.length() > 50 && !activeChar.isGM())
- {
- activeChar.sendMessage("You can't announce a message with more than 50 characters.");
- return;
- }
- for (int itemId : ITEM_IDS)
- {
- if (activeChar.getInventory().getItemByItemId(itemId) == null)
- {
- activeChar.sendMessage("You don't have the required items!");
- return;
- }
- activeChar.destroyItem("Announcements", itemId, 1, null, true);
- }
- Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();
- {
- for (L2PcInstance onlinePlayer : pls)
- onlinePlayer.sendPacket(new CreatureSay(0, Say2.ANNOUNCEMENT, activeChar.getName(), text));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement