I edited my previous post a bit, read through it again.
You should check if the
victim is actually a player, by calling
PHP Code:
if(is_user_alive(victim))
{
// It's an alive player, deal damage to it
}
Even if victim was a breakable object ("func_breakable"), it shouldn't matter. TakeDamage can be executed on breakables.