Hi there !
I have a problem with my code. I wanted to make an ability that 50% of your damage absorbs to your health. (100 damage = 50 additional health)
PHP Code:
public fwTakeDamage(victim, inflictor, attacker, Float:damage)
{
if(siekiera[attacker] == 1)
{
set_user_health(attacker, (get_user_health(attacker) + damage/2))
if(get_user_health(attacker) > 100)
set_user_health(attacker,100)
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(attacker, "Wartosc leczenia: %i", damage/2)
return HAM_HANDLED
}
The problem is, that message "Wartosc leczenia:" shows me the number like 12471329 when I shoot someone, and I heal with that value. But when I make an ability (for example: You have 30% that you will attack with double damage), It works fine!