I'm pretty sure there's a better way out there, but here's mine.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#define DMG_FALL (1<<5) // Fell too far (taken from hldsk_const)
#define PLUGIN "Falling Death.."
#define AUTHOR "Unknown"
#define VERSION "1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_TakeDamage, "player", "fw_Player_TakeDamage")
}
// Player took damage
public fw_Player_TakeDamage(victim, inflictor, attacker, Float:damage, dmgtype)
{
if(!(dmgtype & DMG_FALL))
return HAM_IGNORED;
new Float:health = Float:get_user_health(victim)
if(health - damage <= 0)
dmg_fall_killed_player(victim, damage)
return HAM_HANDLED;
}
// Player got killed by DMG_FALL type.
public dmg_fall_killed_player(victim, Float:damage)
{
// Do what you want here..
}
__________________