Here's a little example
PHP Code:
new g_MaxPlayers;
#define IsPlayer(%1) ( 1 <= %1 <= g_MaxPlayers )
//plugin_init()
RegisterHam( Ham_TakeDamage , "player" , "fw_HamTakeDamage" );
g_MaxPlayers = get_maxplayers();
public fw_HamTakeDamage( iVictim , iInflictor , iAttacker , Float:fDamage , iBitDamage )
{
if ( IsPlayer( iAttacker ) )
{
static szName[ 33 ];
get_user_name( iAttacker , szName , 32 );
client_print( iVictim , print_chat , "You were attacked by %s" , szName );
//You can block the victim from taking damage with: return HAM_SUPERCEDE;
}
}
__________________