[saco] Implement/match CActorPed::SetHealth(...)

This commit is contained in:
RD42
2024-10-24 22:29:13 +08:00
parent 10ff963170
commit bde196c8f8
2 changed files with 13 additions and 0 deletions

View File

@ -74,3 +74,15 @@ float CActorPed::GetHealth()
//-----------------------------------------------------------
void CActorPed::SetHealth(float fHealth)
{
if(!m_pPed) return;
m_pPed->fHealth = fHealth;
if(m_pPed->fHealth <= 0.0f) {
ScriptCommand(&kill_actor,m_dwGTAId);
}
}
//-----------------------------------------------------------

View File

@ -83,6 +83,7 @@ const SCRIPT_COMMAND set_actor_z_angle = { 0x0173, "if" };
const SCRIPT_COMMAND lock_actor = { 0x04d7, "ii" };
const SCRIPT_COMMAND refresh_streaming_at = { 0x04E4, "ff" };
const SCRIPT_COMMAND kill_actor = { 0x0321, "i" };
const SCRIPT_COMMAND set_actor_animation_set = { 0x0245, "is" };
const SCRIPT_COMMAND request_animation = { 0x04ED, "s" };