Heres my damage event which works like life steal
PHP Code:
public event_damage_lifesteal(id)
{
new damage = read_data(2)
new Bodypart, Weapon, attacker = get_user_attacker(id, Weapon, Bodypart)
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE
new current_hp = get_user_health(attacker)
new max_hp = get_pcvar_num(zomb_hp)
new life_steal = floatround(float(current_hp) + (float(damage)))
if(g_zombie[attacker])
{
if(current_hp > max_hp)
{
set_user_health(attacker, max_hp)
} else {
current_hp += life_steal
if(current_hp >= max_hp)
{
current_hp = max_hp
}
set_user_health(id, current_hp)
}
}
return PLUGIN_CONTINUE
}
I'm trying to get rid of this bug where if your hp is below 90 and you stab then. You get like 140 hp instead of the maximum 100. But when I use this. This has no effect in the game.
__________________