package Players import public LinkedList import ClosureEvents import ClosureTimers /** A list of all players that are still in the game */ public constant ALL_PLAYERS = new LinkedList() interface OnPlayerLeave function onLeave(player leaver) OnPlayerLeave onLeaveListener /** Set listener for when a player leaves the game */ public function onPlayerLeave(OnPlayerLeave onLeave) onLeaveListener = onLeave init nullTimer() -> for i = 0 to bj_MAX_PLAYER_SLOTS - 1 if players[i].isIngame() ALL_PLAYERS.add(players[i]) EventListener.add(EVENT_PLAYER_LEAVE) -> ALL_PLAYERS.remove(GetTriggerPlayer()) onLeaveListener.onLeave(GetTriggerPlayer()) onPlayerLeave() p -> printTimed(p.getNameColored() + " has left the game", 15.)