@TTV-ADHawkinsGHI also don't use the numActiveUsers, as it is pretty useless to do anything with it, except maybe display how many cars are racing. I have my own heuristics like "MaxActiveCarIndex", which get updated for each frame to help smooth operation in other areas of my Tool.
For the Quali (and other events too), check the Lapdata.m_resultStatus field values to detect, which cars are in "for real", i.e. active in the session. For quali you can just see which cars are 'Active' or 'Finished', for racing events you might want to check also the other values depending on your need(s).
Cheers.