Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. else if (_command.startsWith("do_announce"))
  2. {
  3. String text = _command.substring(12);
  4. int ITEM_IDS[] = { 700007 };
  5.  
  6. if (text.length() > 50 && !activeChar.isGM())
  7. {
  8. activeChar.sendMessage("You can't announce a message with more than 50 characters.");
  9. return;
  10. }
  11. for (int itemId : ITEM_IDS)
  12. {
  13. if (activeChar.getInventory().getItemByItemId(itemId) == null)
  14. {
  15. activeChar.sendMessage("You don't have the required items!");
  16. return;
  17. }
  18.  
  19. activeChar.destroyItem("Announcements", itemId, 1, null, true);
  20. }
  21.  
  22. Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();
  23. {
  24. for (L2PcInstance onlinePlayer : pls)
  25. onlinePlayer.sendPacket(new CreatureSay(0, Say2.ANNOUNCEMENT, activeChar.getName(), text));
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement