ajom
Well-known member
Hello, this is my first post. I have learned so many things on this website and I just got a problem that I cannot find anywhere around the internet. OK, so this opcodes gets the actor/player/Car/Object health in "Integer" Format:
But as on my experience when playing samp, I noticed that sometimes when a "Player" has a health of 0, it is still alive! That is why I suspected the health of that player was around (0.01 - 0.49) but only shows 0 because it is was truncated into an integer value...
So my question is, How can I get the HP or Armor of my target type of entity that is a float number(so that I can get the decimal part of their Health/Armor)?
Also, obviously this will not extract the decimal part of the decimal part of the health/armor:
I have found a thread that does detect floating number health, but is on C++ format:
Getting Player HP(C++)
Please Help I really need this feature so that I can detect if the player_ped is "dead" in SAMP.
Code:
0226: $6459 = actor 164@ health // health of an actor handle
0227: 4@ = car 22@ health // health of a car handle
071E: get_object 102@ health_to 103@ // health of an object handle
0B25: samp 2@ = get_player_health 1@ // health of player id 1@
But as on my experience when playing samp, I noticed that sometimes when a "Player" has a health of 0, it is still alive! That is why I suspected the health of that player was around (0.01 - 0.49) but only shows 0 because it is was truncated into an integer value...
So my question is, How can I get the HP or Armor of my target type of entity that is a float number(so that I can get the decimal part of their Health/Armor)?
Also, obviously this will not extract the decimal part of the decimal part of the health/armor:
Code:
0B25: samp 2@ = get_player_health 1@
0093: 2@ = integer 2@ to_float // this will only add a decimal part on the number... but will not extract the decimal part of the player hp
I have found a thread that does detect floating number health, but is on C++ format:
Getting Player HP(C++)
Please Help I really need this feature so that I can detect if the player_ped is "dead" in SAMP.
Last edited: