PHP Code:
RegisterHam(Ham_TakeDamage, "func_breakable", "fw_Object_TakeDamage")
public fw_Object_TakeDamage(ent, weapon, killer, dmg)
{
new health = pev(ent,pev_health);
if (health - dmg <= 0.0)
{
client_print(killer, print_chat, "Ent: %i", ent)
client_print(killer, print_chat, "Ent HP: %.f", health)
return HAM_IGNORED;
}
return HAM_IGNORED;
}
I tried to hook the "func_breakable" entity when it destroyed but the health return always 0.0.
did I missed something? is there other way to hook it?
__________________