Sure you can, just hook Ham_TakeDamage, check player's teams and return HAM_SUPERCEDE to block the damage.
Something like:
PHP Code:
#include <hamsandwich>
#include <cstrike>
// Plugin init
public plugin_init()
{
// Hook Ham_TakeDamage
Register_Ham(Ham_TakeDamage, "player", "fw_TakeDamage")
}
// Ham Take Damage Forward
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Non-player damage or self damage
if (victim == attacker || !is_user_alive(attacker))
return HAM_IGNORED
// Check if they are from the same team and block damage
if (cs_get_user_team(attacker) == cs_get_user_team(victim))
return HAM_SUPERCEDE
return HAM_IGNORED
}