#include <amxmodx>
#include <reapi>
const ROUND = 3;
const MAX_USER = 2;
const MIN_PLAYERS = 14;
const Float:ROUND_TIME = 10.0;
const Float:RESPAWN = 1.0;
public plugin_init()
{
register_plugin("Auto revive", "1.1.1", "SNauPeR");
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", .post = true);
}
public CBasePlayer_Killed(const pPlayer, const pevAttacker)
{
if (get_member_game(m_bRoundTerminating))
return;
if (1 + get_member_game(m_iTotalRoundsPlayed) < ROUND)
return;
if (get_gametime() - Float:get_member_game(m_fRoundStartTime) > ROUND_TIME)
return;
if (get_member_game(m_iNumSpawnableTerrorist) + get_member_game(m_iNumSpawnableCT) < MIN_PLAYERS)
return;
if (any:(1 <= pevAttacker <= MaxClients) & ((-1) / 2) == 0 || pPlayer == pevAttacker)
return;
if (get_member(pPlayer, m_iNumSpawns) > MAX_USER)
return;
set_member(pPlayer, m_flRespawnPending, get_gametime() + RESPAWN);
}