Advertisement
Winter__

Untitled

Aug 14th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.54 KB | None | 0 0
  1. options:
  2. pre1: <light grey>[<gold>UHC<light grey>]<light green>
  3. pre2: <light grey>[<dark aqua>Captains<light grey>]<light aqua>
  4.  
  5. command /captains [<text>] [<text>]:
  6. permission: skript.op
  7. aliases: /captain, /cap
  8. trigger:
  9. if arg 1 is "enable":
  10. set {captainsEnabled} to true
  11. message "{@pre1} <gold>Captains <light green>has been <green>enabled"
  12. stop
  13. else if arg 1 is "disable":
  14. set {captainsEnabled} to false
  15. message "{@pre1} <gold>Captains <light green>has been <red>disabled"
  16. stop
  17. else if {captainsEnabled} is false:
  18. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  19. stop
  20. else:
  21. if arg 1 is "add" or "set":
  22. if arg 2 is set:
  23. set {captains::%arg 2%} to arg 2
  24. broadcast "{@pre2} <gold>%arg 2% <light aqua>is now a captain"
  25. stop
  26. else:
  27. set {captains::%player%} to player
  28. message "{@pre2} <gold>You <light aqua>are now a captain" to the player
  29. stop
  30. else if arg 1 is "remove":
  31. if arg 2 is set:
  32. remove arg 2 from {captains::*}
  33. broadcast "{@pre2} <gold>%arg 2% <light red>is no longer a captain"
  34. stop
  35. else:
  36. set {captains::%player%} to player
  37. message "{@pre2} <gold>You <light red>are no longer a captain"
  38. stop
  39. else if arg 1 is "reset":
  40. delete {captains::*}
  41. message "{@pre2} All captains have been reset" to the player
  42. stop
  43. else if arg 1 is "list":
  44. message "{@pre2} Current captains are<white>:" to the player
  45. loop {captains::*}:
  46. message "{@pre2} <gold>%{captains::%loop-value%}%" to the player
  47. else if arg 1 is "help":
  48. make player execute command "/captainshelp"
  49. stop
  50. else:
  51. message "Usage: /captains [<add,remove,reset,list,help>] [<playername>]" to the player
  52.  
  53. command /captainsHelp:
  54. permission: skript.op
  55. aliases: /caphelp, /chelp
  56. trigger:
  57. if {captainsEnabled} is false:
  58. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  59. stop
  60. else:
  61. message "{@pre2} --- <gold>Captains <light aqua>---" to the player
  62. message "{@pre2} The command for this skript are:" to the player
  63. message "{@pre2} <gold>/Captains" to the player
  64. message "{@pre2} <gold>/captainsRandom" to the player
  65. message "{@pre2} <gold>/captainsTeams" to the player
  66. message "{@pre2} <gold>/captainsSetColor" to the player
  67. message "{@pre2} <gold>/captainsPlayers" to the player
  68. message "{@pre2} <gold>/captainsPick" to the player
  69. message "{@pre2} <gold>/choose" to the player
  70. message "{@pre2} <gold>/captainsHelp" to the player
  71. message "{@pre2} and" to the player
  72. message "{@pre2} <gold>/captainsReset" to the player
  73. message "{@pre2} Use any of the commands with no arguments to see the usage" to the player
  74.  
  75. command /captainsRandom [<int>]:
  76. permission: skript.op
  77. aliases: /capRandom, /cRandom, /crand
  78. trigger:
  79. if {captainsEnabled} is false:
  80. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  81. stop
  82. else:
  83. if arg 1 is not set:
  84. message "{@pre2} You need to set how many random captains to make"
  85. message "{@pre2} <white>Usage: /captainsRandom <number of captains>"
  86. stop
  87. else:
  88. loop all players:
  89. if {captains::*} contains loop-player:
  90. message "{@pre2} %loop-player% is already already a captain"
  91. else:
  92. set {tempPlayerList::%loop-player%} to loop-player
  93. loop arg 1 times:
  94. set {_tempCurrentPlayer} to a random element out of {tempPlayerList::*}
  95. execute console command "cap add %{_tempCurrentPlayer}%"
  96. delete {_tempCurrentPlayer::*}
  97. delete {tempPlayerList::*}
  98. execute console command "captainsPlayers add all"
  99. execute console command "captainsTeams confirm"
  100. execute console command "captainsSetColor"
  101.  
  102. command /captainsTeams [<text>]:
  103. permission: skript.op
  104. aliases: /capteams, /cteams
  105. trigger:
  106. if {captainsEnabled} is false:
  107. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  108. stop
  109. else if arg 1 is not set:
  110. message "{@pre2} Use <gold>/captainsTeams confirm <light aqua>to setup the captains and teams" to the player
  111. message "{@pre2} This will reset all team related information" to the player
  112. else if arg 1 is "confirm":
  113. execute console command "team reset"
  114. set {captainsAmount} to size of {captains::*}
  115. loop {captainsAmount} times:
  116. execute console command "team create %loop-num%"
  117. loop {captains::*}:
  118. add loop-value to {_tempCaptainList::*}
  119. loop {captainsAmount} times:
  120. set {_currentCaptain} to a random element of {_tempCaptainList::*}
  121. remove {_currentCaptain} from {_tempCaptainList::*}
  122. execute console command "team join %loop-num% %{_currentCaptain}%"
  123. execute console command "warp cap%loop-num% %{_currentCaptain}%"
  124. set {captainTeam::%{_currentCaptain}%} to loop-num
  125. delete {_currentCaptain}
  126. else:
  127. message "{@pre2} Error in command" to the player
  128. message "Usage: /captainsTeams confirm" to the player
  129.  
  130. command /captainsSetColor:
  131. permission: skript.op
  132. aliases: /capsetcolor, /capsetcolour, /capcolour, /capcolor, /ccolor ,/ccolour
  133. trigger:
  134. if {captainsEnabled} is false:
  135. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  136. stop
  137. else if command sender does not have the permission "teams.setcolor":
  138. message "{@pre2} &cPermission denied &f(missing ""teams.setcolor"")"
  139. else if {Teams::*} is not set:
  140. message "{@pre2} No teams to color"
  141. else if (size of {Teams::*}) is bigger than 12:
  142. message "{@pre2} Too many teams to color"
  143. else:
  144. set {_Colors::*} to "blue", "red", "gold", "dark_purple", "dark_green", "aqua", "yellow", "dark_aqua", "dark_gray", "green", "gray" and "light_purple"
  145. loop {Teams::*}:
  146. set {_Color} to (first element out of {_Colors::*})
  147. remove {_Color} from {_Colors::*}
  148. command "/scoreboard teams option UHC%loop-value% color %{_Color}%"
  149. replace all "_" with " " in {_Color}
  150. loop {Team.%loop-value%::*}:
  151. message "{@pre2} Your Team color is <%{_Color}%>%{_Color}%" to ("%loop-value-2%" parsed as offlineplayer)
  152. message "{@pre2} Colored all teams"
  153. loop all players:
  154. loop-player has the permission "teams.color.notify"
  155. loop-player is not command sender
  156. message "{@pre2} Colored all teams" to loop-player
  157.  
  158.  
  159. command /captainsPlayers [<text>] [<text>]:
  160. permission: skript.op
  161. aliases: /capPlayers, /captainPlayers ,/cplayers
  162. trigger:
  163. if {captainsEnabled} is false:
  164. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  165. stop
  166. else if arg 1 is not set:
  167. message "{@pre2} <white>Usage: /captainsPlayers <add,remove,reset,list> <player,all>" to the player
  168. stop
  169. else if arg 1 is "add":
  170. if arg 2 is "all" or "everyone" or "*":
  171. loop all players:
  172. if {captains::*} contains loop-player:
  173. message "{@pre2} Captain <gold>%loop-player% <light aqua>has been skipped" to the player
  174. else if {playersOnTeams::*} contains loop-player:
  175. message "{@pre2} Captain <gold>%loop-player% <light aqua>has been skipped" to the player
  176.  
  177. else:
  178. set {players::%loop-player%} to loop-player
  179. message "{@pre2} <gold>%loop-player% <light aqua>has been added" to the player
  180. else if arg 1 is "remove":
  181. arg 2 is set
  182. remove arg 2 from {players::*}
  183. remove arg 2 from {playersOnTeams::*}
  184. message "{@pre2} <gold>%arg 2% <light aqua>removed"
  185. stop
  186. else if arg 1 is "reset":
  187. if arg 2 is not "confirm":
  188. message "{@pre2} <light red>This will set all players who are not captains" to the player
  189. message "{@pre2} <white>Usage: /captainsPlayers reset confirm" to the player
  190. else:
  191. delete {players::*}
  192. delete {playersOnTeams::*}
  193. message "{@pre2} All players have been reset" to the player
  194. stop
  195. else if arg 1 is "list":
  196. message "{@pre2} Players not on a team are:<white>:" to the player
  197. loop {players::*}:
  198. message "{@pre2} <gold>%{players::%loop-value%}%" to the player
  199. message "{@pre2} <light red>On teams<white>:" to the player
  200. loop {playersOnTeams::*}:
  201. message "{@pre2} <gold>%{playersOnTeams::%loop-value%}%" to the player
  202. else:
  203. message "{@pre2} Error in command" to the player
  204. message "Usage: /captainsPlayers [<add,remove,reset,list>] [<playername,all>]" to the player
  205.  
  206. command /captainsPick [<player>]:
  207. permission: skript.op
  208. aliases: /capPick, /cPick
  209. trigger:
  210. if {captainsEnabled} is false:
  211. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  212. stop
  213. else if arg 1 is not set:
  214. message "{@pre2} Use <gold>/captainsPick <player name> <light aqua>to set the next picking captain" to the player
  215. stop
  216. else:
  217. delete {choosingCaptain::*}
  218. set {choosingCaptain::*} to arg 1
  219. broadcast "<gold>%arg 1% <light aqua>is now choosing a player"
  220. stop
  221.  
  222. command /captainsStartAll [<text>]:
  223. permission: skript.op
  224. aliases: /capstartall, /cstartall
  225. trigger:
  226. if {captainsEnabled} is false:
  227. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  228. stop
  229. else if arg 1 is not set:
  230. message "{@pre2} This command will keep running until every player is on teams" to the player
  231. message "{@pre2} Make sure all captains and players are set and that teams are set and coloured" to the player
  232. message "{@pre2} Use <gold>/captainsStartAll confirm <light aqua>if you are sure" to the player
  233. stop
  234. else:
  235. message "todo" to the player
  236. stop
  237.  
  238. command /choose [<player>]:
  239. aliases: /pick
  240. trigger:
  241. if {captainsEnabled} is false:
  242. message "{@pre1} <gold>Captains <light green>is <red>disabled"
  243. stop
  244. else if {captains::*} does not contain player:
  245. message "{@pre2} <light red>You are not a captain, you can not use this command" to the player
  246. stop
  247. else if arg 1 is not set:
  248. message "{@pre2} <light red>Select a player to join your team" to the player
  249. message "{@pre2} <white>Usage: /choose <player name>" to the player
  250. stop
  251. else if {players::*} is not set:
  252. message "{@pre2} <light red>No players left not on teams" to the player
  253. if player is op:
  254. message "{@pre2} <light red>If you have not set players yet use <gold>/captainsPlayers add all" to the player
  255. message "{@pre2} <light aqua>Use the command <gold>/captainsPlayers <light aqua> with no arguments to see the usage" to the player
  256. stop
  257. else:
  258. if {choosingCaptain::*} is not player:
  259. message "{@pre2} <light red>You are not the captain that is current choosing" to the player
  260. stop
  261. else if {choosingCaptain::*} is not set:
  262. message "{@pre2} <light red>You are not the captain that is current choosing" to the player
  263. stop
  264. else:
  265. if {playersOnTeams::%arg 1%} is arg 1:
  266. message "{@pre2} <light red>That player is already on a team" to the player
  267. stop
  268. else:
  269. set {playersOnTeams::%arg 1%} to arg 1
  270. remove arg 1 from {players::*}
  271. broadcast "{@pre2} <gold>%player% <light aqua>has chosen <gold>%arg 1%"
  272. execute console command "team join %{captainTeam::%player%}% %arg 1%"
  273. execute console command "warp capteam%{captainTeam::%player%}% %arg 1%"
  274. delete {choosingCaptain::*}
  275.  
  276. command /captainsReset [<text>]:
  277. permission: skript.op
  278. aliases: /capReset, /capRe, /cRe
  279. trigger:
  280. if arg 1 is not set:
  281. message "{@pre2} Use <gold>/captainsReset confirm <light aqua>to reset all Captains variables" to the player
  282. message "{@pre2} This will reset all team related information as well" to the player
  283. stop
  284. else if arg 1 is "confirm":
  285. delete {captains::*}
  286. delete {currentCaptain::*}
  287. delete {noTeamPlayers::*}
  288. delete {choosingCaptain::*}
  289. delete {playersOnTeams::*}
  290. delete {players::*}
  291. delete {captainTeam::*}
  292. delete {tempPlayerList::*}
  293. delete {captainsEnabled}
  294. delete {captainsAmount}
  295. execute console command "team reset"
  296. wait 5 ticks
  297. message "{@pre2} All captains information has been reset" to the player
  298. else:
  299. message "{@pre2} Error in command" to the player
  300.  
  301. on skript start:
  302. set {captainsEnabled} to false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement