Extract function ZTeleCanHumanTeleport.
This commit is contained in:
parent
7ce73b4493
commit
fcb4fdcab6
@ -138,10 +138,7 @@ bool:ZTeleClient(client, bool:force = false)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If zombie has spawned, get before value, get the after value otherwise.
|
if (!force && !infected && !ZTeleCanHumanTeleport())
|
||||||
// If the cvar is disabled and the client is a human, then stop.
|
|
||||||
new bool:ztelehuman = InfectHasZombieSpawned() ? GetConVarBool(g_hCvarsList[CVAR_ZTELE_HUMAN_AFTER]) : GetConVarBool(g_hCvarsList[CVAR_ZTELE_HUMAN_BEFORE]);
|
|
||||||
if (!force && !infected && !ztelehuman)
|
|
||||||
{
|
{
|
||||||
// Tell client that feature is restricted at this time.
|
// Tell client that feature is restricted at this time.
|
||||||
TranslationPrintToChat(client, "ZTele restricted human");
|
TranslationPrintToChat(client, "ZTele restricted human");
|
||||||
@ -458,3 +455,10 @@ ZTeleMustBeHuman(client)
|
|||||||
|
|
||||||
return (infected && !ztelezombie);
|
return (infected && !ztelezombie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZTeleCanHumanTeleport()
|
||||||
|
{
|
||||||
|
// There are individual restrictions whether a human can teleport before or
|
||||||
|
// after zombies have spawned.
|
||||||
|
return InfectHasZombieSpawned() ? GetConVarBool(g_hCvarsList[CVAR_ZTELE_HUMAN_AFTER]) : GetConVarBool(g_hCvarsList[CVAR_ZTELE_HUMAN_BEFORE]);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user