Advertisement
fleft17

Untitled

Jun 26th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.96 KB | None | 0 0
  1. #variables
  2. #{Teams::%id%} - list of integer - all team numbers currently active
  3. #loop-index = loop-value - so {Teams::%id%} to check if team exists
  4.  
  5. #{Team.%integer%::*} - list of "text" - player names in that team (TEXT!)
  6. #{Teams.InTeam::%player%} - integer/null - what team is player in?
  7.  
  8. #{TeamBoxWarps::%number%} - list of locations
  9.  
  10. #commands
  11. #/team help
  12. #/team list
  13. #/team create <id>
  14. #/team delete <id>
  15. #/team join <id> [<player>]
  16. #/team leave [<player>]
  17. #/team color
  18. #/team uncolor
  19. #/team solos
  20. #/team soloinform
  21. #/team tpbox
  22. #/team setboxwarp <id>
  23. #/team rebuild
  24. #/team random <team size> <team amount>
  25. #/team reset
  26.  
  27. options:
  28. P: &7[&fTeams&7]&r
  29. N: §9§o%command sender%:§r
  30.  
  31. IS: Invalid Syntax. §b/team help§r?
  32.  
  33. command /team [<text>] [<text>] [<text>] [<text>] [<text>]:
  34. trigger:
  35.  
  36. if arg 1 is not set:
  37. command sender command "/team help"
  38.  
  39.  
  40.  
  41. else if arg 1 is equal to "help":
  42. if command sender does not have the permission "teams.help":
  43. message "{@P} §4Permission denied. §r(missing ""teams.help"")"
  44. else:
  45. message "§6/team help §4- §7This help page"
  46. message "§6/team list §4- §7List teams"
  47. message "§6/team create [<id>] §4- §7Create Team"
  48. message "§6/team delete <id> §4- §7Delete Team"
  49. message "§6/team join <id> [<player=you>] §4- §7Put <player> in Team"
  50. message "§6/team leave [<player=you>] §4- §7Remove <player> from Team"
  51. message "§6/team color §4- §7Color all teams at once"
  52. message "§6/team uncolor §4- §7Decolor all teams"
  53. message "§6/team solos §4- §7View online players not in teams"
  54. message "§6/team soloinform §4- §7Tell solos to re-/helpop"
  55. message "§6/team tpbox §4- §7Teleport Teams into boxes"
  56. message "§6/team setboxwarp <id> §4- §7Set Teamboxwarp for <id>"
  57. message "§6/team rebuild §4- §7Rebuild teams, skip empty"
  58. message "§6/team random <size> <amount> [extend] §4- §7Create Random Teams"
  59. message "§6/team reset §4- §7Reset all teams"
  60.  
  61.  
  62.  
  63. else if arg 1 is equal to "list":
  64. if {Teams::*} is not set:
  65. message "{@P} No teams defined."
  66. else:
  67. loop {Teams::*}:
  68. message "§6Team %loop-value%:"
  69. loop {Team.%loop-value%::*}:
  70. message "§7§l- §c§o%loop-value-2%"
  71.  
  72.  
  73.  
  74. else if arg 1 is equal to "create":
  75. if command sender does not have the permission "teams.create":
  76. message "{@P} §4Permission denied. §r(missing ""teams.create"")"
  77. else if arg 2 is not set:
  78. message "{@P} {@IS}"
  79. else if arg 3 is set:
  80. message "{@P} {@IS}"
  81. else:
  82. set {_TeamNumber} to ("%arg 2%" parsed as integer)
  83. if {_TeamNumber} is not set:
  84. message "{@P} {@IS}"
  85. else if {_TeamNumber} is smaller than 1:
  86. message "{@P} Invalid Team Number!"
  87. else if {Teams::%{_TeamNumber}%} is set:
  88. message "{@P} That team already exists."
  89. else:
  90. set {Teams::%{_TeamNumber}%} to {_TeamNumber}
  91. command "/scoreboard teams add UHC%{_TeamNumber}%"
  92.  
  93. message "{@P} Created Team §6%{_TeamNumber}%"
  94. loop all players:
  95. loop-player has the permission "teams.create.notify"
  96. loop-player is not command sender
  97. message "{@P} {@N} Created Team§6%{_TeamNumber}%" to loop-player
  98.  
  99.  
  100.  
  101. else if arg 1 is equal to "delete":
  102. if command sender does not have the permission "teams.delete":
  103. message "{@P} §4Permission denied. §r(missing ""teams.delete"")"
  104. else if arg 2 is not set:
  105. message "{@P} {@IS}"
  106. else if arg 3 is set:
  107. message "{@P} {@IS}"
  108. else:
  109. set {_TeamNumber} to ("%arg 2%" parsed as integer)
  110. if {_TeamNumber} is not set:
  111. message "{@P} {@IS}"
  112. else if {_TeamNumber} is smaller than 1:
  113. message "{@P} Invalid Team Number!"
  114. else if {Teams::%{_TeamNumber}%} is not set:
  115. message "{@P} That team does not exist."
  116. else:
  117. delete {Teams::%{_TeamNumber}%}
  118. loop {Team.%{_TeamNumber}%::*}:
  119. message "{@P} Your team was deleted." to ("%loop-value%" parsed as offlineplayer)
  120. delete {Teams.InTeam::%loop-value%}
  121. delete {Team.%{_TeamNumber}%::*}
  122. command "/scoreboard teams remove UHC%{_TeamNumber}%"
  123.  
  124. message "{@P} Deleted Team §6%{_TeamNumber}%"
  125. loop all players:
  126. loop-player has the permission "teams.delete.notify"
  127. loop-player is not command sender
  128. message "{@P} {@N} Deleted Team §6%{_TeamNumber}%" to loop-player
  129.  
  130.  
  131.  
  132. else if arg 1 is equal to "join":
  133. if command sender does not have the permission "teams.join":
  134. message "{@P} §4Permission denied. §r(missing ""teams.join"")"
  135. else if arg 2 is not set:
  136. message "{@P} {@IS}"
  137. else if arg 4 is set:
  138. message "{@P} {@IS}"
  139. else:
  140. set {_TeamNumber} to ("%arg 2%" parsed as integer)
  141. if {_TeamNumber} is not set:
  142. message "{@P} {@IS}"
  143. else if {_TeamNumber} is smaller than 1:
  144. message "{@P} Invalid Team Number!"
  145. else if {Teams::%{_TeamNumber}%} is not set:
  146. message "{@P} Team does not exist!"
  147. else:
  148. if arg 3 is not set:
  149. if command sender is console:
  150. message "{@P} {@IS}"
  151. stop
  152. set {_Player} to (name of command sender)
  153. else:
  154. set {_Player} to arg 3
  155.  
  156. if {Teams.InTeam::%{_Player}%} is set:
  157. message "{@P} Player %{_Player}% is already in a team!"
  158. else:
  159. loop {Team.%{_TeamNumber}%::*}:
  160. set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
  161. if {_TeamPlayer} is online:
  162. message "{@P} §6%{_Player}% §rhas been added to your team." to {_TeamPlayer}
  163.  
  164. set {Teams.InTeam::%{_Player}%} to {_TeamNumber}
  165. add {_Player} to {Team.%{_TeamNumber}%::*}
  166. command "/scoreboard teams join UHC%{_TeamNumber}% %{_Player}%"
  167.  
  168. message "{@P} You were added to §6Team %{_TeamNumber}%" to ("%{_Player}%" parsed as offlineplayer)
  169. message "{@P} Added §c%{_Player}% §rto Team §6%{_TeamNumber}%"
  170. loop all players:
  171. loop-player has the permission "teams.join.notify"
  172. loop-player is not command sender
  173. message "{@P} {@N} Added §c%{_Player}% §rto Team §6%{_TeamNumber}%" to loop-player
  174.  
  175.  
  176.  
  177. else if arg 1 is equal to "leave":
  178. if command sender does not have the permission "teams.leave":
  179. message "{@P} §4Permission denied. §r(missing ""teams.leave"")"
  180. else if arg 3 is set:
  181. message "{@P} {@IS}"
  182. else:
  183. if arg 2 is not set:
  184. if command sender is console:
  185. message "{@P} {@IS}"
  186. stop
  187. set {_Player} to (name of command sender)
  188. else:
  189. set {_Player} to arg 2
  190.  
  191. if {Teams.InTeam::%{_Player}%} is not set:
  192. message "{@P} Player %{_Player}% is not in a team!"
  193. else:
  194. set {_TeamNumber} to {Teams.InTeam::%{_Player}%}
  195. delete {Teams.InTeam::%{_Player}%}
  196. remove {_Player} from {Team.%{_TeamNumber}%::*}
  197. command "/scoreboard teams leave %{_Player}%"
  198.  
  199. loop {Team.%{_TeamNumber}%::*}:
  200. set {_TeamPlayer} to ("%loop-value-1%" parsed as offlineplayer)
  201. if {_TeamPlayer} is online:
  202. {seeRemove.%{_TeamPlayer}%} is true:
  203. message "{@P} §6%{_Player}% §rhas been removed from your team." to {_TeamPlayer}
  204.  
  205. message "{@P} You were removed from §6Team %{_TeamNumber}%" to ("%{_Player}%" parsed as offlineplayer)
  206. {seeRemove.%command sender%} is true:
  207. message "{@P} Removed §c%{_Player}% §rfrom Team §6%{_TeamNumber}%"
  208. loop all players:
  209. loop-player has the permission "teams.join.notify"
  210. {seeRemove.%loop-player%} is true:
  211. loop-player is not command sender
  212. message "{@P} {@N} Removed §c%{_Player}% §rfrom Team §6%{_TeamNumber}%" to loop-player
  213.  
  214.  
  215.  
  216. else if arg 1 is equal to "color":
  217. if command sender does not have the permission "teams.color":
  218. message "{@P} §4Permission denied. §r(missing ""teams.color"")"
  219. else if arg 2 is set:
  220. message "{@P} {@IS}"
  221. else if {Teams::*} is not set:
  222. message "{@P} No teams to color!"
  223. else if (size of {Teams::*}) is bigger than 20:
  224. message "{@P} Too many teams to color!"
  225. else:
  226. if (size of {Teams::*}) is smaller than 16:
  227. set {_Colors::*} to "aqua", "black", "blue", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "light_purple", "red" and "yellow"
  228. else if (size of {Teams::*}) is smaller than 20:
  229. set {_Colors::*} to " ", "black", "blue", "bold", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "italic", "light_purple", "red", "strikethrough", "underline" and "yellow"
  230. else:
  231. set {_Colors::*} to "aqua", "black", "blue", "bold", "dark_aqua", "dark_blue", "dark_gray", "dark_green", "dark_purple", "dark_red", "gold", "gray", "green", "italic", "light_purple", "red", "strikethrough", "underline", "white" and "yellow"
  232. loop {Teams::*}:
  233. set {_Color} to (random element out of {_Colors::*})
  234. remove {_Color} from {_Colors::*}
  235. command "/scoreboard teams option UHC%loop-value% color %{_Color}%"
  236. replace all "_" with " " in {_Color}
  237. loop {Team.%loop-value%::*}:
  238. message "{@P} Your Team color is <%{_Color}%>%{_Color}%§r!" to ("%loop-value-2%" parsed as offlineplayer)
  239.  
  240. message "{@P} Colored all teams"
  241. loop all players:
  242. loop-player has the permission "teams.color.notify"
  243. loop-player is not command sender
  244. message "{@P} {@N} Colored all teams" to loop-player
  245.  
  246.  
  247.  
  248. else if arg 1 is equal to "uncolor":
  249. if command sender does not have the permission "teams.uncolor":
  250. message "{@P} §4Permission denied. §r(missing ""teams.uncolor"")"
  251. else if arg 2 is set:
  252. message "{@P} {@IS}"
  253. else if {Teams::*} is not set:
  254. message "{@P} No teams to uncolor!"
  255. else:
  256. loop {Teams::*}:
  257. command "/scoreboard teams option UHC%loop-value% color reset"
  258. loop {Team.%loop-value%::*}:
  259. message "{@P} Your Team color was removed." to ("%loop-value-2%" parsed as offlineplayer)
  260.  
  261. message "{@P} Uncolored all teams"
  262. loop all players:
  263. loop-player has the permission "teams.uncolor.notify"
  264. loop-player is not command sender
  265. message "{@P} {@N} Uncolored all teams" to loop-player
  266.  
  267.  
  268.  
  269. else if arg 1 is equal to "solos":
  270. if command sender does not have the permission "teams.solos":
  271. message "{@P} §4Permission denied. §r(missing ""teams.solos"")"
  272. else if arg 2 is set:
  273. message "{@P} {@IS}"
  274. else:
  275. loop all players:
  276. {Teams.InTeam::%loop-player%} is not set
  277. add (name of loop-player) to {_Solos::*}
  278.  
  279. if {_Solos::*} is not set:
  280. message "{@P} There are no solos!"
  281. else:
  282. message "{@P} Solos: %join {_Solos::*} with "", ""%"
  283.  
  284.  
  285.  
  286. else if arg 1 is equal to "soloinform":
  287. if command sender does not have the permission "teams.soloinform":
  288. message "{@P} §4Permission denied. §r(missing ""teams.soloinform"")"
  289. else if arg 2 is set:
  290. message "{@P} {@IS}"
  291. else:
  292. loop all players:
  293. loop-player is not command sender
  294. if {Teams.InTeam::%loop-player%} is not set:
  295. command "/playsound note.pling %loop-player%"
  296. message "{@P} §4Warning! §rYou are not yet in a team." to loop-player
  297. message "{@P} If you have a set team, please re-§4/helpop §rit." to loop-player
  298. message "{@P} If you are solo, please ""§4/helpop I am solo§r""." to loop-player
  299. if loop-player has the permission "teams.soloinform.notify":
  300. message "{@P} {@N} Informed Solos" to loop-player
  301. message "{@P} Informed Solos"
  302.  
  303.  
  304. else if arg 1 is equal to "tpbox":
  305. if command sender does not have the permission "teams.tpbox":
  306. message "{@P} §4Permission denied. §r(missing ""teams.tpbox"")"
  307. else if arg 2 is set:
  308. message "{@P} {@IS}"
  309. else if (size of {TeamBoxWarps::*}) is smaller than (size of {Teams::*}):
  310. message "{@P} Too less warps!"
  311. else:
  312. set {_Count} to 0
  313. loop {Teams::*}:
  314. increase {_Count} by 1
  315. loop {Team.%loop-value%::*}:
  316. teleport ("%loop-value-2%" parsed as offlineplayer) to {TeamBoxWarps::%{_Count}%}
  317.  
  318. message "{@P} Teleported Teams in Boxes"
  319. loop all players:
  320. loop-player has the permission "teams.tpbox.notify"
  321. loop-player is not command sender
  322. message "{@P} {@N} Teleported Teams in Boxes" to loop-player
  323.  
  324.  
  325. else if arg 1 is equal to "setboxwarp":
  326. if command sender is console:
  327. message "{@P} {@IS}"
  328. if command sender does not have the permission "teams.setboxwarp":
  329. message "{@P} §4Permission denied. §r(missing ""teams.setboxwarp"")"
  330. else if arg 2 is not set:
  331. message "{@P} {@IS}"
  332. else if arg 3 is set:
  333. message "{@P} {@IS}"
  334. else:
  335. set {_WarpNumber} to ("%arg 2%" parsed as integer)
  336. if {_WarpNumber} is not set:
  337. message "{@P} {@IS}"
  338. else if {_WarpNumber} is smaller than 1:
  339. message "{@P} {@IS}"
  340. else:
  341. if {_WarpNumber} is not equal to 1:
  342. set {_TestWarpNumber} to {_WarpNumber}-1
  343. if {TeamBoxWarps::%{_TestWarpNumber}%} is not set:
  344. message "{@P} The previous warp %{_TestWarpNumber}% is not set!"
  345. stop
  346.  
  347.  
  348. set {TeamBoxWarps::%{_WarpNumber}%} to (location of (block at command sender))
  349. message "{@P} Configured Warp %{_WarpNumber}% to %{TeamBoxWarps::%{_WarpNumber}%}%"
  350.  
  351.  
  352.  
  353. else if arg 1 is equal to "rebuild":
  354. if command sender does not have the permission "teams.rebuild":
  355. message "{@P} §4Permission denied. §r(missing ""teams.rebuild"")"
  356. else if arg 2 is set:
  357. message "{@P} {@IS}"
  358. else:
  359. set {_TeamCount} to 0
  360. delete {Teams.InTeam::*}
  361. loop {Teams::*}:
  362. if (size of {Team.%loop-value%::*}) is not equal to 0:
  363. set {_TeamCount} to {_TeamCount}+1
  364. set {_New.Team.%{_TeamCount}%::*} to {Team.%loop-value%::*}
  365. set {_New.Teams::%{_TeamCount}%} to {_TeamCount}
  366. delete {Team.%loop-value%::*}
  367. command "/scoreboard teams remove UHC%loop-value%"
  368.  
  369. delete {Teams::*}
  370. set {Teams::*} to {_New.Teams::*}
  371. loop {Teams::*}:
  372. command "/scoreboard teams add UHC%loop-value%"
  373. set {Team.%loop-value%::*} to {_New.Team.%loop-value%::*}
  374. loop {Team.%loop-value%::*}:
  375. set {Teams.InTeam::%loop-value-2%} to loop-value-1
  376. command "/scoreboard teams join UHC%loop-value-1% %loop-value-2%"
  377.  
  378. message "{@P} Issued Rebuild"
  379. loop all players:
  380. loop-player has the permission "teams.rebuild.notify"
  381. loop-player is not command sender
  382. message "{@P} {@N} Issued Rebuild" to loop-player
  383.  
  384.  
  385. else if arg 1 is equal to "random":
  386. if command sender does not have the permission "teams.random":
  387. message "{@P} §4Permission denied. §r(missing ""teams.random"")"
  388. else if arg 2 is not set:
  389. message "{@P} {@IS}"
  390. else if arg 3 is not set:
  391. message "{@P} {@IS}"
  392. else:
  393. set {_TeamSize} to ("%arg 2%" parsed as integer)
  394. set {_TeamAmount} to ("%arg 3%" parsed as integer)
  395. if {_TeamSize} is not set:
  396. message "{@P} {@IS}"
  397. else if {_TeamAmount} is not set:
  398. message "{@P} {@IS}"
  399. else if {_TeamSize} is less than 1:
  400. message "{@P} {@IS}"
  401. else if {_TeamAmount} is less than 1:
  402. message "{@P} {@IS}"
  403. else:
  404. loop all players:
  405. {Teams.InTeam::%loop-player%} is not set
  406. add (name of loop-player) to {_Players::*}
  407.  
  408. if ({_TeamSize}*{_TeamAmount}) is not equal to (size of {_Players::*}):
  409. message "{@P} The amount of people does not match."
  410. else:
  411. loop {Teams::*}:
  412. command "/scoreboard teams remove UHC%loop-value%"
  413. delete {Team.%loop-value%::*}
  414. delete {Teams.InTeam::*}
  415. delete {Teams::*}
  416.  
  417. set {randomizingTeams} to true
  418. broadcast "{@P}&7 -------------------------------------------"
  419.  
  420. broadcast "{@P} Randomizing &a%arg 3% teams §9of %arg 2%§r..."
  421. loop all players:
  422. command "/playsound note.harp %loop-player%"
  423. wait 10 ticks
  424.  
  425. loop {_TeamAmount} times:
  426. command "/scoreboard teams add UHC%loop-number%"
  427. set {Teams::%loop-number%} to loop-number
  428. loop {_TeamSize} times:
  429. set {_Player} to (random element out of {_Players::*})
  430. remove {_Player} from {_Players::*}
  431. command "/scoreboard teams join UHC%loop-number-1% %{_Player}%"
  432. add {_Player} to {Team.%loop-number-1%::*}
  433. set {Teams.InTeam::%{_Player}%} to loop-number-1
  434.  
  435. loop {Teams::*}:
  436. loop {Team.%loop-value%::*}:
  437. set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
  438. if {_Player} is online:
  439. message "{@P} &9Your team:" to {_Player}
  440. loop {Team.%loop-value-1%::*}:
  441. loop-value-3 is not equal to loop-value-2
  442. message "{@P} §a%loop-value-3%" to {_Player}
  443.  
  444. if arg 4 is set:
  445. if arg 4 is equal to "extend":
  446. set {_Extend} to true
  447.  
  448. if {_Extend} is not set:
  449. broadcast "{@P} &c&lTeams are randomized!"
  450. broadcast "{@P} §lGet into Teamspeak!"
  451. broadcast "{@P} Channels have been created by %command sender%."
  452. broadcast "{@P} Password = TS Team number"
  453. broadcast "{@P} Leaving now results in a ban."
  454. broadcast "{@P}&7 -------------------------------------------"
  455. set {randomizingTeams} to false
  456.  
  457.  
  458. loop all players:
  459. command "/playsound note.pling %loop-player%"
  460. wait 0.25 seconds
  461. loop all players:
  462. command "/playsound note.pling %loop-player%"
  463. wait 0.25 seconds
  464. loop all players:
  465. command "/playsound note.pling %loop-player%"
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475. else if arg 1 is equal to "reset":
  476. if command sender does not have the permission "teams.reset":
  477. message "{@P} §4Permission denied. §r(missing ""teams.reset"")"
  478. else if arg 2 is set:
  479. message "{@P} {@IS}"
  480. else:
  481. loop {Teams::*}:
  482. command "/scoreboard teams remove UHC%loop-value%"
  483. delete {Team.%loop-value%::*}
  484. delete {Teams::*}
  485. delete {Teams.InTeam::*}
  486.  
  487. message "{@P} Team Manager reset!"
  488. loop all players:
  489. loop-player has the permission "teams.reset.notify"
  490. loop-player is not command sender
  491. message "{@P} {@N} Reset all teams" to loop-player
  492.  
  493.  
  494. else if arg 1 is equal to "death":
  495. if {seeRemove.%command sender%} is not set:
  496. set {seeRemove.%command sender%} to true
  497. if {seeRemove.%command sender%} is true:
  498. set {seeRemove.%command sender%} to false
  499. stop
  500. if {seeRemove.%command sender%} is false:
  501. set {seeRemove.%command sender%} to true
  502. stop
  503.  
  504.  
  505.  
  506. else:
  507. command sender command "/team help"
  508.  
  509.  
  510. command /pm <text>:
  511. executable by: players
  512. trigger:
  513. if {Teams.InTeam::%command sender%} is not set:
  514. message "{@P} You are not in a team!"
  515. else:
  516. set {_Team} to {Teams.InTeam::%command sender%}
  517. loop all players:
  518. if {Teams.InTeam::%loop-player%} is equal to {_Team}:
  519. message "§f[§7§lTEAM§f] §e§o%command sender%§r: %arg 1%" to loop-player
  520. else if {PMSocialSpy::%loop-player%} is true:
  521. message "§f[§7§lPMS§f] §9[§f%{_Team}%§9] §e§o%command sender%§r: %arg 1%" to loop-player
  522.  
  523. command /fpm <text> <text>:
  524. permission: skript.forcepm
  525. usage: /fpm <team number/player> <text>
  526. trigger:
  527. set {_Number} to ("%arg 1%" parsed as integer)
  528. if {_Number} is set:
  529. if {Teams::%arg 1%} is not set:
  530. message "Team %arg 1% not defined."
  531. else:
  532. loop all players:
  533. {Teams.InTeam::%loop-player%} is equal to {_Number}
  534. message "§f[§7§lTEAM§f] §4§o%command sender%§r: %arg 1%" to loop-player
  535. else:
  536. if {Teams.InTeam::%arg 1%} is not set:
  537. message "Player %arg 1% not in a team."
  538. else:
  539. loop all players:
  540. {Teams.InTeam::%loop-player%} is equal to {Teams.InTeam::%arg 1%}
  541. message "§f[§7§lTEAM§f] §4§o%command sender%§r: %arg 1%" to loop-player
  542.  
  543. command /pms:
  544. permission: skript.pm.socialspy
  545. trigger:
  546. if {PMSocialSpy::%command sender%} is not set:
  547. set {PMSocialSpy::%command sender%} to true
  548. message "Team Socialspy now on"
  549. else:
  550. delete {PMSocialSpy::%command sender%}
  551. message "Team Socialspy now off"
  552.  
  553.  
  554.  
  555. command /ct <text> <text> [<text>] [<text>] [<text>] [<text>]:
  556. permission: teams.createteam
  557. usage: /ct <players> [up to 6]
  558. trigger:
  559. add (arg 1) to {_ThisTeam::*}
  560. add (arg 2) to {_ThisTeam::*}
  561. if arg 3 is set:
  562. add (arg 3) to {_ThisTeam::*}
  563. if arg 4 is set:
  564. add (arg 4) to {_ThisTeam::*}
  565. if arg 5 is set:
  566. add (arg 5) to {_ThisTeam::*}
  567. if arg 6 is set:
  568. add (arg 6) to {_ThisTeam::*}
  569.  
  570. loop {_ThisTeam::*}:
  571. {Teams.InTeam::%loop-value%} is set
  572. add loop-value to {_AlreadyOnTeam::*}
  573.  
  574. if {_AlreadyOnTeam::*} is set:
  575. message "{@P} The following players are already on a team."
  576. message "{@P} %join {_AlreadyOnTeam::*} with "", ""%"
  577. else:
  578. set {_TeamNumber} to 1
  579. while {Teams::%{_TeamNumber}%} is set:
  580. set {_TeamNumber} to {_TeamNumber}+1
  581.  
  582. set {Teams::%{_TeamNumber}%} to {_TeamNumber}
  583. command "/scoreboard teams add UHC%{_TeamNumber}%"
  584. loop {_ThisTeam::*}:
  585. set {Teams.InTeam::%loop-value%} to {_TeamNumber}
  586. add "%loop-value%" to {Team.%{_TeamNumber}%::*}
  587. command "/scoreboard teams join UHC%{_TeamNumber}% %loop-value%"
  588.  
  589. set {_Buffer} to ""
  590. loop {_ThisTeam::*}:
  591. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  592. if {_Player} is online:
  593. set {_Buffer} to "%{_Buffer}%§a%loop-value% "
  594. else:
  595. set {_Buffer} to "%{_Buffer}%§c%loop-value% "
  596. command "/whitelist add %loop-value%"
  597.  
  598. loop {_ThisTeam::*}:
  599. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  600. command "/playsound note.pling %loop-value%"
  601. message "{@P} You have been put on a team with the following people!" to {_Player}
  602. message "{@P} %{_Buffer}%" to {_Player}
  603. message "{@P} Names in &cred &rare offline, but have been whitelisted!" to {_Player}
  604. message "{@P} Mistake? &cImmediately&r ""/helpop WRONG TEAM!""!" to {_Player}
  605.  
  606. message "{@P} Created a team with the following members:"
  607. message "{@P} %{_Buffer}%"
  608. loop all players:
  609. loop-player has the permission "teams.createteam.notify"
  610. loop-player is not command sender
  611. message "{@P} {@N} Created team with members:" to loop-player
  612. message "{@P} %{_Buffer}%" to loop-player
  613.  
  614.  
  615.  
  616.  
  617.  
  618. on chat:
  619. {randomizingTeams} is true:
  620. cancel the event
  621. #on command:
  622. # command is equal to "scoreboard"
  623. # substring of (full command) from 1 to 16 is equal to "scoreboard teams"
  624. # command sender is not console
  625. # cancel the event
  626. # if command sender does not have the permission "team.showhandler":
  627. # message "§cI'm sorry, but you do not have the permission to perform this command. Please contact the server administrators if you believe that this is in error."
  628. # else:
  629. # message "You dumbie. §9Use the team handler. §b/team help"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement