- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Maintenance Manager


By STiCory
Created: 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 script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
4900

maintnenace_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