Код
// HamSandwich implementation
public EVENT_TakeDamage( iVictim, iWeapon, iAttacker, Float:f_Damage, damagetype )
{
static szWeaponClassName[32];
pev ( iWeapon, pev_classname, szWeaponClassName, charsmax ( szWeaponClassName ) );
new s_PlayerName[32], s_PlayerName2[32];
get_user_name( iVictim, s_PlayerName, 31 );
get_user_name( iAttacker, s_PlayerName2, 31 );
if(SHARED_ValidPlayer(iAttacker) && is_user_alive( iVictim ))
{
if (ITEM_Has(iVictim, ITEM_GREN_PROT ) > ITEM_NONE)
{
if(equali(szWeaponClassName,"grenade"))
{
ITEM_RemoveCharge(iVictim, ITEM_GREN_PROT );
return HAM_SUPERCEDE;
}
}
}
return HAM_IGNORED;
}