• 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.

Is player leave event triggered on the leaving player?

Status
Not open for further replies.
Level 16
Joined
Aug 20, 2009
Messages
1,554
Is player leave event triggered on the leaving player?

I wanted to save a leaver record count locally on the leaving player's PC.
Its not perfect, but I don't want to run a server for hobby maps.

At least this will discourage your average players from leaving the game and ruining matches.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,867
I'm not sure and would like to know as well. Test it for us ;)

But the solution to this problem is simple:

Give each Player a "Leave" or "Loss" at the very start of the game and immediately Save this information:
  • Player Group - Pick every player in (All players) and do
    • Loop - Actions
      • Set Variable GamesLeft[player number] = GamesLeft[player number] + 1
  • Custom script: call SaveTheGame()
Then right before the game ends you undo it:
  • Player Group - Pick every player in (All players) and do
    • Loop - Actions
      • Set Variable GamesLeft[player number] = GamesLeft[player number] - 1
  • Custom script: call SaveTheGame()
They can probably still dodge this penalty if they leave within the first second but other than that they will get punished.
 
Last edited:
Level 16
Joined
Aug 20, 2009
Messages
1,554
But the solution to this problem is simple:

Give each Player a "Leave" or "Loss" at the very start of the game and immediately Save this information:
Wow, this reversed solution is genius, thanks Uncle!

For others looking for answer regarding player leave event, I just found out from another thread that it isn't actually triggered on the leaving player.
So best solution is to just listen to what Uncle has to say!
 
Status
Not open for further replies.
Top