• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to detect if a player left defeated?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
When the player leaves, check if the bj_meleeDefeated boolean array is set for them. Note the mapping is with index 0 representing Player(0) which is GUI Player 1 Red.

If you want GUI interoperability the following custom script can be used.
JASS:
set udg_TempBoolean = bj_meleeDefeated[GetPlayerId(udg_TempPlayer)]
Where TempBoolean is a boolean variable and TempPlayer is a player variable.

To use, set TempPlayer to the player you want to test, run the custom script line and then test if TempBoolean is equal to true. If equal to true the player was defeated by the Melee defeat system. If false the player was not defeated with the melee defeat system. To achieve what you are after, run this in response to a player leaves the game event with TempPlayer set to Triggering Player. If TempBoolean is true then the player has been defeated by the melee defeat system and has just left the game.
 
Status
Not open for further replies.
Top