PHP Code:
#include < amxmodx >
#include < engine >
#include < hamsandwich >
#pragma semicolon 1
#define PLUGIN ""
#define VERSION "0.0.1"
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "ConnorMcLeod" );
RegisterHam(Ham_TakeDamage, "player", "OnCBasePlayer_TakeDamage");
}
// int CBasePlayer :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
public OnCBasePlayer_TakeDamage( id, iInflictor, iAttacker, Float:flDamage, bitsDamageType ) // return int
{
if( bitsDamageType & DMG_FALL )
{
new Float:health = entity_get_float(id, EV_FL_health);
if( flDamage >= health )
{
SetHamParamFloat(4, health > 1.0 ? health - 1.0 : 0.0);
return HAM_HANDLED;
}
}
return HAM_IGNORED;
}
__________________