Fixed respawn. Was respawning on infect.
This commit is contained in:
parent
5b9f8d364d
commit
23b5b6e187
@ -268,13 +268,13 @@ public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
|
|||||||
{
|
{
|
||||||
new index = GetClientOfUserId(GetEventInt(event, "userid"));
|
new index = GetClientOfUserId(GetEventInt(event, "userid"));
|
||||||
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
|
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
|
||||||
decl String:weapon[32];
|
|
||||||
|
|
||||||
// Reset field of view and extinguish fire.
|
// Reset field of view and extinguish fire.
|
||||||
SetPlayerFOV(index, DEFAULT_FOV);
|
SetPlayerFOV(index, DEFAULT_FOV);
|
||||||
ExtinguishEntity(index);
|
ExtinguishEntity(index);
|
||||||
|
|
||||||
// Get the weapon name.
|
// Get the weapon name.
|
||||||
|
decl String:weapon[32];
|
||||||
GetEventString(event, "weapon", weapon, sizeof(weapon));
|
GetEventString(event, "weapon", weapon, sizeof(weapon));
|
||||||
|
|
||||||
// Check if the player was infected.
|
// Check if the player was infected.
|
||||||
@ -337,7 +337,7 @@ public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
|
|||||||
// Forward event to modules.
|
// Forward event to modules.
|
||||||
ClassOnClientDeath(index);
|
ClassOnClientDeath(index);
|
||||||
SpawnProtectOnClientDeath(index);
|
SpawnProtectOnClientDeath(index);
|
||||||
RespawnOnClientDeath(index);
|
RespawnOnClientDeath(index, weapon);
|
||||||
ZHPOnClientDeath(index);
|
ZHPOnClientDeath(index);
|
||||||
|
|
||||||
new ZTeam:team = IsRoundOver();
|
new ZTeam:team = IsRoundOver();
|
||||||
|
@ -48,7 +48,7 @@ RespawnOnClientSpawn(client)
|
|||||||
*
|
*
|
||||||
* @param client The client index.
|
* @param client The client index.
|
||||||
*/
|
*/
|
||||||
RespawnOnClientDeath(client)
|
RespawnOnClientDeath(client, const String:weapon[])
|
||||||
{
|
{
|
||||||
// If timer is running, kill it.
|
// If timer is running, kill it.
|
||||||
if (tRespawn[client] != INVALID_HANDLE)
|
if (tRespawn[client] != INVALID_HANDLE)
|
||||||
@ -56,6 +56,12 @@ RespawnOnClientDeath(client)
|
|||||||
KillTimer(tRespawn[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.
|
// If respawn is disabled, stop here.
|
||||||
new bool:respawn = GetConVarBool(gCvars[CVAR_RESPAWN]);
|
new bool:respawn = GetConVarBool(gCvars[CVAR_RESPAWN]);
|
||||||
if (!respawn)
|
if (!respawn)
|
||||||
@ -125,7 +131,7 @@ public Action:RespawnTimer(Handle:timer, any:client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If player isn't alive, then stop.
|
// If player isn't alive, then stop.
|
||||||
if (!IsPlayerAlive(client))
|
if (IsPlayerAlive(client))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user