SnoW, how killed player can be alive? your code is wrong.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
new gCvarEnabled;
public plugin_init() {
register_plugin( "Auto Respawn", "1.0", "xPaw" );
gCvarEnabled = register_cvar( "amx_respawn", "1" );
RegisterHam( Ham_Killed, "player", "fwdKilledPlayer", 1 );
}
public fwdKilledPlayer( iVictim, iKiller ) {
if( get_pcvar_num( gCvarEnabled ) ) {
set_task( 10.0, "fnRespawn", iVictim );
return HAM_IGNORED;
}
return HAM_IGNORED;
}
public fnRespawn( id ) {
static iTeam = get_user_team( id );
if( !is_user_alive(id) && (iTeam == 1 || iTeam == 2) )
ExecuteHamB( Ham_CS_RoundRespawn, id );
return PLUGIN_CONTINUE;
}
__________________