So I'm trying a bunch of ways for a script to detect if the player is down. One of the ways is this function that runs whenever I shoot a trigger.
Code Snippet
Plaintext
function test() { if (self NeedsRevive(false)) { IPrintLnBold("chunga"); } if (self NeedsRevive(true)) { IPrintLnBold("not chunga"); } }
The problem is that whenever I shoot it, down or not, both messages appear at the same time and I don't know what this means
Use this:
Code Snippet
Plaintext
// Add this at top of script \\ #using scripts\shared\laststand_shared;
// Add this in your function \\ if(self laststand::player_is_in_laststand()) { // If player is down, do something } else { // If player is not down, do something else }
I've added the using script and the if statement, but it isn't working
Code Snippet
Plaintext
function test() { if (self laststand::player_is_in_laststand()) { IPrintLnBold("testing you are down"); } else { IPrintLnBold("testing you are not down"); } }
It prints the message, "testing you are up" when im down or up and it ignores the "else" statement. I don't see the problem. I appreciate all the help you've been giving me btw, you the real mvp
I've added the using script and the if statement, but it isn't working
Code Snippet
Plaintext
function test() { if (self laststand::player_is_in_laststand()) { IPrintLnBold("testing you are down"); } else { IPrintLnBold("testing you are not down"); } }
It prints the message, "testing you are up" when im down or up and it ignores the "else" statement. I don't see the problem. I appreciate all the help you've been giving me btw, you the real mvp
It must be a problem with the rest of your script, can you show me the entire thing like where you are calling the function on a player.
if (player HasPerk(PERK_QUICK_REVIVE)) { IPrintLn("no no no you can not have the perko");
player playsound("Chinese_1"); wait(0.1);
}
else { IPrintLn("your pals go up fast now"); player zm_perks::give_perk( PERK_QUICK_REVIVE, false ); player playsound("Chinese_1"); thread perk_quick_phase(); //thread perk_quick_location(); break; } } } } //Tells which of the three locations the perk is in function perk_quick_phase() {
if (level.shoot_quick_revive >= 3) { level.shoot_quick_revive-= 2; IPrintLn("i am now " + level.shoot_quick_revive ); } else { level.shoot_quick_revive++; IPrintLn("i am now " + level.shoot_quick_revive ); } } function test() { if (self laststand::player_is_in_laststand()) { IPrintLnBold("testing you are down"); } else { IPrintLnBold("testing you are not down"); } }