Talk:SetPedMaxHealth: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "setElementHealth(player, 200) would achieve the exact same thing... --~~~~")
 
No edit summary
 
Line 1: Line 1:
setElementHealth(player, 200) would achieve the exact same thing... --[[User:Arran Fortuna|Arran Fortuna]] ([[User talk:Arran Fortuna|talk]]) 20:31, 5 August 2016 (UTC)
setElementHealth(player, 200) would achieve the exact same thing... --[[User:Arran Fortuna|Arran Fortuna]] ([[User talk: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. --[[User:AlexTMjugador|AlexTMjugador]] ([[User talk:AlexTMjugador|talk]]) 12:56, 6 August 2016 (UTC)

Latest revision as of 12:56, 6 August 2016

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)