TeamManager: Remove cvar, use API call.

This commit is contained in:
zaCade 2019-01-23 18:53:42 +01:00
parent 69589affea
commit 159f9f846c
2 changed files with 16 additions and 4 deletions

View File

@ -59,13 +59,10 @@ public void OnMapStart()
public Action OnWarmupTimer(Handle timer) public Action OnWarmupTimer(Handle timer)
{ {
ServerCommand("zr_infect_mzombie_countdown 0.0");
if(g_iMaxWarmup >= g_CVar_sm_warmupmaxtime.IntValue) if(g_iMaxWarmup >= g_CVar_sm_warmupmaxtime.IntValue)
{ {
g_iMaxWarmup = 0; g_iMaxWarmup = 0;
g_bWarmup = false; g_bWarmup = false;
ServerCommand("zr_infect_mzombie_countdown 1.0");
CS_TerminateRound(3.0, CSRoundEnd_GameStart, false); CS_TerminateRound(3.0, CSRoundEnd_GameStart, false);
return Plugin_Stop; return Plugin_Stop;
} }
@ -74,7 +71,6 @@ public Action OnWarmupTimer(Handle timer)
{ {
g_iWarmup = 0; g_iWarmup = 0;
g_bWarmup = false; g_bWarmup = false;
ServerCommand("zr_infect_mzombie_countdown 1.0");
CS_TerminateRound(3.0, CSRoundEnd_GameStart, false); CS_TerminateRound(3.0, CSRoundEnd_GameStart, false);
return Plugin_Stop; return Plugin_Stop;
} }
@ -223,3 +219,11 @@ public Action ZR_OnClientInfect(int &client, int &attacker, bool &motherInfect,
return Plugin_Continue; return Plugin_Continue;
} }
public Action ZR_OnInfectCountdown()
{
if(g_bWarmup)
return Plugin_Handled;
return Plugin_Continue;
}

View File

@ -74,6 +74,14 @@ native int ZR_InfectClient(int client, int attacker = -1, bool motherInfect = fa
*/ */
native int ZR_HumanClient(int client, bool respawn = false, bool protect = false); native int ZR_HumanClient(int client, bool respawn = false, bool protect = false);
/**
* Called on infection timer to determine if timer should show.
*
* @return Plugin_Continue to allow timer. Anything else
* (Like Plugin_Handled) to block timer.
*/
forward Action ZR_OnInfectCountdown();
/** /**
* Called when a player is about to become a zombie. * Called when a player is about to become a zombie.
* Here you can modify any variable or block the infection entirely. * Here you can modify any variable or block the infection entirely.