Date: 2017/09/10 14:51:41 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
Plot_Config_Events:
type: world
events:
on gm command:
- inject Plot_Config_Gamemode_Command_Check
on gamemode command:
- inject Plot_Config_Gamemode_Command_Check
on survival command:
- inject Plot_Config_Gamemode_Command_Check
on creative command:
- inject Plot_Config_Gamemode_Command_Check
on gm1 command:
- inject Plot_Config_Gamemode_Command_Check
on gm0 command:
- inject Plot_Config_Gamemode_Command_Check
on gms command:
- inject Plot_Config_Gamemode_Command_Check
on gmc command:
- inject Plot_Config_Gamemode_Command_Check
# on player changes gamemode:
# - inject Plot_Config_Gamemode_Command_Check
on plotsquared player enters plotsquaredplot:
- announce "<&7>Test Enter <player.name> <context.plot>" to_ops
- define plot <context.plot>
- if <server.has_flag[Plots.<def[plot]>.Config.lock_gamemode]> {
- inject Plot_Config_Ignore_OwnerTrust_Task
- define gm <server.flag[Plots.<def[plot]>.Config.lock_gamemode]>
- if <player.gamemode> != <def[gm]> {
- flag player Last_Gamemode:<player.gamemode>
- narrate format:util_ff "<&7>Dette plot-gamemode er låst til<&co> <&6><def[gm]>"
- adjust <player> gamemode:Spectator
}
# Deny Gamemode commands
}
on plotsquared player leaves plotsquaredplot:
- announce "<&7>Test Exit <player.name> <context.plot>" to_ops
- if <player.has_flag[Last_Gamemode]> {
- define gm <player.flag[Last_Gamemode]>
- narrate format:util_ff "<&7>Du er blevet sat tilbage til <player.flag[Last_Gamemode]>"
- adjust <player> gamemode:<player.flag[Last_Gamemode]>
- flag player Last_Gamemode:!
}
on player clicks Plot_Config_Item_LockGamemode in Plot_Config_MainMenu:
- determine cancelled passively
# - inventory close d:<context.inventory>
# - execute as_server "plotmines give <player.name> lvl7"
- define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
- narrate "<server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null>"
- if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Survival {
- flag server Plots.<def[plot]>.Config.lock_gamemode:Adventure
}
else if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Adventure {
- flag server Plots.<def[plot]>.Config.lock_gamemode:Spectator
}
else if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Spectator {
- flag server Plots.<def[plot]>.Config.lock_gamemode:!
}
else {
- flag server Plots.<def[plot]>.Config.lock_gamemode:Survival
}
- flag server Plot_Config_Target:<def[plot]>
- inventory open d:in@Plot_Config_MainMenu
on player drags in Plot_Config_MainMenu:
- determine cancelled passively
Plot_Config_Ignore_OwnerTrust_Task:
type: task
script:
# - define plot
- if <def[plot]> == null {
- queue clear
}
- if <def[plot].owners.include[<def[plot].trusted>].contains[<player>]||true> {
- queue clear
}
Plot_Config_Gamemode_Command_Check:
type: task
script:
- define plot <player.location.plotsquared_plot||null>
- inject Plot_Config_Ignore_OwnerTrust_Task
- if <server.has_flag[Plots.<def[plot]>.Config.lock_gamemode]> {
- determine cancelled passively
- narrate format:util_ff "<&c>Dette plot har gamemode låst til <&e><server.flag[Plots.<def[plot]>.Config.lock_gamemode]>"
- narrate format:util_ff "<&7>Hvis du gerne vil ud, så brug <&b>/spawn"
- queue clear
}
Plot_Config_Command:
type: command
name: plotconfig
aliases:
- pconfig
- pmeconfig
- plotcon
- pcon
script:
- inject Plot_Config_OpenMenu
Plot_Config_OpenMenu:
type: task
script:
- define plot <player.location.plotsquared_plot||null>
- if <def[plot]> == null {
- narrate format:util_ff "<&c>Du er ikke på noget plot!"
- queue clear
}
- if <def[plot].owners.include[<def[plot].trusted>].deduplicate.contains[<player>].not||true> {
- narrate format:util_ff "<&c>Du er ikke ejer eller trusted på dette plot!"
- queue clear
}
- flag player Plot_Config_Target:<def[plot]>
- flag server Plot_Config_Target:<def[plot]>
- inventory open d:in@Plot_Config_MainMenu
Plot_Config_MainMenu:
type: inventory
inventory: CHEST
title: <&3>Plot Config
size: 27
definitions:
GM: Plot_Config_Item_LockGamemode
# Cmds: Plot_Config_Item_LockCommands
# Time: Plot_Config_Item_Time
# Weather: Plot_Config_Item_Weather
# NoteBlock: Plot_Config_Item_Music
slots:
- "[] [GM] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
## Lock Gamemode
# Gamemode 0 (Sætter en til spectator hvis gm 1)
# Block /gm
## Lock Commandoer
# Kan ikke bruge kommandoer undtagen whitelisted
# /gm (Gamemode Kommandoer)
# /god
# /fly
# /tpyes/tpa/back/home/thru/top(Teleport Kommandoer) (Compass)
# /item/kit (Spawn item/kits)
# /eec/craft/enderchest (Kister/Craft Kommandoer)
# /ast
# /mines
# /speed (default sat til 1 hvis slået fra)
# /
## Time
#
## Block Perm
Plot_Config_Item_Toggle_Proc:
type: procedure
definitions: type
script:
- define plot <server.flag[Plot_Config_Target].as_plotsquared_plot>
- if <server.has_flag[Plots.<def[plot]>.Config.<def[type]>]> {
- determine "<&a><server.flag[Plots.<def[plot]>.Config.<def[type]>]>"
}
- determine "<&c>Slået Fra"
Plot_Config_Item_LockGamemode:
type: item
material: LOG
display name: <&b><&l>Force Gamemode
lore:
- "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[lock_gamemode]>"
- "<&3>Låser dit gamemode på dit plot"
- "<&3>så gæster ikke kan ændre deres."
- "<&3>Hvis en spiller ikke er i den korrekte gamemode,"
- "<&3>bliver de istedet sat til spectator."
# - "<&3>En spiller skal ændre sit gamemode før de joiner plottet."