Scoreboard order

Hi, in my game there is a Scoreboard, and I want to order the players in the scoreboard by these rules:

  1. The player with most kills should be placed above
  2. If some player has got the same kills as another player, but has got more deaths, he should be placed below the other player who has got the same frags

I did this to order the players basing on the kills:

http://puu.sh/ihf1C/76d905fe77.png

There are six arrays:
One array contains the players (Player States) unordered
One array contains the players (Player States) ordered
One array contains the frags (float) unordered
One array contains the frags (float) ordered
One array contains the deaths (float) unordered
One array contains the deaths (float) ordered

How can I do the second thing?

you could multiply the kills by 1000, and subtract the number of deaths, then sort by that number.

That is interestingly genius!

Yes. I tried to do Kills - Deaths, but I needed to multiply the kills by 1000, so the kills will have the priority.