Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: Ege115 on July 29, 2014, 11:54:10 pm
Title: Check if the player is either dead or downed?
Post by: Ege115 on July 29, 2014, 11:54:10 pm
What is the best way to check if the player is either downed or dead? This is what I did a little quick, but I don't know if it's the best way.
Code Snippet
Plaintext
total_dead_check() { while(1) { if(self maps\_laststand::player_is_in_laststand() || self.dead == true || self.downed == true) { // Stuff when player is either downed or dead } wait .1; } }
What I know is that the laststand downed function only works in coop.
Title: Re: Check if the player is either dead or downed?
Post by: n123q45 on July 29, 2014, 11:58:48 pm
for downed i would go with:
Code Snippet
Plaintext
player maps\_laststand::player_is_in_laststand()
for dead:
Code Snippet
Plaintext
!isalive(player)
Title: Re: Check if the player is either dead or downed?
Post by: PROxFTW on July 30, 2014, 12:05:13 am
This should do the trick. Is there something you are trying to accomplish? If there is something you would like to do for Solo and Co-Op. This would work for Co-Op and if you had Solo Revive.
This should do the trick. Is there something you are trying to accomplish? If there is something you would like to do for Solo and Co-Op. This would work for Co-Op and if you had Solo Revive.
<- that var is located in playerzombie_downed_state() _zombiemode and it checks if it's true automatically by the way.
Title: Re: Check if the player is either dead or downed?
Post by: treminaor on August 04, 2014, 06:36:55 pm
Why isn't anyone referencing actual zombie scripts that check for downed players?... nearly every purchase trigger in zombiemode checks to make sure the player is not in last stand before going forward with the purchase.
Edit: n123q45 already gave this answer, I would mark it as Best Answer so that you will stop getting additional suggestions. This code is the standard check for what you are asking.
Title: Re: Check if the player is either dead or downed?
Post by: n123q45 on August 04, 2014, 07:43:16 pm
Why isn't anyone referencing actual zombie scripts that check for downed players?... nearly every purchase trigger in zombiemode checks to make sure the player is not in last stand before going forward with the purchase.
Edit: n123q45 already gave this answer, I would mark it as Best Answer so that you will stop getting additional suggestions. This code is the standard check for what you are asking.