Talk:SetPedMaxHealth

From Multi Theft Auto: Wiki

setElementHealth(player, 200) would achieve the exact same thing... --Arran Fortuna (talk) 20:31, 5 August 2016 (UTC)

  • It doesn't have to actually. What you say is true if the ped has 1000 max health stat, but this function is designed to set the ped's health to the maximum for every stat value. And even if doing what you commented works with every stat value, the documentation for setElementHealth doesn't explicitly say that it will adjust to the maximum value, so using this function is a good programming practice because you protect your code from changes in a behaviour that doesn't have to be like that. --AlexTMjugador (talk) 12:56, 6 August 2016 (UTC)