SHARE
TWEET


Speedrun.cs




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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.