I already thought of that but I just had a thought blocking the function would be ok too.
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >
#define HP_LIMIT 150
const hp_value = 30
new bool:g_Enabled[ 33 ];
public plugin_init( ) {
register_plugin( "Extra HP", "1.0", "DoNii" );
register_clcmd( "say /health", "enable_plugin" );
RegisterHam( Ham_Killed, "player", "fw_HamKilledPost", 1 );
}
public enable_plugin(id) {
g_Enabled[ id ] = true
}
public fw_HamKilledPost( victim, attacker, shouldgib ) {
if( g_Enabled[ attacker ] ) {
new Float:health = entity_get_float( attacker, EV_FL_health )
if( health > HP_LIMIT ) {
entity_set_float( attacker, EV_FL_health, float( HP_LIMIT ) )
return HAM_IGNORED;
}
entity_set_float( attacker, EV_FL_health, health + hp_value )
}
return HAM_IGNORED;
}
__________________