Fixed respawn. Was respawning on infect.

This commit is contained in:
Greyscale 2009-04-16 06:06:44 +02:00
parent 5b9f8d364d
commit 23b5b6e187
2 changed files with 151 additions and 145 deletions

View File

@ -268,13 +268,13 @@ public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new index = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
decl String:weapon[32];
// Reset field of view and extinguish fire.
SetPlayerFOV(index, DEFAULT_FOV);
ExtinguishEntity(index);
// Get the weapon name.
decl String:weapon[32];
GetEventString(event, "weapon", weapon, sizeof(weapon));
// Check if the player was infected.
@ -337,7 +337,7 @@ public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
// Forward event to modules.
ClassOnClientDeath(index);
SpawnProtectOnClientDeath(index);
RespawnOnClientDeath(index);
RespawnOnClientDeath(index, weapon);
ZHPOnClientDeath(index);
new ZTeam:team = IsRoundOver();

View File

@ -48,7 +48,7 @@ RespawnOnClientSpawn(client)
*
* @param client The client index.
*/
RespawnOnClientDeath(client)
RespawnOnClientDeath(client, const String:weapon[])
{
// If timer is running, kill it.
if (tRespawn[client] != INVALID_HANDLE)
@ -56,6 +56,12 @@ RespawnOnClientDeath(client)
KillTimer(tRespawn[client]);
}
// If player was infected, then stop.
if (StrEqual(weapon, "zombie_claws_of_death", false))
{
return;
}
// If respawn is disabled, stop here.
new bool:respawn = GetConVarBool(gCvars[CVAR_RESPAWN]);
if (!respawn)
@ -125,7 +131,7 @@ public Action:RespawnTimer(Handle:timer, any:client)
}
// If player isn't alive, then stop.
if (!IsPlayerAlive(client))
if (IsPlayerAlive(client))
{
return;
}