From a3c7553f6035c54d5c15230060c18b7bb987acfe Mon Sep 17 00:00:00 2001 From: Beu Date: Wed, 12 Jul 2023 13:26:50 +0200 Subject: [PATCH] Reset Variables when starting the mode --- LastManStanding.Script.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/LastManStanding.Script.txt b/LastManStanding.Script.txt index a5fa372..44c5afa 100644 --- a/LastManStanding.Script.txt +++ b/LastManStanding.Script.txt @@ -164,6 +164,7 @@ UsePvECollisions = True; StateMgr::ForcePlayersStates([StateMgr::C_State_Waiting]); WarmUp::SetAvailability(True); CarRank::Reset(); +ResetNetworkVariables(); *** ***Match_InitMap*** @@ -552,6 +553,23 @@ if (Round_ForceEndRound || Round_SkipPauseRound) { // Functions // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +Void ResetNetworkVariables() { + declare netwrite Boolean Net_DisplayUI for Teams[0] = False; + Net_DisplayUI = False; + declare netwrite Integer Net_NBPlayers for Teams[0] = 0; + Net_NBPlayers = 0; + declare netwrite Integer Net_PlayersNbAlive for Teams[0] = 0; + Net_PlayersNbAlive = 0; + declare netwrite Integer Net_NextMalus for Teams[0] = -1; + Net_NextMalus = 0; + declare netwrite Integer Net_TimeBeforeMalus for Teams[0] = -1; + Net_TimeBeforeMalus = 0; + declare netwrite Integer Net_RoundsPerMap for Teams[0] = 0; + Net_RoundsPerMap = 0; + declare netwrite Integer Net_CurrentRoundNb for Teams[0] = 0; + Net_CurrentRoundNb = 0; +} + /** Get the Time Before the first Malus or NightMare Mode * * @param _StartTime The starting time of the map