#include <amxmodx>

#define PLUGIN    "Frags & Deaths & HP Shower"
#define VERSION    "2.0"
#define AUTHOR    "maJic"

#define PERVIY "frags_deaths"
#define VTOROI "frags_deaths_type"

new gMaxPlayers

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_cvar(PERVIY, "1")
	register_cvar(VTOROI, "1")
	
	set_task(0.2, "pokazivalka", 1, "", 0, "b")
	
	gMaxPlayers = get_maxplayers()
}

public pokazivalka()
{
	if(get_cvar_num(PERVIY)) 
	{
		new fragi, smerti
		
		set_hudmessage(15, 15, 15, 0.01, 0.18, 0, 1.0, 1.0)
		
		for( new id = 1; id <= gMaxPlayers; id++ )
		{
			switch(get_cvar_num(VTOROI))
			{
				case 1:
				{
					fragi = get_user_frags(id)
					smerti = get_user_deaths(id)
					
					show_hudmessage(id, "Frags: %i^nDeaths: %i", fragi, smerti)
				}
				default:
				{
					if(!is_user_alive(id))
					{
						fragi = get_user_frags(id)
						smerti = get_user_deaths(id)
						
						show_hudmessage(id, "Frags: %i^nDeaths: %i", fragi, smerti)
					}
				}
			}
		}
	}
}