Definitely doable. Try this and see if it works:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new const Version[] = "0.1";
#define MAX_PLAYERS 32
new bool:g_bLastAttackWasWall[ MAX_PLAYERS + 1 ][ MAX_PLAYERS + 1 ];
#define IsPlayer(%1) ( 1 <= %1 <= MAX_PLAYERS )
public plugin_init()
{
register_plugin( "Check Wall Kill" , Version , "bugsy" );
RegisterHam( Ham_TraceAttack , "player" , "Player_TraceAttack" );
register_event( "DeathMsg" , "Ev_DeathMsg" , "a" , "1>0" );
}
public Player_TraceAttack( iEnt , iAttacker , Float:flDamage , Float:fDir[ 3 ] , ptr , iDamageType )
{
if( IsPlayer( iAttacker ) )
{
if ( iDamageType & DMG_BULLET )
{
new Float:fEnd[ 3 ];
get_tr2( ptr , TR_vecEndPos , fEnd );
g_bLastAttackWasWall[ iEnt ][ iAttacker ] = bool:!ExecuteHam( Ham_FVecVisible , iAttacker , fEnd );
}
else
{
g_bLastAttackWasWall[ iEnt ][ iAttacker ] = false;
}
}
}
public Ev_DeathMsg()
{
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
new iIsHeadshot = read_data( 3 );
if ( iIsHeadshot && ( g_bLastAttackWasWall[ iVictim ][ iKiller ] == true ) )
{
client_print( 0 , print_chat , "Headshot wall kill" );
}
}
__________________