Player Count in Certain Coords
Is there a way I can get a player count in certain coords as in if there was 3 players in XXXX and YYYY and a total of 10 players on server it would look like this
Code:
Players: 10
Players In Box: 3
Thanks
----
EDIT:
This is what i have came up with so far
Code:
public static int getPlayerCount2() {
int count2 = 0;
for (Player p : players) {
if ((p == null) || !p.isActive)
continue;
client temp = (client) p;
if (temp.absX >= 3357 && temp.absX <= 3361 && temp.absY >= 3890 && temp.absY <= 3895)
for (int i = 0; i < players.length; i++) {
if ((players[i] != null) && !players[i].disconnected && temp.absX >= 3357 && temp.absX <= 3361 && temp.absY >= 3890 && temp.absY <= 3895) {
count2++;
}
}
}
return count2;
}
i have added all the other int's to make it work and no errors but when i log on if there are 2 people in the box it doubles the current players in the whole server if there was 3 it would triple..