UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Check if the player is either dead or downed?

broken avatar :(
Created 10 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
2,401 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
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;
}
}

dead_check()
{
while(1)
{
self.dead = false;
self waittill("death");
self.dead = true;
wait .1;
}
}

downed_check()
{
while(1)
{
self.downed = false;
self waittill("player_downed");
self.downed = true;
wait .1;
}
}
Thanks in advance.

What I know is that the laststand downed function only works in coop.
Last Edit: July 29, 2014, 11:55:03 pm by Ege115
Marked as best answer by Ege115 10 years ago
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
for downed i would go with:
Code Snippet
Plaintext
player maps\_laststand::player_is_in_laststand()
for dead:
Code Snippet
Plaintext
!isalive(player)
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
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.
Code Snippet
Plaintext
CheckDowned()
{
while( 1 )
{
if( self.sessionstate == "spectator" || IsDefined( self.revivetrigger ) )
{
// Code
}
wait .01;
}
}
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
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.
Code Snippet
Plaintext
CheckDowned()
{
while( 1 )
{
if( self.sessionstate == "spectator" || IsDefined( self.revivetrigger ) )
{
// Code
}
wait .01;
}
}
Hey sorry for taking so long, I tried this and the seesionstate didn't work if you would play solo, it would return as true.

But I tried to use the waittill anyway and it seems like it works. Thanks for the help. :)
Code Snippet
Plaintext
total_down_check()
{
while(1)
{
self.down = false;
self waittill_any( "fake_death", "death", "player_downed" );
self.down = true;

if( self.down == true )
{
// code
}
wait .1;
}
}
And I tried the IsAlive function but it didn't work for the player apparently.
Last Edit: August 04, 2014, 09:03:41 am by Ege115
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Code Snippet
Plaintext
if( isAlive(entity) || self.playerzombie_soundboard_disable )
<- that var is located in playerzombie_downed_state() _zombiemode and it checks if it's true automatically by the way.
Last Edit: August 04, 2014, 05:01:16 pm by DidUknowiPwn
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 9 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
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.

laststand:
Code Snippet
Plaintext
if(!player maps\_laststand::player_is_in_laststand()

dead:
Code Snippet
Plaintext
if(!isAlive(player))


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.
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
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.

laststand:
Code Snippet
Plaintext
if(!player maps\_laststand::player_is_in_laststand()

dead:
Code Snippet
Plaintext
if(!isAlive(player))


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.
:troll:

 
Loading ...