Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case ActionType.CreateTeams:
- RedPath = Path.Combine(Settings.NameListPath) + "RedTeam.txt";
- BluePath = Path.Combine(Settings.NameListPath) + "BlueTeam.txt";
- if ((SMain.Envir.Random.Next(2) == 1) && player.CurrentMap.RedTeam < 5)
- {
- if ((File.ReadAllLines(RedPath).All(t => player.Name != t)) || (File.ReadAllLines(BluePath).All(t => player.Name != t)))
- {
- player.CurrentMap.RedTeam += 1;
- using (var line = File.AppendText(RedPath))
- {
- line.WriteLine(player.Name);
- }
- }
- }
- else if (player.CurrentMap.BlueTeam < 5)
- {
- if ((File.ReadAllLines(RedPath).All(t => player.Name != t)) || (File.ReadAllLines(BluePath).All(t => player.Name != t)))
- {
- player.CurrentMap.BlueTeam += 1;
- using (var line = File.AppendText(BluePath))
- {
- line.WriteLine(player.Name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement