Zeldaboy111

Warnings ]|[ Skript #305

Apr 23rd, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. options:
  2. logo: &c&lPunishment &8►&7
  3.  
  4. function checkBan(p: Player):
  5. if {ban.%{_p}%} is set:
  6. set {_difference} to difference between now and {ban.%{_p}%}
  7. if {_difference} > {ban.%{_p}%.time}:
  8. delete {ban.%{_p}%.time}
  9. delete {ban.%{_p}%.unban}
  10. delete {ban.%{_p}%}
  11.  
  12. function checkWarnings(p: Player):
  13. if {warnings.%{_p}%.amountActive} >= 1:
  14. loop {warnings.%{_p}%.warnNumber::*}:
  15. set {_difference} to difference between now and {warnings.%{_p}%.warnedAt::%loop-value%}
  16. if {_difference} > {warnings.%{_p}%.duration::%loop-value%}:
  17. delete {warnings.%{_p}%.warnNumber::%loop-value%}
  18. delete {warnings.%{_p}%.warnedAt::%loop-value%}
  19. delete {warnings.%{_p}%.duration::%loop-value%}
  20. remove 1 from {warnings.%{_p}%.amountActive}
  21.  
  22.  
  23. command /punish [<text>]:
  24. aliases: /pu
  25. trigger:
  26. if player has permission "rank.helper":
  27. if arg-1 is set:
  28. if arg-1 parsed as a player is set:
  29. set {_t} to arg-1 parsed as a player
  30. open chest with 6 rows named "Punish %{_t}%" to player
  31.  
  32. set slot 19 of player's current inventory to paper named "&aWarn" with lore "", "&7Click to Warn %{_t}%", "" and "&8(&2Helper&8)"
  33. set slot 20 of player's current inventory to stone sword named "&cClient Modifications" with lore "", "&7Click to Ban %{_t}%", "&7for &oClient Modifications", "" and "&8(&2Helper&8)" without any NBT
  34.  
  35.  
  36. else:
  37. send "{@logo} The player &c%arg-1% &7is not found."
  38. else:
  39. send "{@logo} You have to give up a &cplayer &7to punish."
  40.  
  41. command /warn <player>:
  42. trigger:
  43. send "{@logo} You have warned %arg-1%&7."
  44. send "{@logo} You have been warned." to arg-1
  45. if {warnings.%arg-1%.amount} is not set:
  46. set {warnings.%arg-1%.amount} to 0
  47.  
  48. add 1 to {warnings.%arg-1%.amount}
  49. add 1 to {warnings.%arg-1%.amountActive}
  50. set {warnings.%arg-1%.warnedAt::%{warnings.%arg-1%.amount}%} to now
  51. set {warnings.%arg-1%.duration::%{warnings.%arg-1%.amount}%} to 10 seconds
  52. set {warnings.%arg-1%.warnNumber::%{warnings.%arg-1%.amount}%} to {warnings.%arg-1%.amount}
  53.  
  54.  
  55. command /checkoffenses [<text>]:
  56. aliases: /checkoff
  57. trigger:
  58. if player has permission "rank.helper":
  59. if arg-1 is set:
  60. if arg-1 parsed as a player is set:
  61. set {_t} to arg-1 parsed as a player
  62. send "&8&m &8[ &cOFFENSESES &8]&8&m "
  63. send " "
  64. send "&7User&8: &c%{_t}%"
  65. checkBan({_t})
  66. if {ban.%{_t}%} is set:
  67. send "&7Active Ban&8: &7%{ban.%{_t}%.reason}%"
  68. send "&7Total Ban Length&8: &7%{ban.%{_t}%.time}%"
  69. send "&7Banned At&8: &7%{ban.%{_t}%}%"
  70. send "&7Unban at&8: &7%{ban.%{_t}%.unban}%"
  71.  
  72. else:
  73. send "&7Active Ban&8: &7None"
  74.  
  75. checkWarnings({_t})
  76. send "&7Total Warnings&8: &7%{warnings.%{_t}%.amount}%"
  77. if {warnings.%{_t}%.amountActive} >= 1:
  78. send "&7Active Warnings&8: &7%{warnings.%{_t}%.amountActive}%"
  79.  
  80. else:
  81. send "&7Active Warnings&8: &7None"
  82.  
  83.  
  84. send " "
  85. send "&8&m &8[ &cOFFENSESE &8]&8&m "
  86.  
  87. else:
  88. send "{@logo} The player &c%arg-1% &7is not found."
  89. else:
  90. send "{@logo} You have to give up a &cplayer &7to check it's offenses."
  91.  
  92. on connect:
  93. if {ban.%player%} is set:
  94. checkBan(player)
  95.  
  96. if {ban.%player%.time} is set:
  97. kick player due to "BANNED"
  98.  
  99. if {warnings.%player%.amount} is not set:
  100. set {warnings.%player%.amount} to 0
  101.  
  102. if {warnings.%player%.amountActive} is not set:
  103. set {warnings.%player%.amountActive} to 0
  104.  
  105. on quit:
  106. if {ban.%player%} is set:
  107. set quit message to ""
  108.  
  109. on inventory click:
  110. if type of clicked inventory is chest inventory:
  111. if inventory name of player's current inventory starts with "Punish ":
  112. cancel event
  113. set {_name::*} to inventory name of player's current inventory split at " "
  114. set {_target} to {_name::2}
  115. set {_target} to {_target} parsed as an offline player
  116.  
  117. if clicked slot is 19:
  118.  
  119.  
  120. else if clicked slot is 20:
  121. set {ban.%{_target}%} to now
  122. set {ban.%{_target}%.unban} to now
  123. set {ban.%{_target}%.time} to 7 seconds
  124. set {ban.%{_target}%.reason} to "&cClient Modifications"
  125.  
  126. add {ban.%{_target}%.time} to {ban.%{_target}%.unban}
  127. close player's inventory
  128. send "{@logo} You have banned &c%{_target}% &7for &c%{ban.%{_target}%.time}%&7. &8(&c%{ban.%{_target}%.reason}%&8)"
  129. kick {_target} due to "&9&lBANNED%nl%&cClient Modifications%nl%%nl%&7Banned at&8: &7%{ban.%{_target}%}%%nl%&7Unban at&8: &7%{ban.%{_target}%.unban}%"
Add Comment
Please, Sign In to add comment