void Winner(Team team) { gameEnding = true; foreach (var member in CTFPlayers) { if (member.hasFlag) { CTFFlag flag = member.team == Team.A ? FlagB : FlagA; flag.DropFlag(member.transform.position); member.player.SendNetworkUpdate(); member.hasFlag = false; } if (member.team == team) { EventManager.AddTokens(member.player.userID, configData.EventSettings.TokensOnWin, true); } } if (team == Team.NONE) { EventManager.BroadcastToChat(msg("draw")); } else { EventManager.BroadcastToChat(string.Format(msg("winner"), GetTeamName(team))); } timer.In(2, () => { EventManager.CloseEvent(); EventManager.EndEvent(); }); }
void RemovePlayer(CTFPlayer player) { if (player.hasFlag) { CTFFlag flag = player.team == Team.A ? FlagB : FlagA; flag.DropFlag(player.transform.position); player.player.SendNetworkUpdate(); player.hasFlag = false; SendMessage($"{ctf.configData.Messaging.MainColor}{player.player.displayName}</color>{ctf.configData.Messaging.MSGColor} {msg("has dropped")} </color>{ctf.configData.Messaging.MainColor}{ctf.GetTeamName(flag.team)}'s</color>{ctf.configData.Messaging.MSGColor} {msg("flag")}!</color>"); } }