From fe56f2e286a4b10b9cd2bb77ee850261ce0a7ed6 Mon Sep 17 00:00:00 2001 From: zaCade Date: Fri, 18 Aug 2017 22:24:22 +0200 Subject: [PATCH] Fix TeamManager for CSGO, for real this time. --- TeamManager/scripting/TeamManager.sp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/TeamManager/scripting/TeamManager.sp b/TeamManager/scripting/TeamManager.sp index a4596766..4d71c2bb 100644 --- a/TeamManager/scripting/TeamManager.sp +++ b/TeamManager/scripting/TeamManager.sp @@ -6,8 +6,8 @@ #define MIN_PLAYERS 2 +int g_iWarmup = 0; bool g_bWarmup = false; -int g_Warmup = 0; ConVar g_CVar_sm_warmuptime; ConVar g_CVar_sm_warmupratio; @@ -39,8 +39,11 @@ public void OnPluginStart() public void OnMapStart() { + g_iWarmup = 0; g_bWarmup = false; - g_Warmup = 0; + g_bRoundEnded = false; + g_bZombieSpawned = false; + if(g_CVar_sm_warmuptime.IntValue > 0 || g_CVar_sm_warmupratio.FloatValue > 0.0) { g_bWarmup = true; @@ -59,22 +62,22 @@ public Action OnWarmupTimer(Handle timer) if(ClientsInGame < ClientsNeeded) { - g_Warmup = 0; + g_iWarmup = 0; PrintCenterTextAll("Warmup: Waiting for %d more players to join.", ClientsNeeded - ClientsInGame); return Plugin_Continue; } } - if(g_Warmup >= g_CVar_sm_warmuptime.IntValue) + if(g_iWarmup >= g_CVar_sm_warmuptime.IntValue) { + g_iWarmup = 0; g_bWarmup = false; - g_Warmup = 0; CS_TerminateRound(3.0, CSRoundEnd_GameStart, false); return Plugin_Stop; } - PrintCenterTextAll("Warmup: %d", g_CVar_sm_warmuptime.IntValue - g_Warmup); - g_Warmup++; + PrintCenterTextAll("Warmup: %d", g_CVar_sm_warmuptime.IntValue - g_iWarmup); + g_iWarmup++; return Plugin_Continue; }