Staff Pick: Maintenance Manager
By
STiCoryCreated: 2015/01/13 17:58:13 UTC-08:00 (9 years and 345 days ago)
Edited: 2016/01/20 20:08:28 UTC-08:00 (8 years and 338 days ago)
Likes: 0
Staff pick as of: 2015/02/03 18:33:33 UTC-08:00 (9 years and 324 days ago)
Denizen Version: 0.9.7-SNAPSHOT (build 1606)
Script Version: 1.1
Description:
A script that doesn't allow players to login when maintenance mode is enabled.
To setup, simply add the permission denizen.maintenance to the groups that you want to be able to toggle the maintenance mode, and denizen.maintenance.bypass to the groups that you want to be able to login regardless of the maintenance mode. For instance I gave both permissions to the same groups as I feel if they can run the command, they should have the power to be able to bypass it, but your server may be different!
To use, simply run the command /maintenance
Download script |
View raw scriptmaintnenace_kick:
type: world
debug: false
events:
on player join:
#Add the permission denizen.maintenance.bypass to those who you want to log in regardless of maintenance mode
- if <player.is_op> && <server.has_flag[maintenance]> {
- wait 1
- narrate "<&4>Maintenance mode is currently enabled."
- queue clear
}
else if <player.has_permission[denizen.maintenance.bypass]> && <server.has_flag[maintenance]> {
- wait 1
- narrate "<&4>Maintenance mode is currently enabled."
- queue clear
}
else if <server.has_flag[maintenance]> {
- wait 10t
- execute as_server "kick <player.name> Sorry, undergoing maintenance, check back later, or check with us on facebook.com/impracticalcraft!"
- queue clear
}
maintenance_command:
type: command
debug: false
name: maintenance
description: Toggle maintenance mode
usage: /maintenance
permission: denizen.maintenance
permission message: "<&c>Sorry you don't have the Denizen command permission."
allowed help:
- determine <player.has_permission[denizen.maintenance]>
script:
#Add the permission denizen.maintenance to your permissions file if you want them to be able to use /maintenance
- if !<player.has_permission[denizen.maintenance]||<context.server>> {
- narrate "Sorry you don't have the Denizen command permission."
- queue clear
}
else if !<server.has_flag[maintenance]> {
- flag server maintenance
- narrate "<&4>Maintenance mode enabled!"
- queue clear
}
else if <server.has_flag[maintenance]> {
- flag server maintenance:!
- narrate "<&2>Maintenance mode disabled!"
- queue clear
}
View History