 #include <amxmodx>

#define PLUGIN "HP vision"
#define VERSION "1.0"
#define AUTHOR "apprentice"

new hudsync;
new maxplayers; 

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);  
	
    	register_event( "ResetHUD", "eResetHUD", "be" );
	
	hudsync = CreateHudSyncObj();
	maxplayers = get_maxplayers();
	
	set_task(0.1, "stats", 0, "", 0, "b", 0);
}
public eResetHUD( id ) 
{
    if( !is_user_bot( id ) ) 
    {       
	message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Crosshair" ), _, id );
	write_byte( 0 );
	message_end(); 
    }
} 
public stats()
{	
	for(new i = 1 ; i <= maxplayers ; i++)
	{
	set_hudmessage(255, 230, 0, -2, 0.91, 0, 6.0, 12.0);
	ShowSyncHudMsg(i, hudsync , "  Health: %d HP", get_user_health(i));
}
}
