Scripting - check if the player is dead or not

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Scripting - check if the player is dead or not

Post by Rezil » January 25th, 2010, 6:16 pm

Just as the title says, how do I check whether the player has died or not? The spawn has a trigger so all the players are tracked via array but i don't know the exact command for when the user dies.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Scripting - check if the player is dead or not

Post by waywaaaard » January 25th, 2010, 6:47 pm

it's simple:

Code: Select all

 isAlive(player) 
or do you want to have a callback if he dies? For that have a look in the gametype scripts in the iwds dm or tdm
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Scripting - check if the player is dead or not

Post by waywaaaard » January 25th, 2010, 6:54 pm

Lev!athan wrote:it's simple:

Code: Select all

 isAlive(player) 
or do you want to have a callback if he dies? For that have a look in the gametype scripts in the iwds dm or tdm

ah here:

Code: Select all

self notify("killed_player");
in the tdm script line: 383 Callback_PlayerKilled
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Scripting - check if the player is dead or not

Post by Rezil » January 25th, 2010, 7:06 pm

Aah thanks, isAlive is what I was looking for. :)
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest