Fix TeamManager for CSGO, for real this time.

This commit is contained in:
zaCade 2017-08-18 22:24:22 +02:00
parent 34fc227de2
commit fe56f2e286

View File

@ -6,8 +6,8 @@
#define MIN_PLAYERS 2 #define MIN_PLAYERS 2
int g_iWarmup = 0;
bool g_bWarmup = false; bool g_bWarmup = false;
int g_Warmup = 0;
ConVar g_CVar_sm_warmuptime; ConVar g_CVar_sm_warmuptime;
ConVar g_CVar_sm_warmupratio; ConVar g_CVar_sm_warmupratio;
@ -39,8 +39,11 @@ public void OnPluginStart()
public void OnMapStart() public void OnMapStart()
{ {
g_iWarmup = 0;
g_bWarmup = false; 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) if(g_CVar_sm_warmuptime.IntValue > 0 || g_CVar_sm_warmupratio.FloatValue > 0.0)
{ {
g_bWarmup = true; g_bWarmup = true;
@ -59,22 +62,22 @@ public Action OnWarmupTimer(Handle timer)
if(ClientsInGame < ClientsNeeded) if(ClientsInGame < ClientsNeeded)
{ {
g_Warmup = 0; g_iWarmup = 0;
PrintCenterTextAll("Warmup: Waiting for %d more players to join.", ClientsNeeded - ClientsInGame); PrintCenterTextAll("Warmup: Waiting for %d more players to join.", ClientsNeeded - ClientsInGame);
return Plugin_Continue; 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_bWarmup = false;
g_Warmup = 0;
CS_TerminateRound(3.0, CSRoundEnd_GameStart, false); CS_TerminateRound(3.0, CSRoundEnd_GameStart, false);
return Plugin_Stop; return Plugin_Stop;
} }
PrintCenterTextAll("Warmup: %d", g_CVar_sm_warmuptime.IntValue - g_Warmup); PrintCenterTextAll("Warmup: %d", g_CVar_sm_warmuptime.IntValue - g_iWarmup);
g_Warmup++; g_iWarmup++;
return Plugin_Continue; return Plugin_Continue;
} }