The allplayers array is an array that contains all the players logged in.
Here's a snippet that'll do what you want for player kills. You can easily modify it yourself for other variables.
PHP Code:
temp.most = null; //Variable that holds player with highest kill count
for (temp.p: allplayers) {
if (temp.p.kills > temp.most.kills) {
temp.most = temp.p;
}
}
player.chat = format("%s (%d)", temp.most.account, temp.most.kills);