lukenrip

En Premium Party

Mar 24th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.15 KB | None | 0 0
  1. options:
  2. Command: party # Main command for the Skript
  3. CommandALIAS: p # An optional (alias) command for the main command
  4. PartyPERM: party.use # Permission for normal players
  5. AdminPERM: party.admin # Permission for all commands/functions
  6. Prefix: &8[&eParty&8] # Prefix for command related messages
  7. NoPermMSG: &cYou're not permitted to do this. # Sent when a player fails to have the required permission
  8. Chatformatting: true # If set to true, it formats the chat and displays the player's party
  9. Autoupdate: false # False by default - I reccomend turning it on because I might update regularly
  10. Version: 1.4 # Do not change
  11. command /{@Command} [<text>] [<text>]:
  12. aliases: /{@CommandALIAS}
  13. trigger:
  14. if player has permission "{@PartyPERM}" or "{@AdminPERM}":
  15. if arg-1 is set:
  16. if arg-1 is "create":
  17. if {party.%player%} is set:
  18. send "{@Prefix} &cYou're already in a party."
  19. else:
  20. if arg-2 is set:
  21. set {pname.%player%} to arg-2
  22. send "{@Prefix} &aYou created a party named %{pname.%player%}%."
  23. delete {pdesc.%player%}
  24. set {party.%player%} to player
  25. set {partyn.%arg-2%} to player
  26. set {pkills.%player%} to 0
  27. set {pdeaths.%player%} to 0
  28. else:
  29. send "{@Prefix} &cUsage: /{@Command} create <name>"
  30. if arg-1 is "description" or "desc":
  31. if {party.%player%} is set:
  32. if {party.%player%} is player:
  33. if arg-2 is set:
  34. send "{@Prefix} &aYou set your party description."
  35. set {pdesc.%player%} to arg-2
  36. else:
  37. send "{@Prefix} &cUsage: /{@Command} desc <name>"
  38. else:
  39. send "&cYou must be the party leader to set the party description."
  40. else:
  41. send "&cYou're not in a party."
  42. if arg-1 is "invite" or "inv":
  43. if {party.%player%} is set:
  44. if {party.%player%} is player:
  45. if arg-2 is set:
  46. if arg-2 parsed as player is a player:
  47. if arg-2 isn't player:
  48. if {party.%arg-2%} isn't set:
  49. if {partyi.%arg-2%} isn't set:
  50. send "{@Prefix} &aYou invited %arg-2% to your party."
  51. send "{@Prefix} &a%player% has invited you to join their party." to arg-2 parsed as player
  52. set {partyi.%arg-2%} to player
  53. loop {party.%player%::*}:
  54. send "{@Prefix} &a%player% invited %arg-2% to the party." to loop-value
  55. wait 30 seconds
  56. if {partyi.%arg-2%} is set:
  57. delete {partyi.%arg-2%}
  58. send "{@Prefix} &cParty invite from %player% has expired." to arg-2 parsed as player
  59. send "{@Prefix} &c%arg-2%'s party invite has expired."
  60. else:
  61. if {partyi.%arg-2%} is player:
  62. send "{@Prefix} &cYou already invited %arg-2% to your party."
  63. else:
  64. send "{@Prefix} &aYou invited %arg-2% to your party."
  65. send "{@Prefix} &a%player% has invited you to join their party." to arg-2 parsed as player
  66. set {partyi.%arg-2%} to player
  67. loop {party.%player%::*}:
  68. send "{@Prefix} &a%player% invited %arg-2% to the party." to loop-value
  69. wait 30 seconds
  70. if {partyi.%arg-2%} is set:
  71. delete {partyi.%arg-2%}
  72. send "{@Prefix} &cParty invite from %player% has expired." to arg-2 parsed as player
  73. send "{@Prefix} &c%arg-2%'s party invite has expired."
  74. else:
  75. if {party.%arg-2%} is player:
  76. send "{@Prefix} &c%arg-2% is already in your party."
  77. else:
  78. send "{@Prefix} &c%arg-2% is already in a party."
  79. else:
  80. send "{@Prefix} &cYou cannot invite yourself to a party."
  81. else:
  82. send "{@Prefix} &c%arg-2% is not an online player."
  83. else:
  84. send "{@Prefix} &cUsage: {@Command} invite <player>"
  85. else:
  86. send "{@Prefix} &cYou must be the leader of your party to invite."
  87. else:
  88. send "{@Prefix} &cYou must be in a party to invite."
  89. if arg-1 is "join" or "accept":
  90. if arg-2 is set:
  91. if arg-2 parsed as player is a player:
  92. if arg-2 isn't player:
  93. if {partyi.%player%} is arg-2:
  94. if {party.%player%} isn't set:
  95. set {party.%player%} to arg-2
  96. send "{@Prefix} &aYou joined %arg-2%'s party."
  97. send "{@Prefix} &a%player% joined your party." to arg-2 parsed as player
  98. loop {party.%arg-2%::*}:
  99. send "{@Prefix} &a%player% joined the party." to loop-value
  100. add player to {party.%arg-2%::*}
  101. delete {partyi.%player%}
  102. else:
  103. if {party.%player%} is arg-2:
  104. send "{@Prefix} &cYou're already in %arg-2%'s party."
  105. else:
  106. send "{@Prefix} &cYou must first leave your current party to join %arg-2%'s party."
  107. else:
  108. send "{@Prefix} &c%arg-2% did not invite you to their party."
  109. else:
  110. send "{@Prefix} &cYou cannot join yourself."
  111. else:
  112. send "{@Prefix} &c%arg-2% is not an online player."
  113. else:
  114. send "{@Prefix} &cUsage: {@Command} join <player>"
  115. if arg-1 is "leave":
  116. if {party.%player%} is set:
  117. if {party.%player%} isn't player:
  118. send "{@Prefix} &aYou have left %{party.%player%}%'s party."
  119. remove player from {party.%{party.%player%}%::*}
  120. loop {party.%{party.%player%}%::*}:
  121. send "{@Prefix} &c%player% left the party." to loop-value
  122. send "{@Prefix} &c%player% left your party." to {party.%player%} parsed as player
  123. delete {party.%player%}
  124. delete {pchat.%player%}
  125. else:
  126. send "{@Prefix} &cYou must disband your party to leave it."
  127. else:
  128. send "{@Prefix} &cYou're not in a party."
  129. if arg-1 is "disband":
  130. if {party.%player%} is set:
  131. if {party.%player%} is player:
  132. send "{@Prefix} &aYou disbanded your party."
  133. loop {party.%player%::*}:
  134. delete {party.%loop-value%}
  135. delete {pchat.%loop-value%}
  136. send "{@Prefix} &c%player% has disbanded the party." to loop-value
  137. delete {party.%player%::*}
  138. delete {party.%player%}
  139. delete {pchat.%player%}
  140. else:
  141. send "{@Prefix} &cYou must be the party leader to disband."
  142. else:
  143. send "{@Prefix} &cYou're not in a party."
  144. if arg-1 is "info":
  145. if {party.%player%} is set:
  146. if {party.%player%} is player:
  147. send "&eParty Name: &b%{pname.%player%}%"
  148. send "&eParty Description: &b%{pdesc.%player%}%"
  149. send "&eParty Leader: &b%{party.%player%}%"
  150. send "&eParty Member(s): &b%{party.%player%::*}%"
  151. send "&eParty Kills: &b%{pkills.%player%}%"
  152. send "&eParty Deaths: &b%{pdeaths.%player%}%"
  153. else:
  154. send "&eParty Name: &b%{pname.%{party.%player%}%}%"
  155. send "&eParty Description: &b%{pdesc.%{party.%player%}%}%"
  156. send "&eParty Leader: &b%{party.%player%}%"
  157. send "&eParty Member(s): &b%{party.%{party.%player%}%::*}%"
  158. send "&eParty Kills: &b%{pkills.%{party.%player%}%}%"
  159. send "&eParty Deaths: &b%{pdeaths.%{party.%player%}%}%"
  160. else:
  161. send "{@Prefix} &cYou're not in a party."
  162. if arg-1 is "teleport" or "tp" or "warp":
  163. if {party.%player%} is set:
  164. if {party.%player%} is player:
  165. if {party.%player%::*} is set:
  166. loop {party.%player%::*}:
  167. teleport loop-value to player
  168. send "{@Prefix} &a%player% teleported you to their position." to loop-value
  169. send "{@Prefix} &aYou teleport %loop-value% to your position."
  170. else:
  171. send "{@Prefix} &cYou have no party members."
  172. else:
  173. send "{@Prefix} &cYou must be the party leader to teleport."
  174. else:
  175. send "{@Prefix} &cYou're not in a party."
  176. if arg-1 is "chat" or "c":
  177. if {party.%player%} is set:
  178. if {pchat.%player%} isn't set:
  179. set {pchat.%player%} to true
  180. send "{@Prefix} &aYou toggled party-chat on."
  181. else:
  182. delete {pchat.%player%}
  183. send "{@Prefix} &aYou toggled party-chat off."
  184. else:
  185. send "{@Prefix} &cYou're not in a party."
  186. if arg-1 is "who":
  187. if arg-2 is set:
  188. if {partyn.%arg-2%} is set:
  189. send "&eParty Name: &b%arg-2%"
  190. send "&eParty Description: &b%{pdesc.%{partyn.%arg-2%}%}%"
  191. send "&eParty Leader: &b%{partyn.%arg-2%}%"
  192. send "&eParty Member(s): &b%{party.%{partyn.%arg-2%}%::*}%"
  193. send "&eParty Kills: &b%{pkills.%{partyn.%arg-2%}%}%"
  194. send "&eParty Deaths: &b%{pdeaths.%{partyn.%arg-2%}%}%"
  195. stop trigger
  196. else:
  197. if {party.%arg-2%} is arg-2:
  198. send "&eParty Name: &b%{pname.%arg-2%}%"
  199. send "&eParty Description: &b%{pdesc.%{party.%arg-2%}%}%"
  200. send "&eParty Leader: &b%arg-2%"
  201. send "&eParty Member(s): &b%{party.%{party.%arg-2%}%::*}%"
  202. send "&eParty Kills: &b%{pkills.%{party.%arg-2%}%}%"
  203. send "&eParty Deaths: &b%{pdeaths.%{party.%arg-2%}%}%"
  204. stop trigger
  205. else:
  206. loop all players:
  207. if {party.%loop-player%::*} contains arg-2:
  208. send "&eParty Name: &b%{pname.%loop-player%}%"
  209. send "&eParty Description: &b%{pdesc.%loop-player%}%"
  210. send "&eParty Leader: &b%loop-player%"
  211. send "&eParty Member(s): &b%{party.%loop-player%::*}%"
  212. send "&eParty Kills: &b%{pkills.%loop-player%}%"
  213. send "&eParty Deaths: &b%{pdeaths.%loop-player%}%"
  214. stop trigger
  215. else:
  216. set {_nom} to true
  217. if {_nom} is true:
  218. send "{@Prefix} &cThere are no matches for the party or player name ""%arg-2%"""
  219. else:
  220. send "{@Prefix} &cUsage: /{@Command} who [party/name]"
  221. if arg-1 is "setmotd" or "motdset":
  222. if {party.%player%} is set:
  223. if {party.%player%} is player:
  224. if arg-2 is set:
  225. if {motd.%player%} is set:
  226. set {motd.%player%} to "&e%arg-2%"
  227. send "&cYou changed your party's motd to ""%arg-2%"""
  228. else:
  229. set {motd.%player%} to "&e%arg-2%"
  230. send "&cYou set your party's motd to ""%arg-2%"""
  231. else:
  232. send "{@Prefix} &cUsage: /{@Command} setmotd <text>"
  233. else:
  234. send "{@Prefix} &cYou must be the party leader to set the motd."
  235. else:
  236. send "{@Prefix} &cYou're not in a party."
  237. if arg-1 is "motd":
  238. if {party.%player%} is set:
  239. if {motd.%{party.%player%}%} is set:
  240. send "%{motd.%{party.%player%}%}%"
  241. else:
  242. send "{@Prefix} &cYour party's motd isn't set."
  243. else:
  244. send "{@Prefix} &cYou're not in a party."
  245. if arg-1 is "help":
  246. if arg-2 is set:
  247. if arg-2 is "1" or "one" or "page1":
  248. if player has permission "{@AdminPERM}":
  249. send "&ePremium Party by CrucialAddon &8[&eVersion {@Version}&8]"
  250. send ""
  251. send "&eParty Commands &8[&ePage 1/2&8]"
  252. send "&e/{@Command} create <name> &8- &bCreates a party with a specified name"
  253. send "&e/{@Command} desc <name> &8- &bCreate/change your party's description"
  254. send "&e/{@Command} invite <player> &8- &bInvites a player to your party"
  255. send "&e/{@Command} join <player> &8- &bJoins a player's party that you have been invited to"
  256. send "&e/{@Command} leave &8- &bLeave your current party"
  257. send "&e/{@Command} disband &8- &bDisband your current party"
  258. send "&e/{@Command} info &8- &bShows your party's information/stats"
  259. send "&e/{@Command} help [page##] &8- &bDisplays party related commands"
  260. if arg-2 is "2" or "two" or "page2":
  261. if player has permission "{@AdminPERM}":
  262. send "&ePremium Party by CrucialAddon &8[&eVersion {@Version}&8]"
  263. send ""
  264. send "&eParty Commands &8[&ePage 2/2&8]"
  265. send "&e/{@Command} teleport &8- &bTeleport your party to your location"
  266. send "&e/{@Command} chat &8- &bToggle party/public chat"
  267. send "&e/{@Command} who <name/player> &8- &bLook up another party's information/stats"
  268. send "&e/{@Command} setmotd <text> &8- &bSet your party's motd"
  269. send "&e/{@Command} motd &8- &bSee your party's motd"
  270. send "&e/{@Command} help [page##] &8- &bDisplays party related commands"
  271. else if arg-2 isn't "1" or "one" or "page1" or "2" or "two" or "page2":
  272. send "{@Prefix} &cUsage: /{@Command} help <page##>"
  273. else:
  274. send "{@Prefix} &cUsage: /{@Command} help <page##>"
  275. else if arg-1 isn't "create" or "description" or "desc" or "invite" or "inv" or "join" or "accept" or "leave" or "disband" or "info" or "teleport" or "tp" or "warp" or "chat" or "c" or "who" or "setmotd" or "motdset" or "motd" or "help":
  276. if player has permission "{@AdminPERM}":
  277. send "&ePremium Party by CrucialAddon &8[&eVersion {@Version}&8]"
  278. send ""
  279. send "&eParty Commands &8[&ePage 1/2&8]"
  280. send "&e/{@Command} create <name> &8- &bCreates a party with a specified name"
  281. send "&e/{@Command} desc <name> &8- &bCreate/change your party's description"
  282. send "&e/{@Command} invite <player> &8- &bInvites a player to your party"
  283. send "&e/{@Command} join <player> &8- &bJoins a player's party that you have been invited to"
  284. send "&e/{@Command} leave &8- &bLeave your current party"
  285. send "&e/{@Command} disband &8- &bDisband your current party"
  286. send "&e/{@Command} info &8- &bShows your party's information/stats"
  287. send "&e/{@Command} help [page##] &8- &bDisplays party related commands"
  288. else:
  289. if player has permission "{@AdminPERM}":
  290. send "&ePremium Party by CrucialAddon &8[&eVersion {@Version}&8]"
  291. send ""
  292. send "&eParty Commands &8[&ePage 1/2&8]"
  293. send "&e/{@Command} create <name> &8- &bCreates a party with a specified name"
  294. send "&e/{@Command} desc <name> &8- &bCreate/change your party's description"
  295. send "&e/{@Command} invite <player> &8- &bInvites a player to your party"
  296. send "&e/{@Command} join <player> &8- &bJoins a player's party that you have been invited to"
  297. send "&e/{@Command} leave &8- &bLeave your current party"
  298. send "&e/{@Command} disband &8- &bDisband your current party"
  299. send "&e/{@Command} info &8- &bShows your party's information/stats"
  300. send "&e/{@Command} help [page##] &8- &bDisplays party related commands"
  301. else:
  302. send "{@NoPermMSG}"
  303. on join:
  304. if {party.%player%} is set:
  305. if {motd.%{party.%player%}%} is set:
  306. send "%{motd.%{party.%player%}%}%"
  307. on death of player:
  308. if {party.%attacker%} is set:
  309. if attacker is a player:
  310. add 1 to {pkills.%{party.%attacker%}%}
  311. loop {party.%{party.%attacker%}%::*}:
  312. send "&e%attacker% killed &b%victim%" to loop-value
  313. send "&e%attacker% killed &b%victim%" to {party.%attacker%} parsed as player
  314. if {party.%victim%} is set:
  315. add 1 to {pdeaths.%{party.%victim%}%}
  316. if attacker is a player:
  317. loop {party.%{party.%victim%}%::*}:
  318. send "&e%victim% was killed by &b%attacker%" to loop-value
  319. send "&e%victim% was killed by &b%attacker%" to {party.%victim%} parsed as player
  320. on damage:
  321. if {party.%victim%} is {party.%attacker%}:
  322. cancel event
  323. send "&cYou cannot attack members of your party" to attacker
  324. on chat:
  325. if {pchat.%player%} is true:
  326. cancel event
  327. if {party.%player%} is player:
  328. loop {party.%player%::*}:
  329. send "&8[&eP&bC&8] &c%player%: &a%message%" to loop-value
  330. send "&8[&eP&bC&8] &c%player%: &a%message%"
  331. else:
  332. loop {party.%{party.%player%}%::*}:
  333. send "&8[&eP&bC&8] &c%player%: &a%message%" to loop-value
  334. send "&8[&eP&bC&8] &c%player%: &a%message%" to {party.%player%} parsed as player
  335. else if {@Chatformatting} is true:
  336. if {party.%player%} is set:
  337. cancel event
  338. broadcast "&8[&e%{pname.%{party.%player%}%}%&8] &b%player%: &f%message%"
  339. else:
  340. cancel event
  341. broadcast "&8[&e-&8] &b%player%: &f%message%"
  342. every 10 seconds:
  343. if {@Autoupdate} is true:
  344. if text from "http://pastebin.com/raw/LC5sZnHX" is not "{@Version}":
  345. download from "http://pastebin.com/raw/gW86usfV" to "plugins/Skript/scripts/PremiumPartyEn.sk"
  346. wait 5 ticks
  347. execute console command "/skript reload PremiumPartyEn"
  348. wait 5 ticks
  349. loop all players:
  350. if loop-player is op:
  351. send "&e&lUpdated PremiumParty To Version 1.4" to loop-player
  352. send "&bUpdate the options section if needed!" to loop-player
  353. send "&aPlease report bugs if found!" to loop-player
Add Comment
Please, Sign In to add comment