Add InfectHasZombieSpawned.
This commit is contained in:
parent
583984489b
commit
7ce73b4493
|
@ -413,7 +413,7 @@ public Action:DamageSuicideIntercept(client, argc)
|
|||
// match, block it.
|
||||
|
||||
// Check general criterias.
|
||||
if ((suicideAfterInfect && !g_bZombieSpawned) || // Check if it should block suicides before mother zombie.
|
||||
if ((suicideAfterInfect && !InfectHasZombieSpawned()) || // Check if it should block suicides before mother zombie.
|
||||
!ZRIsClientValid(client) || // Validate client (to stop console).
|
||||
!IsPlayerAlive(client)) // Check if dead.
|
||||
{
|
||||
|
|
|
@ -1048,7 +1048,7 @@ bool:ImmunityCanDeployShield(client, bool:printResponse = true)
|
|||
}
|
||||
|
||||
// Humans cannot deploy shield before first zombie.
|
||||
if (!g_bZombieSpawned)
|
||||
if (!InfectHasZombieSpawned())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ InfectOnClientDisconnect(client)
|
|||
}
|
||||
|
||||
// If zombie hasn't spawned, then stop.
|
||||
if (!g_bZombieSpawned)
|
||||
if (!InfectHasZombieSpawned())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -270,13 +270,10 @@ InfectOnClientSpawn(client)
|
|||
bZombie[client] = false;
|
||||
|
||||
// Check if client is spawning on the terrorist team.
|
||||
if (ZRIsClientOnTeam(client, CS_TEAM_T))
|
||||
if (ZRIsClientOnTeam(client, CS_TEAM_T) && InfectHasZombieSpawned())
|
||||
{
|
||||
if (g_bZombieSpawned)
|
||||
{
|
||||
CS_SwitchTeam(client, CS_TEAM_CT);
|
||||
CS_RespawnPlayer(client);
|
||||
}
|
||||
CS_SwitchTeam(client, CS_TEAM_CT);
|
||||
CS_RespawnPlayer(client);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,7 +382,7 @@ InfectOnRoundFreezeEnd()
|
|||
ZREndTimer(tInfectCountdown);
|
||||
|
||||
// If the zombie has spawned already (had to be through admin) then stop.
|
||||
if (g_bZombieSpawned)
|
||||
if (InfectHasZombieSpawned())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1074,6 +1071,11 @@ public InfectMenuClientsHandle(Handle:menu_infect_clients, MenuAction:action, cl
|
|||
}
|
||||
}
|
||||
|
||||
bool:InfectHasZombieSpawned()
|
||||
{
|
||||
return g_bZombieSpawned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if a client is infected.
|
||||
*
|
||||
|
@ -1121,7 +1123,7 @@ bool:InfectIsClientHuman(client)
|
|||
*/
|
||||
stock InfectManualInfect(client, targets[], count, bool:respawnoverride = false, bool:respawn = false)
|
||||
{
|
||||
new bool:zombiespawned = g_bZombieSpawned;
|
||||
new bool:zombiespawned = InfectHasZombieSpawned();
|
||||
|
||||
// If zombie hasn't spawned, then make targetted player(s) mother zombies.
|
||||
if (!zombiespawned)
|
||||
|
|
|
@ -184,7 +184,7 @@ bool:RespawnSpawnClient(client, bool:zombie = false, bool:zombieIfSuicide = fals
|
|||
CS_RespawnPlayer(client);
|
||||
|
||||
// Check if first zombie has spawned.
|
||||
if (g_bZombieSpawned)
|
||||
if (InfectHasZombieSpawned())
|
||||
{
|
||||
// Infect if player should spawn as zombie.
|
||||
if (zombie)
|
||||
|
|
|
@ -260,7 +260,7 @@ public Action:RoundEndTimer(Handle:timer)
|
|||
bool:RoundEndGetRoundStatus(&RoundEndOutcome:outcome)
|
||||
{
|
||||
// If zombie hasn't spawned, then stop.
|
||||
if (!g_bZombieSpawned)
|
||||
if (!InfectHasZombieSpawned())
|
||||
{
|
||||
// Round isn't over.
|
||||
return false;
|
||||
|
|
|
@ -113,7 +113,7 @@ SpawnProtectStart(client)
|
|||
}
|
||||
|
||||
// If zombie hasn't spawned, then stop.
|
||||
if (!g_bZombieSpawned)
|
||||
if (!InfectHasZombieSpawned())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ stock bool:ZRIsConsole(index)
|
|||
stock bool:ZRCountValidClients(&zombiecount = 0, &humancount = 0, bool:alive = true, bool:ignorezombiespawned = false)
|
||||
{
|
||||
// If zombie hasn't spawned and were not only counting humans, then stop.
|
||||
if (!g_bZombieSpawned && !ignorezombiespawned)
|
||||
if (!InfectHasZombieSpawned() && !ignorezombiespawned)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ bool:ZTeleClient(client, bool:force = false)
|
|||
|
||||
// If zombie has spawned, get before value, get the after value otherwise.
|
||||
// If the cvar is disabled and the client is a human, then stop.
|
||||
new bool:ztelehuman = g_bZombieSpawned ? GetConVarBool(g_hCvarsList[CVAR_ZTELE_HUMAN_AFTER]) : GetConVarBool(g_hCvarsList[CVAR_ZTELE_HUMAN_BEFORE]);
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user