Advertisement
Rylens

Rylen | maintenance skript

Sep 16th, 2020
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. command /maintenance [<text>] [<offline player>]:
  2. aliases: /maint, /mt
  3. permission: user.maintenance
  4. permission message: &cYou do not have permission to use this command
  5. trigger:
  6. if {maintenance::toggle} isn't set:
  7. set {maintenance::toggle} to false
  8. if arg 1 is "help":
  9. send "&0" to player
  10. send "&6/maintenance (list|add|remove) <player>" to player
  11. send "&6/maintenance (on|off)" to player
  12. send "&0" to player
  13. else if arg 1 is "list":
  14. send "&6Maintenance count; (%size of {maintenance::list.bypass::*}%&6)" to player
  15. send "&6Maintenance list; %{maintenance::list.bypass::*}%" to player
  16. else if arg 1 is "add":
  17. if arg 2 is set:
  18. if {maintenance::list.bypass::*} doesn't contain arg 2:
  19. add arg 2 to {maintenance::list.bypass::*}
  20. send "&6You've added %arg 2%&6 to the maintenance bypass list." to player
  21. else:
  22. send "&c%arg 2%&c is already on the maintenance bypass list." to player
  23. else:
  24. send "&cMissing arg! Try /maintenance add <player>" to player
  25. else if arg 1 is "remove":
  26. if arg 2 is set:
  27. if {maintenance::list.bypass::*} contains arg 2:
  28. remove arg 2 from {maintenance::list.bypass::*}
  29. send "&6You've removed %arg 2%&6 to the maintenance bypass list." to player
  30. else:
  31. send "&c%arg 2%&c is not on the maintenance bypass list." to player
  32. else:
  33. send "&cMissing arg! Try /maintenance remove <player>" to player
  34. else if arg 1 is "on":
  35. if {maintenance::toggle} = false:
  36. set {maintenance::toggle} to true
  37. broadcast "&6%player% activated maintenance."
  38. loop all players:
  39. loop-player doesn't have permission "user.maintenance.bypass"
  40. {maintenance::list.bypass::*} doesn't contain loop-player
  41. kick loop-player due to "&cServer is in maintenance! Join back later."
  42. else:
  43. send "&cMaintenance is already activated." to player
  44. else if arg 1 is "off":
  45. if {maintenance::toggle} = true:
  46. set {maintenance::toggle} to false
  47. broadcast "&6%player% deactivated maintenance."
  48. else:
  49. send "&cMaintenance is already deactivated." to player
  50. else:
  51. send "&6Try /maintenance help for more info." to player
  52. on join:
  53. if {maintenance::toggle} = true:
  54. player doesn't have permission "user.maintenance.bypass"
  55. {maintenance::list.bypass::*} doesn't contain player
  56. kick player due to "&cServer is in maintenance! Join back later."
  57. set the join message to "&e- &r%player%&7 tried to join but the server is in maintenance."
  58. else:
  59. set the join message to "&a> &r%player's prefix%%player%%player's suffix%"
  60. on quit:
  61. if {maintenance::toggle} = true:
  62. player doesn't have permission "user.maintenance.bypass"
  63. {maintenance::list.bypass::*} doesn't contain player
  64. set the quit message to ""
  65. else:
  66. set the quit message to "&c< &r%player's display name%%player's suffix%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement