Added actual functionality for the zr_infect_mzombie_respawn cvar.
This commit is contained in:
parent
6d09157719
commit
363be11591
@ -565,6 +565,16 @@ InfectClient(client, attacker = -1, bool:motherinfect = false)
|
||||
// TODO: A solution to stop confusing bots? Respawn and teleport?
|
||||
CS_SwitchTeam(client, CS_TEAM_T);
|
||||
|
||||
// If respawn is enabled, then teleport mother zombie back to spawnpoint.
|
||||
if (motherinfect)
|
||||
{
|
||||
new bool:zombierespawn = GetConVarBool(g_hCvarsList[CVAR_INFECT_MZOMBIE_RESPAWN]);
|
||||
if(zombierespawn)
|
||||
{
|
||||
ZTeleTeleportClient(client);
|
||||
}
|
||||
}
|
||||
|
||||
// Format infection message.
|
||||
SetGlobalTransTarget(client);
|
||||
|
||||
|
@ -170,7 +170,7 @@ bool:ZTeleClient(client)
|
||||
// Tell client how much time is left until teleport.
|
||||
TranslationPrintCenterText(client, "ZTele countdown", g_iZTeleTimeLeft[client]);
|
||||
|
||||
// Start repeating timer.
|
||||
// Start timer.
|
||||
tZTele[client] = CreateTimer(1.0, ZTeleTimer, client, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
|
||||
}
|
||||
else
|
||||
@ -178,8 +178,8 @@ bool:ZTeleClient(client)
|
||||
// Reset timer handle.
|
||||
tZTele[client] = INVALID_HANDLE;
|
||||
|
||||
// Teleport client.
|
||||
TeleportEntity(client, g_vecZTeleSpawn[client], NULL_VECTOR, NULL_VECTOR);
|
||||
// Teleport client to spawn.
|
||||
ZTeleTeleportClient(client);
|
||||
|
||||
// Tell client they've been teleported.
|
||||
TranslationPrintCenterText(client, "ZTele countdown end", g_iZTeleCount[client], ztelemax);
|
||||
@ -191,6 +191,17 @@ bool:ZTeleClient(client)
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Teleport client to their spawn location.
|
||||
*
|
||||
* @param client The client index.
|
||||
*/
|
||||
ZTeleTeleportClient(client)
|
||||
{
|
||||
// Teleport client.
|
||||
TeleportEntity(client, g_vecZTeleSpawn[client], NULL_VECTOR, NULL_VECTOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Timer callback, counts down teleport to the client.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user