Couldn't find anything useful for implementing racing game position ranking

I looked through a couple of answers but found most too complicated.
I have this actually done and is working perfectly and here is some pseudo code:
Spline distance for measuring between 0 and 1 for tracking player on the current lap.
You add 1 in the case that a player is crossing the finish line. You need a direction check atfinish line and checkpoints on the road to have a solid version of this. Then you create an array of all players where you store the distances + laps so you have a float array which says 0.78,1.23,1.67 and so on . Then you do a copy of this and use this in a function what you call every frame. You must not sort this because you in the function you check what Is the highest float so max of array this is your
player place number one . Do it in a loop an delete the value out of the array so that is empty at the End . You can either save this on an array which would be sorted then or what I do I progress this further to my playerstate where I save the player place. Then you just need to bind this player place to a widget and your done

Best regards . hopefully it work for you