Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Timer {
- function clientCmdGameStart() {
- Parent::clientCmdGameStart();
- if ($ResetTime) {
- $runningElapsedTime = 0;
- $startSimTime = getSimTime();
- $ResetTime = 0;
- }
- messageScoreStats();
- }
- function clientCmdGameEnd() {
- Parent::clientCmdGameEnd();
- $runningElapsedTime += PlayGui.ElapsedTime;
- if (PM_MissionList.getSelectedId() == PM_MissionList.rowCount() && $MissionType $= "Advanced") {
- dumpScoreStats();
- }
- }
- function GameConnection::onConnectionAccepted(%this) {
- Parent::onConnectionAccepted(%this);
- $ResetTime = 1;
- }
- function disconnect() {
- Parent::disconnect();
- dumpScoreStats();
- }
- function dumpScoreStats() {
- MessageBoxOk("Final Stats: ",
- "Total Elapsed Time: " @ formatTimeHours($runningElapsedTime) NL
- "Total Running Time: " @ formatTimeHours(getSimTime() - $startSimTime));
- }
- function messageScoreStats() {
- addHelpLine(
- "Current Elapsed Time: " @ formatTimeHours($runningElapsedTime) NL
- "Current Running Time: " @ formatTimeHours(getSimTime() - $startSimTime));
- }
- };
- activatePackage(Timer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement