Guest User

Team Manager

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