• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] A Player Problem

Status
Not open for further replies.
Level 5
Joined
Dec 4, 2007
Messages
111
Hello Is there such an event as "A player leaves the game" cause all I see is "A specific player(Player 1, Player 2 and so on) leaves the game". Since I want to make when the player leaves his units to be removed from the game and his resourses to be split between his allies.

P.S I don't need make a seperate trigger for every player do I.
 
Level 4
Joined
May 4, 2008
Messages
113
A trigger will run if ANY of it's events are fired. So all you have to do is go:

Code:
Events
 Player 1 (Red) leaves the game
 Player 2 (Blue) leaves the game
 etc etc, for every player

If you're lazy and dont want to have to make (potentially) 12 different events for every trigger that needs it, then you can do the following at map initialization:

Code:
For Each Integer A from 1 to 12, do:
 Loop - Actions
  Add to <Your trigger> the event Player(Integer A) leaves the game

Hope that helps :D.
 
Status
Not open for further replies.
Top