Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checking if Ped is dead

Featured Replies

I'm currently writing a plugin, and as part of my main logic, I want to check to see whether a Ped is dead or not. I'm running the below if statement.

if(ped.IsDead)

However, this seems to return true, even when I've shot this particular Ped in the head a few times. I've also noticed that when running the following function, I'm getting values around 150 to 200 (at which point the Ped seems to stop being a Ped (they become undetectable), and start being an entity?

Game.LogTrivial("Ped health: " + ped.Health.ToString());

I presume that the Rage IsDead function shares/is based on the native PED::IS_PED_DEAD_OR_DYING

 

What I'm asking: How can I reliably check to see whether a Ped is dying?

Please quote or @Wilhelm me in threads if you're wanting my attention/response!

  • 2 weeks later...
On 11/21/2018 at 12:54 PM, WillUnderscore said:

I'm currently writing a plugin, and as part of my main logic, I want to check to see whether a Ped is dead or not. I'm running the below if statement.


if(ped.IsDead)

However, this seems to return true, even when I've shot this particular Ped in the head a few times. I've also noticed that when running the following function, I'm getting values around 150 to 200 (at which point the Ped seems to stop being a Ped (they become undetectable), and start being an entity?


Game.LogTrivial("Ped health: " + ped.Health.ToString());

I presume that the Rage IsDead function shares/is based on the native PED::IS_PED_DEAD_OR_DYING

 

What I'm asking: How can I reliably check to see whether a Ped is dying?

 

of course, if you shot the ped in the head a few times, the Ped.isDead will return true, which mean the ped is totally dead. Nothing wrong with it. 🙂

what do you mean with "dying"? do you mean the ped is still alive but badly injured?

from my experience, when the ped is already lying down in ragdoll state, that would always mean that the ped's isDead=true;

 

FYI. when isDead=true, you cannot ask the ped to play certain animation task. you have to do some workaround to make the dead ped playing animation.

Edited by Pazzi

  • 2 weeks later...
On 11/21/2018 at 10:54 PM, WillUnderscore said:

I'm currently writing a plugin, and as part of my main logic, I want to check to see whether a Ped is dead or not. I'm running the below if statement.


if(ped.IsDead)

However, this seems to return true, even when I've shot this particular Ped in the head a few times. I've also noticed that when running the following function, I'm getting values around 150 to 200 (at which point the Ped seems to stop being a Ped (they become undetectable), and start being an entity?


Game.LogTrivial("Ped health: " + ped.Health.ToString());

I presume that the Rage IsDead function shares/is based on the native PED::IS_PED_DEAD_OR_DYING

 

What I'm asking: How can I reliably check to see whether a Ped is dying?

There are many ways around this.

1. One way of checking if your target is dead would be to invoke IS_PED_RAGDOLL and invoke it again after a certain period of time or keep checking if the ped is ragdolling to confirm that the ped is, infact, dead. This is a pretty bad solution if you're looking to check if the ped is dead on the spot.

 

2. You could check if the target's health is below 200 and then decide if the target is dead or not from there. In my opinion this would be your best choice.

 

3. If the target does infact go from a ped to an entity when below a certain amount of health, you could utilize IS_ENTITY_DEAD.

Edited by doubledecker

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.