You could do something like this:
PHP Code:
this.mostec = NULL;
for (temp.pl: players) {
temp.track = findPlayer(this.mostec);
if (temp.pl.clientr.event_ec > temp.track.clientr.event_ec) this.mostec = temp.pl;
}
findPlayer(this.mostec).setLevel2(levelname, x, y);