Jump to content

Get handle of dead actor


HeresOtis

Recommended Posts

How do I use this to get handle of dead actor?

 

0AE1: $actor = random_actor_near_point 0@ 1@ 2@ in_radius 10.0 find_next 1 pass_deads 1 //IF and SET

 

Link to comment
Share on other sites

 

pass_deads 1

 

What do you think it is? More self-thinking won`t hurt you.

Link to comment
Share on other sites

find_next 1

 

Also... in order to find the next ped in the search, you have to find the first one.

Link to comment
Share on other sites

by the way... how do I "revive" a ped? I've tried giving it health and making it do something, even putting it on another place but nothing happens... it's still dead...

Link to comment
Share on other sites

Reviving a ped is impossible, but you could set the healt of a ped to 1 make him immune to everything and let him perform the dead anim. Edited by Bad.boy!
Link to comment
Share on other sites

Ooh, reviving a ped is a good one (barely get good questions like that on GTAF these days).

 

I posted a good way to keep the player ped alive, even through explosions. Technically, the CJ still dies, but he is instantly brought back to life. It looks pretty epic when you fall from a plane: http://gtag.gtagaming.com/forums/index.php...findpost&p=3129

 

 

However, it doesn't work on normal peds so well. Something I managed to do was find the function that runs when a ped is revived by medics (plays a 'near-death experience' speech by the ped and resumes default task): 0x4B97B0

 

Call it like so (3 params are passed, but not used - also, struct needs to be a pointer to ped pointer):

 

00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@IF   0AE1:   3@ = random_actor_near_point 0@ 1@ 2@ in_radius 100.0 find_next 0 pass_deads 0THEN   REPEAT       IF           IS_CHAR_DEAD 3@       THEN           0A96: 4@ = actor 3@ struct           0AC7: 5@ = var 4@ offset           0AA6: call_method 0x4B97B0 struct 5@ num_params 3 pop 0 0 0 0           0792: disembark_instantly_actor 3@                  END   UNTIL 8AE1:   not 3@ = random_actor_near_point 0@ 1@ 2@ in_radius 100.0 find_next 1 pass_deads 0END

 

 

It's funny, cause when you kill someone you can bring em back to life and kill em again. I said it's funny, not right.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.