From 0ef831d0c3b6f6ceda87083cb516f63fd8458fd1 Mon Sep 17 00:00:00 2001 From: Beu Date: Thu, 13 Jul 2023 09:59:44 +0200 Subject: [PATCH] Add missing function --- LastManStanding.Script.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/LastManStanding.Script.txt b/LastManStanding.Script.txt index f9f0471..a060271 100644 --- a/LastManStanding.Script.txt +++ b/LastManStanding.Script.txt @@ -581,6 +581,32 @@ Void ResetNetworkVariables() { Net_CurrentRoundNb = 0; } + +/** Check if a Player is already considered eliminated + * + * @param _User The User + * @param _Score The Score, can be Null but it will search the Score in Scores + * + * @return Return True if the player have a time + */ +Boolean IsEliminated(CUser _User, CSmScore _Score) { + if (UIModules_ScoresTable::GetCustomTimes().existskey(_User.WebServicesUserId)) return True; + if (_Score == Null) { + foreach (Score in Scores) { + if (Score.User == Null) continue; + if (Score.User == _User) { + if (Score.PrevRaceTimes.count > 0) return True; + else return False; + break; + } + } + } else if (_Score.PrevRaceTimes.count > 0) { + return True; + } + + return False; +} + /** Get the Time Before the first Malus or NightMare Mode * * @param _StartTime The starting time of the map