From 159f9f846cf08b494ed1768fe3601e66fd31b6eb Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 23 Jan 2019 18:53:42 +0100 Subject: [PATCH] TeamManager: Remove cvar, use API call. --- TeamManager/scripting/TeamManager.sp | 12 ++++++++---- includes/zr/infect.zr.inc | 8 ++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/TeamManager/scripting/TeamManager.sp b/TeamManager/scripting/TeamManager.sp index 1bee45d..a093d72 100644 --- a/TeamManager/scripting/TeamManager.sp +++ b/TeamManager/scripting/TeamManager.sp @@ -59,13 +59,10 @@ public void OnMapStart() public Action OnWarmupTimer(Handle timer) { - ServerCommand("zr_infect_mzombie_countdown 0.0"); - if(g_iMaxWarmup >= g_CVar_sm_warmupmaxtime.IntValue) { g_iMaxWarmup = 0; g_bWarmup = false; - ServerCommand("zr_infect_mzombie_countdown 1.0"); CS_TerminateRound(3.0, CSRoundEnd_GameStart, false); return Plugin_Stop; } @@ -74,7 +71,6 @@ public Action OnWarmupTimer(Handle timer) { g_iWarmup = 0; g_bWarmup = false; - ServerCommand("zr_infect_mzombie_countdown 1.0"); CS_TerminateRound(3.0, CSRoundEnd_GameStart, false); return Plugin_Stop; } @@ -223,3 +219,11 @@ public Action ZR_OnClientInfect(int &client, int &attacker, bool &motherInfect, return Plugin_Continue; } + +public Action ZR_OnInfectCountdown() +{ + if(g_bWarmup) + return Plugin_Handled; + + return Plugin_Continue; +} diff --git a/includes/zr/infect.zr.inc b/includes/zr/infect.zr.inc index 93550a7..6b16c53 100644 --- a/includes/zr/infect.zr.inc +++ b/includes/zr/infect.zr.inc @@ -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); +/** + * 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. * Here you can modify any variable or block the infection entirely.