Date: 2017/09/01 14:20:00 UTC-07:00
Type: Denizen 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#######################################################
## Nations Command ##
#######################################################
NATIONS_FILE_LOADER:
type: world
debug: false
events:
on server start:
- foreach <li@ek|fn|wt|nat|eat|sat|wat|bht|bhs|sw|fst> { - yaml "load:/dNations/<def[value]>.yml" id:<def[value]>}
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 dNations_Apps
}
else {
- narrate "<&c>You have no pending applications!"
}
}
else {
- narrate "<&c>You do not have permission to check nation apps!"
}
dNations_Apps:
type: task
script:
- choose "<context.args.size>":
- case "2":
- if <yaml[<player.flag[nation]>].list_keys[pending_apps].contains[<context.args.get[2]>]> {
- narrate "<&5>-------------------------"
- narrate "<&d> <context.args.get[2]>'s Application"
- narrate "<&5>-------------------------"
- narrate "<&5>Character: <&d><player.flag[charname]>"
- narrate "<&5>Gender: <&d><player.flag[gender]||Genderless>"
- narrate "<&5>Element: <&d><player.flag[element]>"
- narrate "<&5>Joined at: <&d><player.flag[jointime]> on <player.flag[joindate]>"
- narrate "<&5>Last Seen at: <&d><player.flag[seentime]> on <player.flag[seendate]>"
}
else {
- narrate "<&c>You do not have a pending app from that player!"
}
- case "3":
- choose <context.args.get[3]>:
- case "accept":
- yaml id:<player.flag[nation]> set pending_apps.<player.flag[nation]>:!
- flag <player.flag[nation]> nation:<player.flag[nation]>
- execute as_player "mail send <context.args.get[2]> Your app has been Accepted!"
- case "deny":
- yaml id:<player.flag[nation]> set pending_apps.<player.flag[nation]>:
- execute as_player "mail send <context.args.get[2]> Your app has been Rejected!"
- default:
- narrate "<&c>That is not a valid dNations apps command!"
- default:
- narrate "<&5>You have pending apps from:"
- foreach <yaml[<player.flag[nation]>].list_keys[pending_apps]> { - narrate "<&d>- <def[value]>"}