nyaago50000

Untitled

Mar 6th, 2018
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.35 KB | None | 0 0
  1. options:
  2. prefix: &8[&cPunish&aSK&8] &e
  3. input_time: 10 # in seconds
  4.  
  5. command /tempban <offline player> <integer> <text>:
  6. permission: punish.tempban
  7. usage: /tempban <player> <timespan> <reason>
  8. trigger:
  9. set {_a3::*} to arg-3 split at " "
  10. set {_t} to {_a3::1}
  11. delete {_a3::1}
  12. set {_a3::*} to {_a3::*}
  13. if {_a3::*} is not set:
  14. message "{@prefix}Please specify a reason!"
  15. stop
  16. set {_reason} to join {_a3::*} with " "
  17. set {_time} to "%arg-2% %{_t}%" parsed as a timespan
  18. if {_time} is not set:
  19. message "{@prefix}That is not a valid timespan!"
  20. stop
  21. set {_until} to now
  22. add {_time} to {_until}
  23. set {punishments::banned::%arg-1%} to {_reason}
  24. set {punishments::banned::%arg-1%::until} to {_until}
  25. set {punishments::banned::%arg-1%::time} to {_time}
  26. set {punishments::banned::%arg-1%::bannedon} to now
  27. kick arg-1 due to "{@prefix}%nl%%nl%&cYou are temporary banned for &a%{_time}% &cfrom this server!%nl%%nl%&eReason: &a%colored {_reason}%%nl%&eBanned on &a%now% &euntil &a%{_until}%"
  28. message "{@prefix}Banned &a%arg-1% &edue to &a%{_reason}% &efor &a%{_time}%"
  29.  
  30. on connect:
  31. if {punishments::banned::%player%::until} <= now:
  32. delete {punishments::banned::%player%}
  33. delete {punishments::banned::%player%::until}
  34. delete {punishments::banned::%player%::time}
  35. stop
  36. {punishments::banned::%player%} is set
  37. set {_reason} to {punishments::banned::%player%}
  38. set {_until} to {punishments::banned::%player%::until}
  39. set {_time} to {punishments::banned::%player%::time}
  40. set {_bannedon} to {punishments::banned::%player%::bannedon}
  41. set {_timeremaining} to difference between {_until} and now
  42. kick player due to "{@prefix}%nl%%nl%&cYou are temporary banned for &a%{_timeremaining}% &cfrom this server!%nl%%nl%&eReason: &a%colored {_reason}%%nl%&eBanned on &a%{_bannedon}% &euntil &a%{_until}%"
  43.  
  44. command /unban <offline player>:
  45. permission: punish.unban
  46. usage: /unban <player>
  47. trigger:
  48. if {punishments::banned::%arg-1%} is set:
  49. delete {punishments::banned::%arg-1%}
  50. delete {punishments::banned::%arg-1%::until}
  51. delete {punishments::banned::%arg-1%::time}
  52. delete {punishments::permbanned::%arg-1%}
  53. message "{@prefix}Unbanned %arg-1%"
  54. stop
  55. if {punishments::permbanned::%arg-1%} is set:
  56. delete {punishments::banned::%arg-1%}
  57. delete {punishments::banned::%arg-1%::until}
  58. delete {punishments::banned::%arg-1%::time}
  59. delete {punishments::permbanned::%arg-1%}
  60. message "{@prefix}Unbanned %arg-1%"
  61. stop
  62. message "{@prefix}That player isn't banned!"
  63.  
  64. command /ban [<offline player>] [<text>]:
  65. permission: punish.ban
  66. aliases: /permban
  67. usage: /ban <player> <reason>
  68. trigger:
  69. if arg 1 is not set:
  70. message "{@prefix}Please specify a player!"
  71. stop
  72. if arg 2 is not set:
  73. message "{@prefix}Please specify a reason!"
  74. stop
  75. set {punishments::permbanned::%arg-1%} to arg-2
  76. kick arg-1 due to "{@prefix}%nl%%nl%&cYou are permanently banned from this server due to &a%arg-2%&c!"
  77. message "{@prefix}Banned %arg-1% due to %arg-2%"
  78.  
  79. on connect:
  80. {punishments::permbanned::%player%} is set
  81. kick player due to "{@prefix}%nl%%nl%&cYou are permanently banned from this server due to &a%{punishments::permbanned::%player%}%&c!"
  82.  
  83. command /mute [<offline player>] [<text>]:
  84. permission: punish.mute
  85. aliases: /permmute
  86. usage: /mute <player> <reason>
  87. trigger:
  88. if arg 1 is not set:
  89. message "{@prefix}Please specify a player!"
  90. stop
  91. if arg 2 is not set:
  92. message "{@prefix}Please specify a reason!"
  93. stop
  94. set {punishments::permmuted::%arg-1%} to arg-2
  95. send "{@prefix}&cYou have been permanently muted due to &a%arg-2%&c!" to arg-1
  96. message "{@prefix}Muted %arg-1% due to %arg-2%"
  97.  
  98. on chat:
  99. {punishments::permmuted::%player%} is set
  100. send "{@prefix}&cYou have been permanently muted due to &a%{punishments::permmuted::%player%}%&c!" to player
  101. cancel event
  102.  
  103. on connect:
  104. {punishments::permbanned::%player%} is set
  105. kick player due to "{@prefix}%nl%%nl%&cYou are permanently banned from this server due to &a%{punishments::permbanned::%player%}%&c!"
  106.  
  107. command /unmute <offline player>:
  108. permission: punish.unmute
  109. usage: /unmute <player>
  110. trigger:
  111. if {punishments::tempmuted::%arg-1%} is set:
  112. delete {punishments::tempmuted::%arg-1%}
  113. delete {punishments::tempmuted::%arg-1%::until}
  114. delete {punishments::tempmuted::%arg-1%::time}
  115. delete {punishments::permmuted::%arg-1%}
  116. message "{@prefix}Unmuted %arg-1%"
  117. stop
  118. if {punishments::permmuted::%arg-1%} is set:
  119. delete {punishments::tempmuted::%arg-1%}
  120. delete {punishments::tempmuted::%arg-1%::until}
  121. delete {punishments::tempmuted::%arg-1%::time}
  122. delete {punishments::permmuted::%arg-1%}
  123. message "{@prefix}Unmuted %arg-1%"
  124. stop
  125. message "{@prefix}That player isn't muted!"
  126.  
  127. command /tempmute <offline player> <integer> <text>:
  128. permission: punish.tempmute
  129. usage: /tempmute <player> <timespan> <reason>
  130. trigger:
  131. set {_a3::*} to arg-3 split at " "
  132. set {_t} to {_a3::1}
  133. delete {_a3::1}
  134. set {_a3::*} to {_a3::*}
  135. if {_a3::*} is not set:
  136. message "{@prefix}Please specify a reason!"
  137. stop
  138. set {_reason} to join {_a3::*} with " "
  139. set {_time} to "%arg-2% %{_t}%" parsed as a timespan
  140. if {_time} is not set:
  141. message "{@prefix}That is not a valid timespan!"
  142. stop
  143. set {_until} to now
  144. add {_time} to {_until}
  145. set {punishments::tempmuted::%arg-1%} to {_reason}
  146. set {punishments::tempmuted::%arg-1%::until} to {_until}
  147. set {punishments::tempmuted::%arg-1%::time} to {_time}
  148. set {punishments::tempmuted::%arg-1%::mutedon} to now
  149. send "{@prefix}&cYou have been temporary muted for &a%{_time}%&c!" to arg-1
  150. send "{@prefix}Reason: &a%colored {_reason}%" to arg-1
  151. send "{@prefix}Muted on &a%now% &euntil &a%{_until}%" to arg-1
  152. message "{@prefix}Muted &a%arg-1% &edue to &a%{_reason}% &efor &a%{_time}%"
  153.  
  154. on chat:
  155. if {punishments::tempmuted::%player%::until} <= now:
  156. delete {punishments::tempmuted::%player%}
  157. delete {punishments::tempmuted::%player%::until}
  158. delete {punishments::tempmuted::%player%::time}
  159. stop
  160. {punishments::tempmuted::%player%} is set
  161. cancel event
  162. set {_reason} to {punishments::tempmuted::%player%}
  163. set {_until} to {punishments::tempmuted::%player%::until}
  164. set {_time} to {punishments::tempmuted::%player%::time}
  165. set {_mutedon} to {punishments::tempmuted::%player%::mutedon}
  166. set {_timeremaining} to difference between {_until} and now
  167. message "{@prefix}&cYou have been temporary muted for &a%{_timeremaining}%&c!"
  168. message "{@prefix}Reason: &a%colored {_reason}%"
  169. message "{@prefix}Muted on &a%{_mutedon}% &euntil &a%{_until}%"
  170.  
  171. command /punish [<text>]:
  172. permission: punish.command
  173. trigger:
  174. if arg-1 is not set:
  175. punishSelectPlayer(1, player)
  176. stop
  177. set {_split::*} to split arg-1 at " "
  178. set {_p} to {_split::1} parsed as a offline player
  179. set {_t} to "%{_split::2}%"
  180. if {_t} is set:
  181. {_t} is not "<none>"
  182. if {_t} is "tempmute":
  183. punishSelectTimespan(player, 1 day, {_p}, "tempmute")
  184. if {_t} is "mute":
  185. set {punishments::inputreason::%player%} to true
  186. message "{@prefix}You have {@input_time} seconds to input the reason in chat!"
  187. set {_times} to {@input_time} * 10
  188. loop {_times} times:
  189. if {punishments::inputreason::%player%} is not true:
  190. if {punishments::inputreason::%player%} is "cancel":
  191. delete {punishments::inputreason::%player%}
  192. message "{@prefix}Cancelled punish!"
  193. stop
  194. make player execute command "/mute %{_p}% %{punishments::inputreason::%player%}%"
  195. delete {punishments::inputreason::%player%}
  196. stop
  197. wait 0.1 second
  198. delete {punishments::inputreason::%player%}
  199. message "{@prefix}Time up! Please start again if you wish to preceed the punish."
  200. stop
  201. if {_t} is "tempban":
  202. punishSelectTimespan(player, 1 day, {_p}, "tempban")
  203. if {_t} is "ban":
  204. set {punishments::inputreason::%player%} to true
  205. message "{@prefix}You have {@input_time} seconds to input the reason in chat!"
  206. set {_times} to {@input_time} * 10
  207. loop {_times} times:
  208. if {punishments::inputreason::%player%} is not true:
  209. if {punishments::inputreason::%player%} is "cancel":
  210. delete {punishments::inputreason::%player%}
  211. message "{@prefix}Cancelled punish!"
  212. stop
  213. make player execute command "/ban %{_p}% %{punishments::inputreason::%player%}%"
  214. delete {punishments::inputreason::%player%}
  215. stop
  216. wait 0.1 second
  217. delete {punishments::inputreason::%player%}
  218. message "{@prefix}Time up! Please start again if you wish to preceed the punish."
  219. stop
  220. stop
  221. open chest with 3 rows named "{@prefix}Punish %{_p}%" to player
  222. wait 1 tick
  223. format slot 10 of player with book named "&eTemporary mute" to close then run [make player execute command "/punish %{_p}% tempmute"]
  224. format slot 12 of player with book named "&ePermanent mute" to close then run [make player execute command "/punish %{_p}% mute"]
  225. format slot 14 of player with barrier named "&eTemporary ban" to close then run [make player execute command "/punish %{_p}% tempban"]
  226. format slot 16 of player with barrier named "&ePermanent ban" to close then run [make player execute command "/punish %{_p}% ban"]
  227.  
  228. function punishSelectTimespan(p: player, t: timespan, p2: player, text: text):
  229. wait 1 tick
  230. if "%{_text}%" is "done_tempmute":
  231. set {punishments::inputreason::%{_p}%} to true
  232. send "{@prefix}You have {@input_time} seconds to input the reason in chat!" to {_p}
  233. set {_times} to {@input_time} * 10
  234. loop {_times} times:
  235. if {punishments::inputreason::%{_p}%} is not true:
  236. if {punishments::inputreason::%{_p}%} is "cancel":
  237. delete {punishments::inputreason::%{_p}%}
  238. send "{@prefix}Cancelled punish!" to {_p}
  239. stop
  240. make {_p} execute command "/tempmute %{_p2}% %{_t}% %{punishments::inputreason::%{_p}%}%"
  241. delete {punishments::inputreason::%{_p}%}
  242. stop
  243. wait 0.1 second
  244. delete {punishments::inputreason::%{_p}%}
  245. send "{@prefix}Time up! Please start again if you wish to preceed the punish." to {_p}
  246. stop
  247. if "%{_text}%" is "done_tempban":
  248. set {punishments::inputreason::%{_p}%} to true
  249. send "{@prefix}You have {@input_time} seconds to input the reason in chat!" to {_p}
  250. set {_times} to {@input_time} * 10
  251. loop {_times} times:
  252. if {punishments::inputreason::%{_p}%} is not true:
  253. if {punishments::inputreason::%{_p}%} is "cancel":
  254. delete {punishments::inputreason::%{_p}%}
  255. send "{@prefix}Cancelled punish!" to {_p}
  256. stop
  257. make {_p} execute command "/tempban %{_p2}% %{_t}% %{punishments::inputreason::%{_p}%}%"
  258. delete {punishments::inputreason::%{_p}%}
  259. stop
  260. wait 0.1 second
  261. delete {punishments::inputreason::%{_p}%}
  262. send "{@prefix}Time up! Please start again if you wish to preceed the punish." to {_p}
  263. stop
  264. if inventory name of {_p}'s current inventory does not contain "&eDuration:":
  265. close {_p}'s inventory
  266. wait 1 tick
  267. open chest with 5 rows named "&eDuration: %{_t}%" to {_p}
  268. set inventory name of {_p}'s current inventory to "&eDuration: %{_t}%"
  269. wait 1 tick
  270. format slot 18 of {_p} with stained glass pane:5 named "&aAdd 1 hour" to run [set {_ts} to {_t}] -> [add 1 hour to {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  271. format slot 19 of {_p} with stained glass pane:5 named "&aAdd 12 hours" to run [set {_ts} to {_t}] -> [add 12 hours to {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  272. format slot 20 of {_p} with stained glass block:5 named "&aAdd 1 day" to run [set {_ts} to {_t}] -> [add 1 day to {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  273. format slot 21 of {_p} with stained glass block:5 named "&aAdd 7 days" to run [set {_ts} to {_t}] -> [add 7 days to {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  274. format slot 23 of {_p} with stained glass block:14 named "&cRemove 7 days" to run [set {_ts} to {_t}] -> [remove 7 days from {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  275. format slot 24 of {_p} with stained glass block:14 named "&cRemove 1 day" to run [set {_ts} to {_t}] -> [remove 1 day from {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  276. format slot 25 of {_p} with stained glass pane:14 named "&cRemove 12 hours" to run [set {_ts} to {_t}] -> [remove 12 hours from {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  277. format slot 26 of {_p} with stained glass pane:14 named "&cRemove 1 hour" to run [set {_ts} to {_t}] -> [remove 1 hour from {_ts}] -> [punishSelectTimespan({_p}, {_ts}, {_p2}, {_text})]
  278. format slot 39 of {_p} with wool:5 named "&aDone" to close then run [punishSelectTimespan({_p}, {_t}, {_p2}, "done_%{_text}%")]
  279. format slot 41 of {_p} with wool:14 named "&cCancel" to close
  280.  
  281. on chat:
  282. {punishments::inputreason::%player%} is true
  283. cancel event
  284. set {punishments::inputreason::%player%} to message
  285.  
  286. function punishSelectPlayer(n: integer=1, p: player):
  287. set {_list::*} to all players
  288. set {_n2} to {_n}
  289. set {_page::rows} to 6
  290. set {_page::max} to {_n2} * (({_page::rows} - 1) * 9)
  291. set {_page::min} to ({_n2} - 1) * (({_page::rows} - 1) * 9)
  292. set {_page::posts} to 0
  293. set {_page::count} to 0
  294. set {_page::number} to {_n2}
  295. set {_pages} to size of {_list::*} / (({_page::rows} - 1) * 9)
  296. set {_pages} to "%{_pages}%"
  297. set {_pages::*} to {_pages} split at "."
  298. set {_page::total} to {_pages::1}
  299. if {_pages::2} is set:
  300. set {_page::total} to {_page::total} parsed as an integer
  301. add 1 to {_page::total}
  302. if inventory name of {_p}'s current inventory does not contain "&8GUI | ":
  303. open chest with {_page::rows} rows named "&8GUI | %{_page::number}%/%{_page::total}%" to {_p}
  304. else:
  305. loop ({_page::rows} * 9) times:
  306. set slot (loop-number - 1) of {_p}'s current inventory to air
  307. set inventory name of {_p}'s current inventory to "&8GUI | %{_page::number}%/%{_page::total}%"
  308. if {_page::number} is greater than 1:
  309. set slot (({_page::rows} - 1) * 9) of {_p}'s current inventory to piston named "&dPrevious Page"
  310. loop {_list::*}:
  311. if {_page::count} is less than {_page::max}:
  312. if {_page::count} is greater than or equal to {_page::min}:
  313. set slot {_page::posts} of {_p}'s current inventory to loop-value's skull with lore "&7Click to select" named "&b%loop-value%"
  314. add 1 to {_page::posts}
  315. add 1 to {_page::count}
  316. if {_page::number} is less than {_page::total}:
  317. set slot ({_page::rows} * 9 - 1) of {_p}'s current inventory to piston named "&dNext Page"
  318.  
  319. on inventory click:
  320. if inventory name of player's current inventory contains "&8GUI | ":
  321. cancel the event
  322. set {_page::rows} to 3
  323. set {_page} to "%inventory name of player's current inventory%"
  324. replace all "&8GUI | " in {_page} with ""
  325. set {_pages::*} to {_page} split at "/"
  326. if clicked slot is (({_page::rows} - 1) * 9):
  327. if name of clicked item is "&dPrevious Page":
  328. if {_pages::1} parsed as an integer is greater than 1:
  329. punishSelectPlayer({_pages::1} parsed as an integer - 1, player)
  330. else:
  331. close inventory of player
  332. send "You are already on the first page."
  333. else if clicked slot is ({_page::rows} * 9 - 1):
  334. if name of clicked item is "&dNext Page":
  335. punishSelectPlayer({_pages::1} parsed as an integer + 1, player)
  336. if lore of clicked item is "&7Click to select":
  337. set {_p} to uncolored name of clicked item parsed as a player
  338. close player's inventory
  339. wait 2 ticks
  340. execute player command "/punish %{_p}%"
Add Comment
Please, Sign In to add comment