Thread: Player Hints Showing Up for only 1 person

Results 1 to 4 of 4
  1. #1 Player Hints Showing Up for only 1 person 
    Kacey
    I Am Kacey's Avatar
    Join Date
    May 2011
    Posts
    738
    Thanks given
    243
    Thanks received
    56
    Rep Power
    19
    My player hint icons is only showing up for 1 person here is what im doing

    First im adding the players to and array list.

    Code:
    blueclan.add(c.playerId);

    then i made a method called moveplayer is the boolean red team is true create hint icons for every 1 in the blueclan arraylist

    Code:
    if (c.inredteam){
    c.getPA().movePlayer(2207, 4967, 0);
    			c.getPA().createPlayerHints(10, blueclan.size());
    		}

    then i put that method onto the start method.

    which is this.

    Code:
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    			if (Server.playerHandler.players[j] != null )  {
    			Client C = (Client)Server.playerHandler.players[j];
    		 if(redCount >= 1 && blueCount >= 1) {
    			movePlayer(j);
    			
    		}
    	}
    		}

    and it is only showing up for 1 person on each team so if im in blue team i can only see 1 player with hint icon on the red team the others do not have hint icons
    Nothing But Love
    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    Add this under blueclan.add(c.playerId);
    Code:
    System.out.println("Contents of array: " + blueclan);
    This will print a message to your console showing you which player ids are on the blue clan. Make sure that it is adding multiple ids. If not, your problem exists here and you will need to do the following...

    Add this under the start of your array ArrayList<Integer> blueclan = new ArrayList<Integer>();:
    Code:
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    			if (Server.playerHandler.players[j] != null )  {
    Now, however the blue clan and red clan are decided, you will need to add a boolean above this code to only add them players:
    Code:
    blueclan.add(j);
    This also reduces the hassle of having to remove the player from the array (upon leaving or on logout) as it will be reformatted each time it is called.

    I also may have missed something but it's late here so yeah. xD
    Reply With Quote  
     

  3. #3  
    Kacey
    I Am Kacey's Avatar
    Join Date
    May 2011
    Posts
    738
    Thanks given
    243
    Thanks received
    56
    Rep Power
    19
    Quote Originally Posted by Nukka View Post
    Add this under blueclan.add(c.playerId);
    Code:
    System.out.println("Contents of array: " + blueclan);
    This will print a message to your console showing you which player ids are on the blue clan. Make sure that it is adding multiple ids. If not, your problem exists here and you will need to do the following...

    Add this under the start of your array ArrayList<Integer> blueclan = new ArrayList<Integer>();:
    Code:
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    			if (Server.playerHandler.players[j] != null )  {
    Now, however the blue clan and red clan are decided, you will need to add a boolean above this code to only add them players:
    Code:
    blueclan.add(j);
    This also reduces the hassle of having to remove the player from the array (upon leaving or on logout) as it will be reformatted each time it is called.

    I also may have missed something but it's late here so yeah. xD
    when i entered 2 players in the red team i get
    Code:
    [5/01/12 8:17 PM]: Contents of array: [1, 2]
    but when i enter 1 player to blue team look what i get.

    Code:
    [5/01/12 8:17 PM]: Contents of array: [3]
    3? i havnt even added 1 person to the array and its already 3.
    Nothing But Love
    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member Recursion's Avatar
    Join Date
    Feb 2010
    Posts
    638
    Thanks given
    0
    Thanks received
    29
    Rep Power
    41
    The number isn't the amount in the array, it's simply a content of the array. That number id is actually referring to the player's id.

    The first person to sign into your server after it is reset and comes back on receives the "playerId" of 1. The second 2, the third 3, and so on.

    What that tells you is that the contents of the array are player1 and player2 are on the blue team, and different player is on the red team.

    That's actually good and is what you want.


    Try changing this:
    Code:
    c.getPA().createPlayerHints(10, blueclan.size());
    to this:
    Code:
    c.getPA().createPlayerHints(10, blueclan.length());
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. player rights 3 showing player rights 2 crown
    By OodlesOfNoodles in forum Help
    Replies: 0
    Last Post: 12-27-2011, 08:28 PM
  2. Any hints for me?
    By joejoeraws in forum The Red Carpet
    Replies: 1
    Last Post: 09-15-2011, 07:01 PM
  3. Replies: 3
    Last Post: 11-06-2010, 01:52 AM
  4. Replies: 8
    Last Post: 11-02-2009, 12:11 AM
  5. Replies: 4
    Last Post: 05-18-2009, 08:20 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
  •