Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. case ActionType.CreateTeams:
  2. RedPath = Path.Combine(Settings.NameListPath) + "RedTeam.txt";
  3. BluePath = Path.Combine(Settings.NameListPath) + "BlueTeam.txt";
  4. if ((SMain.Envir.Random.Next(2) == 1) && player.CurrentMap.RedTeam < 5)
  5. {
  6. if ((File.ReadAllLines(RedPath).All(t => player.Name != t)) || (File.ReadAllLines(BluePath).All(t => player.Name != t)))
  7. {
  8. player.CurrentMap.RedTeam += 1;
  9. using (var line = File.AppendText(RedPath))
  10. {
  11. line.WriteLine(player.Name);
  12. }
  13. }
  14. }
  15. else if (player.CurrentMap.BlueTeam < 5)
  16. {
  17. if ((File.ReadAllLines(RedPath).All(t => player.Name != t)) || (File.ReadAllLines(BluePath).All(t => player.Name != t)))
  18. {
  19. player.CurrentMap.BlueTeam += 1;
  20. using (var line = File.AppendText(BluePath))
  21. {
  22. line.WriteLine(player.Name);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement