How to sort an array?

So I am trying to sort an array that will help me tell what positions players are in in a race. I already have variables set up and a basic version of the position system made where it only works for the specific player controllers that exist but I want an expandable array that stores all the data I have currently as well as the player and sorts them by the variables. the variables I have are what lap the player is on, how many checkpoints the player has passed and how close they are to there next checkpoint. I would like it to look at all these variables and sort it laps first, checkpoints second and distance last.

This works with what I have got at the moment but it is not expandable I have to manually adjust it. its kind of annoying as I would like the ability to add players, add AI and also remove them without having to make a million different game modes.

here is a video of its state as of now if your curious:

ignore when the counter brakes that is just because i put one of the checkpoints too high so my friend missed it. that is fixed now.