HLMOD.HU Forrás Megtekintés
- www.hlmod.hu#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "Hud Health Bar"
#define VERSION "1.0"
#define AUTHOR "SnoW"
#define BAR_SIZE 2
new gBar[ ] = "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||";
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR );
register_event( "Health", "eHealth", "be" );
RegisterHam( Ham_Spawn, "player", "ham_Spawn", 1 );
}
public eHealth( id )
show_bar( id, min( read_data( 1 ), 100 ) );
public ham_Spawn( id )
{
if( is_user_alive( id ) )
{
show_bar( id, 100 );
return HAM_HANDLED;
}
return HAM_IGNORED;
}
show_bar( id, health )
{
set_hudmessage( 255 - health * 2, health * 2, 0, 0.2, 0.9, 0, 6.0, 999.9, 0.0, 0.0, 3 );
show_hudmessage( id, "%s", gBar[ 100 - health / BAR_SIZE ] );
}