General: Allow auto infection on 'late' spawners.
Catch people that automatically spawn after motherzombie infection, and make them spawn as zombies. On CSS for example you automatically spawn if you spawn between round start and 20 seconds after, thus avoiding the need of zspawn.
This commit is contained in:
@ -275,14 +275,35 @@ InfectOnClientTeam(client, team)
|
||||
*/
|
||||
InfectOnClientSpawn(client)
|
||||
{
|
||||
// Disable zombie flag on client.
|
||||
g_bZombie[client] = false;
|
||||
|
||||
// Check if client is spawning on the terrorist team.
|
||||
if (ZRIsClientOnTeam(client, CS_TEAM_T) && InfectHasZombieSpawned())
|
||||
// If the zombie has spawned.
|
||||
if (InfectHasZombieSpawned())
|
||||
{
|
||||
CS_SwitchTeam(client, CS_TEAM_CT);
|
||||
CS_RespawnPlayer(client);
|
||||
// Check if late spawn protection is enabled.
|
||||
new bool:latespawn = GetConVarBool(g_hCvarsList[CVAR_INFECT_LATE_SPAWN]);
|
||||
if (latespawn)
|
||||
{
|
||||
// Enable zombie flag on client.
|
||||
g_bZombie[client] = true;
|
||||
|
||||
// Swap the client to terrorists.
|
||||
if (ZRIsClientOnTeam(client, CS_TEAM_CT))
|
||||
{
|
||||
CS_SwitchTeam(client, CS_TEAM_T);
|
||||
CS_RespawnPlayer(client);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable zombie flag on client.
|
||||
g_bZombie[client] = false;
|
||||
|
||||
// Swap the client to counter-terrorists.
|
||||
if (ZRIsClientOnTeam(client, CS_TEAM_T))
|
||||
{
|
||||
CS_SwitchTeam(client, CS_TEAM_CT);
|
||||
CS_RespawnPlayer(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InfectUnglitchKevlar(client);
|
||||
|
Reference in New Issue
Block a user