A simple joins counter is quite easy to get this days, but getting the exact number a certain person joined involves writing this somewhere, but instead of handling stuff by myself in a flat file, I would honestly go with SQLite that will handle all this for me not to mention it's documentation is quite straight forward and full of examples.
Once the game is over, the king and the pawn go back in the same box.