Dont know how you tryed but it worked pefect for me.
PHP Code:
#include <amxmodx>
#include <fakemeta>
public plugin_init() {
register_clcmd( "say /host", "cmdLol" );
}
public cmdLol( id ) {
if( is_hostage_alive( 155 ) ) // hardcoding indexes not save, just did for test, it was hostage for me @ cs_assualt, maxplayers 5.
client_print( 0, print_chat, "Hostage is alive." );
else
client_print( 0, print_chat, "Hostage is dead." );
}
stock bool:is_hostage_alive( iEntity ) {
if( !pev_valid( iEntity ) )
return false;
new szClassname[ 32 ];
pev( iEntity, pev_classname, szClassname, 31 );
if( !equal( szClassname, "hostage_entity" ) )
return false;
if( pev( iEntity, pev_health ) > 0 )
return true;
return false;
}
__________________