/* AMXMOD script.
*
* (c) Copyright 2000-2002, f117bomb
* This file is provided as is (no warranties).
*
*/

#include <amxmod>

/*
*
* Set Cvar 'amx_respawn' 1 or 0 
*
*/
new gmsgResetHUD

public death_msg()
{	
	if (get_cvar_num("amx_respawn") == 1) 
	{
		new vIndex = read_data(2)
		new svIndex[32] 
		num_to_str(vIndex,svIndex,32)
		set_task(2.0,"respawn",0,svIndex,32)
	}
	return PLUGIN_CONTINUE
}

public respawn(svIndex[])
{
	new vIndex = str_to_num(svIndex)
	user_spawn(vIndex)
	message_begin(MSG_ONE,gmsgResetHUD,{0,0,0},vIndex) 
	message_end() 
	
}



public plugin_init()
{
	gmsgResetHUD = get_user_msgid("ResetHUD") 
	register_plugin("amx_respawn","0.2","f117bomb")
	register_event("DeathMsg","death_msg","a")
	register_cvar("amx_respawn","0")
	return PLUGIN_CONTINUE
}

