arkshine had it formatted correctly.
Are you setting the headshot_active array element to 1\true for the player that you want to be immune to headshots?
Edit: Fixed typo in return line
return headshot_active
[ Victim
] && get_pdata_int
( Victim, m_LastHitGroup
) == HIT_HEAD ?
[->] : [<-] HAM_SUPERCEDE : HAM_IGNORED;
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new headshot_active[ 33 ];
const m_LastHitGroup = 75;
public plugin_init ()
{
RegisterHam( Ham_TakeDamage, "player", "Event_PlayerTakeDamage" );
register_concmd( "amx_blockhs" , "cmdBlockHS" );
}
public cmdBlockHS( id )
{
headshot_active[ id ] = 1;
}
public Event_PlayerTakeDamage ( const Victim )
{
return ( headshot_active[ Victim ] && ( get_pdata_int( Victim, m_LastHitGroup ) == HIT_HEAD ) ) ? HAM_SUPERCEDE : HAM_IGNORED;
}
__________________