Date: 2017/09/01 13:04:32 UTC-07:00
Type: Denizen Script
#######################################################
## Nations Command ##
#######################################################
NATIONS_COMMAND:
type: command
name: nation
aliases:
- n
- nations
script:
- choose "<context.args.get[1]>":
- case "setup":
- foreach <li@ek|fn|wt|nat|eat|sat|wat|bht|bhs|sw|fst> {
- if !<server.has_file[<def[value]>]> {
- yaml create id <def[value]>
- yaml "savefile:/dNations/<def[value]>.yml" id:<def[value]>
- yaml unload id:<def[value]>
}
}
- case "apply":
- if <li@ek|fn|wt|nat|eat|sat|wat|bht|bhs|sw|fst.contains[<context.args.get[2]>]> {
- yaml id:<context.args.get[2]> set pending_apps.<player.name>:true
- narrate "<&a>Your app has been sent!"
}
- case "apps":
- if <player.flag[rank]> == leader {
- if <yaml[<player.flag[nation]>].list_keys[pending_apps]> != null {
- inject locally dNations_Apps
}
else { - narrate "<&c>You have no pending applications!"}
}
else { - narrate "<&c>You do not have permission to check nation apps!"}