Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /maintenance [<text>] [<offline player>]:
- aliases: /maint, /mt
- permission: user.maintenance
- permission message: &cYou do not have permission to use this command
- trigger:
- if {maintenance::toggle} isn't set:
- set {maintenance::toggle} to false
- if arg 1 is "help":
- send "&0" to player
- send "&6/maintenance (list|add|remove) <player>" to player
- send "&6/maintenance (on|off)" to player
- send "&0" to player
- else if arg 1 is "list":
- send "&6Maintenance count; (%size of {maintenance::list.bypass::*}%&6)" to player
- send "&6Maintenance list; %{maintenance::list.bypass::*}%" to player
- else if arg 1 is "add":
- if arg 2 is set:
- if {maintenance::list.bypass::*} doesn't contain arg 2:
- add arg 2 to {maintenance::list.bypass::*}
- send "&6You've added %arg 2%&6 to the maintenance bypass list." to player
- else:
- send "&c%arg 2%&c is already on the maintenance bypass list." to player
- else:
- send "&cMissing arg! Try /maintenance add <player>" to player
- else if arg 1 is "remove":
- if arg 2 is set:
- if {maintenance::list.bypass::*} contains arg 2:
- remove arg 2 from {maintenance::list.bypass::*}
- send "&6You've removed %arg 2%&6 to the maintenance bypass list." to player
- else:
- send "&c%arg 2%&c is not on the maintenance bypass list." to player
- else:
- send "&cMissing arg! Try /maintenance remove <player>" to player
- else if arg 1 is "on":
- if {maintenance::toggle} = false:
- set {maintenance::toggle} to true
- broadcast "&6%player% activated maintenance."
- loop all players:
- loop-player doesn't have permission "user.maintenance.bypass"
- {maintenance::list.bypass::*} doesn't contain loop-player
- kick loop-player due to "&cServer is in maintenance! Join back later."
- else:
- send "&cMaintenance is already activated." to player
- else if arg 1 is "off":
- if {maintenance::toggle} = true:
- set {maintenance::toggle} to false
- broadcast "&6%player% deactivated maintenance."
- else:
- send "&cMaintenance is already deactivated." to player
- else:
- send "&6Try /maintenance help for more info." to player
- on join:
- if {maintenance::toggle} = true:
- player doesn't have permission "user.maintenance.bypass"
- {maintenance::list.bypass::*} doesn't contain player
- kick player due to "&cServer is in maintenance! Join back later."
- set the join message to "&e- &r%player%&7 tried to join but the server is in maintenance."
- else:
- set the join message to "&a> &r%player's prefix%%player%%player's suffix%"
- on quit:
- if {maintenance::toggle} = true:
- player doesn't have permission "user.maintenance.bypass"
- {maintenance::list.bypass::*} doesn't contain player
- set the quit message to ""
- else:
- set the quit message to "&c< &r%player's display name%%player's suffix%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement