This GBXChallInfo class requires a recent TMF dedicated server (build 2009-05-04 or newer), and the GbxRemote module. You need to configure the class with the server port and SuperAdmin password, as usual for any script talking to the dedicated.
The process contained in the class takes a challenge file somewhere under the server's .../GameData/Tracks/ directory, adds it to the track list, loads it as the next challenge, calls GetCurrentChallengeInfo on it, and removes it from the track list again. Obviously you don't want to do this on a public server where players are racing, so it's best to set up a private test server for this.
The return data includes all of the GetCurrentChallengeInfo fields, the desired one being $nbcps, the number of checkpoints in TimeAttack mode. And there is an extra $nbrcps field, the number of checkpoints in Rounds (and Team, Cup & Laps) mode. For multilap tracks with more than one lap, it's the number of laps times the number of checkpoints, and otherwise it's the same as the TA number of checkpoints.
Download the GBXChallInfo class here. Cheers.
