Try to debug by printing out "this.activeMembers.get(i)" with c.sendMessage or system.out.println
|
Why does it not recognise my name as being in the Admins String?Code:public String Admins[][] = {{"Jonathan"},{"Developer"}}; public void updateInterface(Client paramClient) { paramClient.getPA().sendFrame126( "Talking in: <col=FFFF64>" + getTitle() + "</col>", 18139); paramClient.getPA().sendFrame126( "Owner: <col=FFFFFF>" + Misc.formatPlayerName(getFounder()) + "</col>", 18140); Collections.sort(this.activeMembers); for (int i = 0; i < 100; i++) if (i < this.activeMembers.size()) { for(int kl = 0; kl < Admins.length; kl++) { if(this.activeMembers.get(i).equalsIgnoreCase(Admins[kl][0])) { paramClient.getPA().sendFrame126( "<clan=8>" + Misc.formatPlayerName(this.activeMembers.get(i)), 18144 + i); } else { paramClient.getPA().sendFrame126( "<clan=" + getRank(this.activeMembers.get(i)) + ">" + Misc.formatPlayerName(this.activeMembers.get(i)), 18144 + i); } } } else paramClient.getPA().sendFrame126("", 18144 + i); }
Try to debug by printing out "this.activeMembers.get(i)" with c.sendMessage or system.out.println
[Java] public String Admins[][] = {{"Jonathan"},{"Developer"}}; public void updat - Pastebin.com
Cleaned up your code, you were missing braces on the for loop iterating through first 100 users. It's also sorting active members by some method... I have no idea of what the code is trying to do for you. Edit: I don't understand why it's only iterating through the first 100 in the ActiveMembers Collection but perhaps your name is not amongst them?
This now Partially works.
It recognises 'Developer' however it does not recognise 'Jonathan'
I switched them around so that it read:
It then registered 'Jonathan' but not 'Developer'.Code:public String Admins[][] = {{"Developer"},{"Jonathan"}};
Why is it only recognising the last entry?
Okay,
{"Developer"},{"Jonathan"} is an array, correct?
Now if we made an array of arrays [][] then it'd be {{"Developer"},{"Jonathan"},{"Developer"},{"Inside Sin"}}
Where there are two members, i.e. two arrays nested inside the array. To select [k1][0] of any item k1 = to select {"Developer"},{"Jonathan"} and then select "Developer".
It's not acting upon the second value at all.
I thought that it would check all values in the array rather than just one?
Edit -
This is my understanding of the code.
This array states Player's names:
If the player's name is in the array..Code:public String Admins[][] = {{"Jonathan"},{"Developer"}};
Then display this:Code:if(this.activeMembers.get(i).equalsIgnoreCase(Admins[kl][0])) {
Else display this...Code:paramClient.getPA().sendFrame126( "<clan=8>" + Misc.formatPlayerName(this.activeMembers.get(i)), 18144 + i);
Code:paramClient.getPA().sendFrame126( "<clan=" + getRank(this.activeMembers.get(i)) + ">" + Misc.formatPlayerName(this.activeMembers.get(i)), 18144 + i);
What does that have to do with the second element in the array? "Developer" makes it's appearance no where in this code. It is probably a part of getRank(member).
You're understanding it right, if your name isn't within the first 100 users of the "activeMembers" collection then it won't check anything.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |