Results 1 to 2 of 2
  1. #1
    KamikadZee is offline Member
    Join Date
    Oct 2011
    Rep Power

    Default Can only iterate over an array.... Miss understanding

    I found some scripts but i always have problem applying them to my build of server,
    I never had any other problems with other custom scripts, just cant get anitdual box work.
    Most common to use is /* This program is free software; you can redistribute it and/or modify * it u -
    but when i just paste
    Java Code:
     public static void disc(final L2PcInstance player)
          player.sendPacket(new CreatureSay(1, Say2.HERO_VOICE, "SYSTEM", "You cannot play with dualbox."));
          ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
             public void run()
          }, 20000);
       public static boolean check(L2PcInstance player)
          boolean loggedz0r = false;
          for (L2PcInstance playerz0r : L2World.getInstance().getAllPlayers())
    L2World.getInstance().getAllPlayers()) - eclipse gives me error on this line (It may sound stupid for some of you java proffesionals, but i actually have no idea what he want from me)
    it say's "Can only iterate over an array or an instance of java.lang.Iterable"
    I found some explanations in google, but it's not written in human language I actually couldn't understand what he wants from me.
    Any one can suggest fix (Well better be a little explanation)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Can only iterate over an array.... Miss understanding

    Post the method signature for getAllPlayers(). What is its return type?

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. How to iterate over objects in a class?
    By Neilos in forum New To Java
    Replies: 10
    Last Post: 08-18-2011, 08:02 PM
  2. iterate through a HashMap ?
    By aneuryzma in forum New To Java
    Replies: 2
    Last Post: 03-27-2011, 03:26 PM
  3. How to iterate through two Arrays?
    By aRTx in forum Advanced Java
    Replies: 3
    Last Post: 05-18-2010, 07:48 AM
  4. Replies: 2
    Last Post: 07-03-2008, 01:43 PM
  5. Using Enumeration to iterate through Hashtable
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-15-2008, 08:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts