Skip to content

Commit e2e86af

Browse files
Merge pull request #274 from sirenuf/master
add ported SetHealth & AddHealth methods for CPed
2 parents 594ba16 + 0ff3d70 commit e2e86af

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

plugin_IV/game_IV/CPed.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ CVehicle* CPed::GetVehiclePedWouldEnter(CPed* ped, rage::Vector3 const& pos, boo
5353
bool CPed::IsPedDead(CPed* ped) {
5454
return plugin::CallAndReturnDyn<bool>(gpattern("8B 44 24 04 80 B8 ? ? ? ? ? 74 10 8B 88 ? ? ? ? 83 F9 01 74 0E 83 F9 02 74 09 83 B8 ? ? ? ? ? 75 03"), ped);
5555
}
56+
57+
void CPed::SetHealth(float health, int unknown) {
58+
plugin::CallVirtualMethod<61>(this, health, unknown);
59+
}
60+
61+
void CPed::AddHealth(float health) {
62+
plugin::CallVirtualMethod<62>(this, health);
63+
}

plugin_IV/game_IV/CPed.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ class CPed : public CPhysical {
504504
bool CanStartMission();
505505
void SetRelationship(int32_t level, int32_t group);
506506
CControl* GetControlFromPlayer();
507+
void SetHealth(float health, int unknown = 0);
508+
void AddHealth(float health);
507509

508510
public:
509511
static CVehicle* GetVehiclePedWouldEnter(CPed* ped, rage::Vector3 const& pos, bool arg2);

0 commit comments

Comments
 (0)