akon1248

Ban

Mar 21st, 2019
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.09 KB | None | 0 0
  1. command /ban [<offline player>] [<text>] [<text>] [<text>] [<text>] [<text>] [<text>] [<text>]:
  2. permission: sk.command.ban
  3. permission message: &4このコマンドを実行する権限がありません!
  4. trigger:
  5. if arg-1 is not set:
  6. send "&cUsage: /ban <player> never <reason> OR /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  7. else if arg-1 has not played before:
  8. send "&cプレイヤー%arg-1%はログインしたことがありません!"
  9. else if {ban::%UUID of arg-1%} is 1:
  10. send "&c%arg-1%は既にBANされています!"
  11. else if arg-2 is not set:
  12. send "&cUsage: /ban <player> never <reason> OR /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  13. else if arg-2 is not "never" or "temply":
  14. send "&cUsage: /ban <player> never <reason> OR /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  15. else if arg-2 is "never":
  16. set {ban::%UUID of arg-1%} to 1
  17. set {bandplayername.%UUID of arg-1%} to "%arg-1%"
  18. set {banreason.%UUID of arg-1%} to arg-3
  19. broadcast "&6%player%&eが&6%arg-1%&eをBANしました%nl%&e期限: &7無期限%nl%&e理由: &7%arg-3%"
  20. kick arg-1 due to "&cあなたはBANされています!%nl%&c期限: &7無期限%nl%&c理由: &7%arg-3%"
  21. else if arg-2 is "temply":
  22. if arg-4 is not set:
  23. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  24. else if arg-5 is not set:
  25. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  26. else if arg-6 is not set:
  27. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  28. else if arg-7 is not set:
  29. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  30. else:
  31. set {_days} to arg-4 parsed as integer
  32. set {_hours} to arg-5 parsed as integer
  33. set {_minutes} to arg-6 parsed as integer
  34. set {_seconds} to arg-7 parsed as integer
  35. set {_total} to {_days}*86400+{_hours}*3600+{_minutes}*60+{_seconds}
  36. if {_days} is not set:
  37. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  38. else if {_hours} is not set:
  39. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  40. else if {_minutes} is not set:
  41. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  42. else if {_seconds} is not set:
  43. send "&cUsage: /ban <player> temply <reason> <days> <hours> <minutes> <seconds>"
  44. else if {_days} > 9999:
  45. send "&c入力した数値(%arg-4%)は大きすぎます! 9999以下にしてください"
  46. else if {_hours} > 23:
  47. send "&c入力した数値(%arg-5%)は大きすぎます! 23以下にしてください"
  48. else if {_minutes} > 59:
  49. send "&c入力した数値(%arg-6%)は大きすぎます! 59以下にしてください"
  50. else if {_seconds} > 59:
  51. send "&c入力した数値(%arg-7%)は大きすぎます! 59以下にしてください"
  52. else if {_days} < 0:
  53. send "&c入力した数値(%arg-4%)は小さすぎます! 0以上にしてください"
  54. else if {_hours} < 0:
  55. send "&c入力した数値(%arg-5%)は小さすぎます! 0以上にしてください"
  56. else if {_minutes} < 0:
  57. send "&c入力した数値(%arg-6%)は小さすぎます! 0以上にしてください"
  58. else if {_total} is 0:
  59. send "&c入力した数値(%arg-7%)は小さすぎます! 1以上にしてください"
  60. else if {_total} > 0:
  61. {_seconds} < 0
  62. send "&c入力した数値(%arg-7%)は小さすぎます! 0以上にしてください"
  63. stop
  64. set {ban::%UUID of arg-1%} to 1
  65. set {bandplayername.%UUID of arg-1%} to "%arg-1%"
  66. set {banreason.%UUID of arg-1%} to arg-3
  67. set {unbantime.%UUID of arg-1%} to floor(unix timestamp of now)+{_days}*86400+{_hours}*3600+{_minutes}*60+{_seconds}
  68. set {_banperiod} to "%{unbantime.%UUID of arg-1%}-floor(unix timestamp of now)%" parsed as integer
  69. broadcast "&6%player%&eが&6%arg-1%&eをBANしました%nl%&e期限: &7%getPeriodFromSeconds({_banperiod})%%nl%&e理由: &7%arg-3%"
  70. kick arg-1 due to "&cあなたはBANされています!%nl%&c期限: &7%getPeriodFromSeconds({_banperiod})%%nl%&c理由: &7%arg-3%"
  71. command /unban [<offline player>] [<text>]:
  72. aliases: /pardon
  73. permission: sk.command.ban
  74. permission message: &4このコマンドを実行する権限がありません!
  75. trigger:
  76. if arg-2 is set:
  77. send "&cUsage: /unban <player>"
  78. else if arg-1 is not set:
  79. send "&cUsage: /unban <player>"
  80. else if arg-1 is set:
  81. if {ban::%UUID of arg-1%} is not set:
  82. send "&c%arg-1%はBANされていません!"
  83. else if {ban::%UUID of arg-1%} is 1:
  84. delete {ban::%UUID of arg-1%}
  85. delete {unbantime.%UUID of arg-1%}
  86. delete {bandplayername.%UUID of arg-1%}
  87. send "&6%arg-1%&eのBANを解除しました"
  88. command /banlist:
  89. permission: sk.command.ban
  90. permission message: &4このコマンドを実行する権限がありません!
  91. trigger:
  92. if {ban::*} is not set:
  93. send "&cBANされているプレイヤーはいません"
  94. else if {ban::*} is set:
  95. loop {ban::*}:
  96. if {unbantime.%loop-index%} is set:
  97. set {_banperiod} to "%{unbantime.%loop-index%}-floor(unix timestamp of now)%" parsed as integer
  98. send "&eプレイヤー: &7%{bandplayername.%loop-index%}% &eUUID: &7%loop-index% &e期限: &7%getPeriodFromSeconds({_banperiod})% &e理由: &7%{banreason.%loop-index%}%"
  99. else if {unbantime.%loop-index%} is not set:
  100. send "&eプレイヤー: &7%{bandplayername.%loop-index%}% &eUUID: &7%loop-index% &e期限: &7無期限 &e理由: &7%{banreason.%loop-index%}%"
  101. on connect:
  102. {ban::%UUID of player%} is 1
  103. if {unbantime.%UUID of player%} is set:
  104. set {_banperiod} to "%{unbantime.%UUID of player%}-floor(unix timestamp of now)%" parsed as integer
  105. kick player due to "&cあなたはBANされています!%nl%&c期限: &7%getPeriodFromSeconds({_banperiod})%%nl%&c理由: &7%{banreason.%UUID of player%}%"
  106. else if {unbantime.%UUID of player%} is not set:
  107. kick player due to "&cあなたはBANされています!%nl%&c期限: &7無期限%nl%&c理由: &7%{banreason.%UUID of player%}%"
  108. every second:
  109. loop {ban::*}:
  110. {unbantime.%loop-index%} <= floor(unix timestamp of now)
  111. delete {ban::%loop-index%}
  112. delete {unbantime.%loop-index%}
  113. delete {bandplayername.%loop-index%}
  114. on connect:
  115. {ban::%UUID of player%} is set
  116. {bandplayername.%UUID of player%} is not "%player%"
  117. set {bandplayername.%UUID of player%} to "%player%"
  118. on tab complete:
  119. set {_splits::*} to split event-string by " "
  120. if {_splits::1} is "/ban":
  121. if size of {_splits::*} is 3:
  122. delete completions
  123. add "never" and "temply" to completions
  124. if first 1 characters of {_splits::3} is "t":
  125. delete completions
  126. add "temply" to completions
  127. if first 1 characters of {_splits::3} is "n":
  128. delete completions
  129. add "never" to completions
  130. else if size of {_splits::*} > 3:
  131. cancel event
  132. if {_splits::1} is "/unban":
  133. size of {_splits::*} > 2
  134. cancel event
  135. if {_splits::1} is "/banlist":
  136. size of {_splits::*} > 1
  137. cancel event
Advertisement
Add Comment
Please, Sign In to add comment