From 583984489b59734f97b1e14bd4ef491a4914d87f Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Sun, 22 Mar 2015 17:55:16 +0100 Subject: [PATCH] Extract function ZTeleMustBeHuman. --- src/zr/ztele.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/zr/ztele.inc b/src/zr/ztele.inc index 32bfef8..62cbda4 100644 --- a/src/zr/ztele.inc +++ b/src/zr/ztele.inc @@ -131,9 +131,7 @@ bool:ZTeleClient(client, bool:force = false) new bool:infected = InfectIsClientInfected(client); - // If zombie cvar is disabled and the client is a zombie, then stop. - new bool:ztelezombie = GetConVarBool(g_hCvarsList[CVAR_ZTELE_ZOMBIE]); - if (!force && infected && !ztelezombie) + if (!force && ZTeleMustBeHuman(client)) { // Tell client they must be human to use this feature. TranslationPrintToChat(client, "Must be human"); @@ -452,3 +450,11 @@ ZTeleStopTimer(client) } tZTele[client] = INVALID_HANDLE; } + +ZTeleMustBeHuman(client) +{ + new bool:infected = InfectIsClientInfected(client); + new bool:ztelezombie = GetConVarBool(g_hCvarsList[CVAR_ZTELE_ZOMBIE]); + + return (infected && !ztelezombie); +}