GetPlayerMaxHealth: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* This is a convenience wrapper around <code>getPlayerStat(playerId, "max_health")</code>. | * This is a convenience wrapper around <code>getPlayerStat(playerId, "max_health")</code>. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Progression Functions]] | [[Category:Progression Functions]] | ||
[[Category:Player Functions]] | [[Category:Player Functions]] | ||
[[Category:Life State Functions]] | [[Category:Life State Functions]] | ||
Latest revision as of 09:53, 15 August 2026
getPlayerMaxHealth
Returns a player's authoritative maximum health value.
Syntax
number|false getPlayerMaxHealth(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns the current numeric value, or false if the player is invalid or the value has not been initialized.
Examples
Read a player's maximum health:
local value = getPlayerMaxHealth(playerId)
if value ~= false then
outputDebugString("max_health: " .. tostring(value))
end
Notes
- Available only in server-side resource scripts.
- This is a convenience wrapper around
getPlayerStat(playerId, "max_health").