Advertisement
fleft17

Untitled

Jul 10th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1.  
  2.  
  3. else if arg 1 is equal to "random":
  4. if command sender does not have the permission "teams.random":
  5. message "{@P} §4Permission denied. §r(missing ""teams.random"")"
  6. else if arg 2 is not set:
  7. message "{@P} {@IS}"
  8. else if arg 3 is not set:
  9. message "{@P} {@IS}"
  10. else:
  11. set {_TeamSize} to ("%arg 2%" parsed as integer)
  12. set {_TeamAmount} to ("%arg 3%" parsed as integer)
  13. if {_TeamSize} is not set:
  14. message "{@P} {@IS}"
  15. else if {_TeamAmount} is not set:
  16. message "{@P} {@IS}"
  17. else if {_TeamSize} is less than 1:
  18. message "{@P} {@IS}"
  19. else if {_TeamAmount} is less than 1:
  20. message "{@P} {@IS}"
  21. else:
  22. loop all players:
  23. {Teams.InTeam::%loop-player%} is not set
  24. add (name of loop-player) to {_Players::*}
  25.  
  26. if ({_TeamSize}*{_TeamAmount}) is not equal to (size of {_Players::*}):
  27. message "{@P} The amount of people does not match."
  28. else:
  29. loop {Teams::*}:
  30. command "/scoreboard teams remove UHC%loop-value%"
  31. delete {Team.%loop-value%::*}
  32. delete {Teams.InTeam::*}
  33. delete {Teams::*}
  34. broadcast "{@P} Randomizing &a%arg 3%&r teams of &9%arg 2%§r..."
  35. loop all players:
  36. command "/playsound note.harp %loop-player%"
  37. wait 10 ticks
  38.  
  39. set {RandomTeams} to true
  40.  
  41. loop {_TeamAmount} times:
  42. command "/scoreboard teams add UHC%loop-number%"
  43. set {Teams::%loop-number%} to loop-number
  44. loop {_TeamSize} times:
  45. set {_Player} to (random element out of {_Players::*})
  46. remove {_Player} from {_Players::*}
  47. command "/scoreboard teams join UHC%loop-number-1% %{_Player}%"
  48. add {_Player} to {Team.%loop-number-1%::*}
  49. set {Teams.InTeam::%{_Player}%} to loop-number-1
  50. wait 1 second
  51. loop {Teams::*}:
  52. broadcast "&9&l=-=-= Team %loop-value-1% =-=-="
  53. execute console command "/sall note.pling 1"
  54. loop {Team.%loop-value%::*}:
  55. wait 0.1 seconds
  56. broadcast " &0-&r &l%loop-value-2%"
  57. execute console command "/sall note.bass 1"
  58. wait 0.25 seconds
  59.  
  60. broadcast "{@P} Teams are set! Leaving now is NOT allowed!"
  61. if {TeamSpeakChannels} is true:
  62. broadcast "{@P} Your TS channels have been created by %command sender%!"
  63. broadcast "{@P} Use &l/pm&r to talk to your team!"
  64. set {RandomTeams} to false
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. else if arg 1 is equal to "friendly" or "fire":
  75. if arg-2 is "on":
  76. loop {Teams::*}:
  77. execute console command "/scoreboard teams option %loop-value% friendlyfire true"
  78. broadcast "{@P} Friendly fire enabled!"
  79.  
  80. if arg-2 is "off":
  81. loop {Teams::*}:
  82. execute console command "/scoreboard teams option %loop-value% friendlyfire false"
  83. broadcast "{@P} Friendly fire disabled!"
  84.  
  85.  
  86.  
  87.  
  88.  
  89. else if arg 1 is equal to "channels":
  90. arg-2 is "true" or "yes" or "on":
  91. set {TeamSpeakChannel} to true
  92. message "{@P} For this game, you'll be making channels!"
  93. message "{@P} If this isn't what you planned, use:"
  94. message "{@P} /team channels off"
  95. arg-2 is "false" or "no" or "off":
  96. set {TeamSpeakChannel} to false
  97. message "{@P} For this game, you won't be making channels!"
  98. message "{@P} If this isn't what you planned, use:"
  99. message "{@P} /team channels on"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement