Removed windows newlines in respawn.inc (stupid editor)

This commit is contained in:
Greyscale 2009-04-16 07:35:18 +02:00
parent 23b5b6e187
commit 98c39fb517

View File

@ -1,150 +1,150 @@
/* /*
* ============================================================================ * ============================================================================
* *
* Zombie:Reloaded * Zombie:Reloaded
* *
* File: respawn.inc * File: respawn.inc
* Description: Players come back to life * Description: Players come back to life
* *
* ============================================================================ * ============================================================================
*/ */
/** /**
* Array for storing respawn timer handles per client. * Array for storing respawn timer handles per client.
*/ */
new Handle:tRespawn[MAXPLAYERS + 1]; new Handle:tRespawn[MAXPLAYERS + 1];
/** /**
* Client is joining the server. * Client is joining the server.
*/ */
RespawnClientInit(client) RespawnClientInit(client)
{ {
// Reset timer handle. // Reset timer handle.
tRespawn[client] = INVALID_HANDLE; tRespawn[client] = INVALID_HANDLE;
// Init gKilledByWorld for client. // Init gKilledByWorld for client.
gKilledByWorld[client] = false; gKilledByWorld[client] = false;
} }
/** /**
* Client is spawning into the game. * Client is spawning into the game.
* *
* @param client The client index. * @param client The client index.
*/ */
RespawnOnClientSpawn(client) RespawnOnClientSpawn(client)
{ {
// If timer is running, kill it. // If timer is running, kill it.
if (tRespawn[client] != INVALID_HANDLE) if (tRespawn[client] != INVALID_HANDLE)
{ {
KillTimer(tRespawn[client]); KillTimer(tRespawn[client]);
} }
// Reset timer handle. // Reset timer handle.
tRespawn[client] = INVALID_HANDLE; tRespawn[client] = INVALID_HANDLE;
} }
/** /**
* Client has been killed. * Client has been killed.
* *
* @param client The client index. * @param client The client index.
*/ */
RespawnOnClientDeath(client, const String:weapon[]) 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)
{ {
KillTimer(tRespawn[client]); KillTimer(tRespawn[client]);
} }
// If player was infected, then stop. // If player was infected, then stop.
if (StrEqual(weapon, "zombie_claws_of_death", false)) if (StrEqual(weapon, "zombie_claws_of_death", false))
{ {
return; 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)
{ {
return; return;
} }
// Start respawn timer. // Start respawn timer.
new Float:delay = GetConVarFloat(gCvars[CVAR_RESPAWN_DELAY]); new Float:delay = GetConVarFloat(gCvars[CVAR_RESPAWN_DELAY]);
tRespawn[client] = CreateTimer(delay, RespawnTimer, client, TIMER_FLAG_NO_MAPCHANGE); tRespawn[client] = CreateTimer(delay, RespawnTimer, client, TIMER_FLAG_NO_MAPCHANGE);
} }
/** /**
* Spawns a player into the round. * Spawns a player into the round.
* *
* @param client The client index. * @param client The client index.
*/ */
RespawnSpawnClient(client) RespawnSpawnClient(client)
{ {
// If client isn't in-game, then stop. // If client isn't in-game, then stop.
if (!IsClientInGame(client)) if (!IsClientInGame(client))
{ {
return; return;
} }
// Spawn player. // Spawn player.
CS_RespawnPlayer(client); CS_RespawnPlayer(client);
// Stop here if the first zombie hasn't spawned yet. // Stop here if the first zombie hasn't spawned yet.
if (!zombieSpawned) if (!zombieSpawned)
{ {
return; return;
} }
// Get respawn team. // Get respawn team.
new bool:respawn_zombie = GetConVarBool(gCvars[CVAR_RESPAWN_ZOMBIE]); new bool:respawn_zombie = GetConVarBool(gCvars[CVAR_RESPAWN_ZOMBIE]);
// Get suicide respawn cvar // Get suicide respawn cvar
if (respawn_zombie) if (respawn_zombie)
{ {
InfectPlayer(client); InfectPlayer(client);
return; return;
} }
if (GetConVarBool(gCvars[CVAR_SUICIDE_WORLD_DAMAGE]) && gKilledByWorld[client]) if (GetConVarBool(gCvars[CVAR_SUICIDE_WORLD_DAMAGE]) && gKilledByWorld[client])
{ {
InfectPlayer(client); InfectPlayer(client);
gKilledByWorld[client] = false; gKilledByWorld[client] = false;
} }
} }
/** /**
* Timer callback, respawns a player. * Timer callback, respawns a player.
* *
* @param timer The timer handle. * @param timer The timer handle.
* @param client The client index. * @param client The client index.
*/ */
public Action:RespawnTimer(Handle:timer, any:client) public Action:RespawnTimer(Handle:timer, any:client)
{ {
// Reset timer handle. // Reset timer handle.
tRespawn[client] = INVALID_HANDLE; tRespawn[client] = INVALID_HANDLE;
// If client isn't in-game, then stop. // If client isn't in-game, then stop.
if (!IsClientInGame(client)) if (!IsClientInGame(client))
{ {
return; return;
} }
// If player isn't alive, then stop. // If player isn't alive, then stop.
if (IsPlayerAlive(client)) if (IsPlayerAlive(client))
{ {
return; return;
} }
// Get client team. // Get client team.
new team = GetClientTeam(client); new team = GetClientTeam(client);
// If player isn't on a team, then stop. // If player isn't on a team, then stop.
if (team != CS_TEAM_T && team != CS_TEAM_CT) if (team != CS_TEAM_T && team != CS_TEAM_CT)
{ {
return; return;
} }
// Spawn player. // Spawn player.
RespawnSpawnClient(client); RespawnSpawnClient(client);
} }