From 365ba86f0913a02b03a6ccfb6c6c8449cde6d529 Mon Sep 17 00:00:00 2001 From: UTIL_TRACELINE Date: Fri, 9 Aug 2024 22:33:15 +0300 Subject: [PATCH] Update documentation on some health related natives. (#1157) * Update documentation on some health related natives. Document on how to modify max health. Apply suggestions from code review Co-authored-by: Dillon Skaggs Change instances of Invoking to Calling. * Cleanup wording --------- Co-authored-by: Dillon Skaggs --- ENTITY/SetEntityHealth.md | 16 ++++++++-------- PED/IsPedInjured.md | 18 +++++++++++++----- PED/SetPedMaxHealth.md | 9 ++------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/ENTITY/SetEntityHealth.md b/ENTITY/SetEntityHealth.md index 0300aed1a..888529222 100644 --- a/ENTITY/SetEntityHealth.md +++ b/ENTITY/SetEntityHealth.md @@ -8,17 +8,17 @@ ns: ENTITY void SET_ENTITY_HEALTH(Entity entity, int health); ``` -health >= 0 +When setting health for a player ped, the game will clamp the health value to ensure it does not exceed the maximum health. This maximum health can be retrieved by calling [`GET_PED_MAX_HEALTH`](#_0x4700A416E8324EF3). It can also be modified by calling [`SET_PED_MAX_HEALTH`](#_0xF5F6378C4F3419D3). -male ped ~= 100 - 200 +When setting the health for non-player peds or entities, the maximum health will be increased if the new health value exceeds the current maximum. -female ped ~= 0 - 100 +Default health for male peds is `200`, for female peds it is `175`. -``` -NativeDB Added Parameter 3: int p2 -``` + +### Added parameters +* **inflictor**: The handle for the entity that caused the damage. ## Parameters -* **entity**: -* **health**: +* **entity**: The entity handle. +* **health**: The health we should set this entity to. diff --git a/PED/IsPedInjured.md b/PED/IsPedInjured.md index 0fbbd39c3..37027134b 100644 --- a/PED/IsPedInjured.md +++ b/PED/IsPedInjured.md @@ -8,12 +8,20 @@ ns: PED BOOL IS_PED_INJURED(Ped ped); ``` -``` -Gets a value indicating whether this ped's health is below its injured threshold. -The default threshold is 100. -``` +Indicates whether this ped's health is below its injured threshold. +The default threshold is 100, these are stored in the `pedhealth.meta` file located in `common:\data\` + +### Below are some of the values + +| InjuredHealthThreshold | Name | +|------------------------|-----------| +| 100.000000 | Strong | +| 100.000000 | Average | +| 100.000000 | Weak | + ## Parameters -* **ped**: +* **ped**: The ped to check for injuries. ## Return value +Returns `true` if the ped is injured, `false` otherwise. \ No newline at end of file diff --git a/PED/SetPedMaxHealth.md b/PED/SetPedMaxHealth.md index 256e3c335..36cb6c16c 100644 --- a/PED/SetPedMaxHealth.md +++ b/PED/SetPedMaxHealth.md @@ -8,12 +8,7 @@ ns: PED void SET_PED_MAX_HEALTH(Ped ped, int value); ``` -``` -sets the maximum health of a ped -I think it's never been used in any script -``` - ## Parameters -* **ped**: -* **value**: +* **ped**: The ped handle we're setting this for. +* **value**: The new max health.