Add teleport on infect option.

This commit is contained in:
2019-12-30 14:19:05 +01:00
parent 63adb12960
commit a5e0f31fc1
2 changed files with 12 additions and 0 deletions

View File

@ -819,10 +819,20 @@ InfectHumanToZombie(client, attacker = -1, bool:motherinfect = false, bool:respa
// Check override.
else
{
new bool:teleport = GetConVarBool(g_hCvarsList[CVAR_INFECT_TELEPORT]);
if (respawnoverride && respawn)
{
ZTele_TeleportClient(client);
}
// Teleport to attacker when infected
else if(teleport && ZRIsClientValid(attacker))
{
// Get client's position.
new Float:clientloc[3];
GetClientAbsOrigin(attacker, clientloc);
TeleportEntity(client, clientloc, NULL_VECTOR, NULL_VECTOR);
}
}
// Remove kevlar and helmet