468 end |
468 end |
469 |
469 |
470 local roundDraw = false |
470 local roundDraw = false |
471 if #clanScores >= 2 and clanScores[1].score == clanScores[2].score and clanScores[1].score ~= MAX_TURN_TIME then |
471 if #clanScores >= 2 and clanScores[1].score == clanScores[2].score and clanScores[1].score ~= MAX_TURN_TIME then |
472 roundDraw = true |
472 roundDraw = true |
473 SendStat(siGameResult, loc("Round draw")) |
473 SendStat(siGameResult, GetEngineString("TMsgStrId", sidDraw)) |
474 SendStat(siCustomAchievement, loc("The teams are tied for the fastest time.")) |
474 SendStat(siCustomAchievement, loc("The teams are tied for the fastest time.")) |
475 elseif #sortedTeams >= 1 then |
475 elseif #sortedTeams >= 1 then |
476 SendStat(siGameResult, string.format(loc("%s wins!"), sortedTeams[1].name)) |
476 |
|
477 SendStat(siGameResult, formatEngineString(GetEngineString("TMsgStrId", sidWinner), sortedTeams[1].name)) |
477 SendStat(siCustomAchievement, string.format(loc("%s wins with a best time of %.1fs."), sortedTeams[1].name, (sortedTeams[1].score/1000))) |
478 SendStat(siCustomAchievement, string.format(loc("%s wins with a best time of %.1fs."), sortedTeams[1].name, (sortedTeams[1].score/1000))) |
478 for i=1,#unfinishedArray do |
479 for i=1,#unfinishedArray do |
479 SendStat(siCustomAchievement, unfinishedArray[i]) |
480 SendStat(siCustomAchievement, unfinishedArray[i]) |
480 end |
481 end |
481 else |
482 else |
482 roundDraw = true |
483 roundDraw = true |
483 SendStat(siGameResult, loc("Round draw")) |
484 SendStat(siGameResult, GetEngineString("TMsgStrId", sidDraw)) |
484 SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!")) |
485 SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!")) |
485 SendStat(siCustomAchievement, loc("Maybe you should try an easier TechRacer map.")) |
486 SendStat(siCustomAchievement, loc("Maybe you should try an easier TechRacer map.")) |
486 end |
487 end |
487 |
488 |
488 -- Kill all the losers |
489 -- Kill all the losers |