-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheventManager.ser
More file actions
251 lines (214 loc) · 7.65 KB
/
Copy patheventManager.ser
File metadata and controls
251 lines (214 loc) · 7.65 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Event Pack administrator entry point.
# Enable the complete EventPack folder generated by serexamples, not this file alone.
!-- CustomCommand event
-- availableFor RemoteAdmin Server
-- description "Starts and controls the build-validated SER Event Pack."
-- neededPermission serverevent.manage
-- noPermissionMessage "You do not have the serverevent.manage permission."
-- arguments action eventName? optionOne? optionTwo? optionThree?
func $DeathmatchWeapon with $rawWeapon
$normalizedWeapon = $rawWeapon -> lower
if $normalizedWeapon is "ak" or $normalizedWeapon is "gunak"
return "GunAK"
elif $normalizedWeapon is "e11" or $normalizedWeapon is "gune11sr"
return "GunE11SR"
elif $normalizedWeapon is "crossvec" or $normalizedWeapon is "guncrossvec"
return "GunCrossvec"
elif $normalizedWeapon is "fsp9" or $normalizedWeapon is "gunfsp9"
return "GunFSP9"
elif $normalizedWeapon is "logicer" or $normalizedWeapon is "gunlogicer"
return "GunLogicer"
elif $normalizedWeapon is "shotgun" or $normalizedWeapon is "gunshotgun"
return "GunShotgun"
elif $normalizedWeapon is "revolver" or $normalizedWeapon is "gunrevolver"
return "GunRevolver"
elif $normalizedWeapon is "com15" or $normalizedWeapon is "guncom15"
return "GunCOM15"
elif $normalizedWeapon is "com18" or $normalizedWeapon is "guncom18"
return "GunCOM18"
elif $normalizedWeapon is "com45" or $normalizedWeapon is "guncom45"
return "GunCom45"
elif $normalizedWeapon is "frmg0" or $normalizedWeapon is "gunfrmg0"
return "GunFRMG0"
elif $normalizedWeapon is "a7" or $normalizedWeapon is "guna7"
return "GunA7"
elif $normalizedWeapon is "particle" or $normalizedWeapon is "particledisruptor"
return "ParticleDisruptor"
elif $normalizedWeapon is "micro" or $normalizedWeapon is "microhid"
return "MicroHID"
elif $normalizedWeapon is "jailbird"
return "Jailbird"
elif $normalizedWeapon is "scp127" or $normalizedWeapon is "gunscp127"
return "GunSCP127"
elif $normalizedWeapon is "scp1509"
return "SCP1509"
end
return "invalid"
end
$action = $action -> lower
if {VarExists $eventName}
$eventName = $eventName -> lower
end
if {VarExists $optionOne}
$optionOne = $optionOne -> lower
end
if {VarExists $optionTwo}
$optionTwo = $optionTwo -> lower
end
if $action is "list" or $action is "help"
Reply "EVENT PACK | deathmatch (dm), duel<br>Start: event start deathmatch [ffa/team] [lcz/hcz/entrance] [weapon]<br>Start: event start duel [Jailbird/SCP1509]<br>Control: event status | event stop confirm"
stop
end
if $action is "status"
if {VarExists $serPackActive} is false
Reply "EVENT PACK | No event is active."
stop
end
if $serPackActive is false
Reply "EVENT PACK | No event is active."
stop
end
Reply "EVENT PACK | Active: {$serPackName} | Phase: {$serPackPhase}"
stop
end
if $action is "stop"
if {VarExists $serPackActive} is false
Reply "EVENT PACK | No event is active."
stop
end
if $serPackActive is false
Reply "EVENT PACK | No event is active."
stop
end
if {VarExists $eventName} is false
Reply "EVENT PACK | This operation restarts the round. Use: event stop confirm"
stop
end
if $eventName isnt "confirm"
Reply "EVENT PACK | This operation restarts the round. Use: event stop confirm"
stop
end
Broadcast @all 5s "<color=#ff6b6b><b>EVENT CANCELLED</b></color><br>An administrator stopped the event. The round will restart."
SetCustomInfo @all ""
Reply "EVENT PACK | Stopping the event and restarting the round."
wait 2s
RestartRound
stop
end
if $action isnt "start"
Reply "EVENT PACK | Unknown action. Use: event list"
stop
end
if {VarExists $eventName} is false
Reply "EVENT PACK | Missing event name. Use: event list"
stop
end
if {VarExists $serPackActive}
if $serPackActive
Reply "EVENT PACK | {$serPackName} is already running (phase: {$serPackPhase})."
stop
end
end
if {RoundInfo hasStarted}
Reply "EVENT PACK | Events can only be started from the pre-round lobby."
stop
end
if {RoundInfo hasEnded}
Reply "EVENT PACK | The round is ending. Wait for the next lobby."
stop
end
@eventParticipants = Filter @all isNpc false
@eventParticipants = Filter @eventParticipants isDummy false
@eventParticipants = Except @eventParticipants @overwatchPlayers
# A player-backed administrator is the organizer by default, not a participant.
if {VarExists @sender}
@eventParticipants = Except @eventParticipants @sender
end
if {AmountOf @eventParticipants} < 2
Reply "EVENT PACK | At least two participants are required (the organizer is not included)."
stop
end
if $eventName is "deathmatch" or $eventName is "dm"
$eventMode = "ffa"
$eventZone = "hcz"
$eventWeapon = "GunAK"
if {VarExists $optionOne}
if $optionOne is "ffa"
$eventMode = "ffa"
elif $optionOne is "team" or $optionOne is "teams"
$eventMode = "team"
else
Reply "EVENT PACK | Mode must be ffa or team."
stop
end
end
if {VarExists $optionTwo}
if $optionTwo is "lcz"
$eventZone = "lcz"
elif $optionTwo is "hcz"
$eventZone = "hcz"
elif $optionTwo is "entrance" or $optionTwo is "ez"
$eventZone = "entrance"
else
Reply "EVENT PACK | Zone must be lcz, hcz, or entrance."
stop
end
end
if {VarExists $optionThree}
$eventWeapon = run $DeathmatchWeapon $optionThree
if $eventWeapon is "invalid"
Reply "EVENT PACK | Unsupported weapon. Use a full ItemType name or one of these short names: AK, E11, Crossvec, FSP9, Logicer, Shotgun, Revolver, COM15, COM18, COM45, FRMG0, A7, Particle, Micro, Jailbird, SCP127, SCP1509."
stop
end
end
global $serPackActive = true
global $serPackName = "Deathmatch"
global $serPackPhase = "Starting"
attempt
RunScript eventDeathmatch @eventParticipants $eventMode $eventZone $eventWeapon
on_error with $startError
delete $serPackActive
delete $serPackName
delete $serPackPhase
Reply "EVENT PACK | Failed to start Deathmatch: {$startError}"
stop
end
Reply "EVENT PACK | Started Deathmatch: {$eventMode}, {$eventZone}, {$eventWeapon}."
stop
end
if $eventName is "duel"
$eventWeapon = "Jailbird"
if {VarExists $optionTwo}
Reply "EVENT PACK | Duel accepts one weapon option. Use: event start duel [Jailbird/SCP1509]"
stop
end
if {VarExists $optionThree}
Reply "EVENT PACK | Duel accepts one weapon option. Use: event start duel [Jailbird/SCP1509]"
stop
end
if {VarExists $optionOne}
if $optionOne is "jailbird"
$eventWeapon = "Jailbird"
elif $optionOne is "scp1509" or $optionOne is "1509"
$eventWeapon = "SCP1509"
else
Reply "EVENT PACK | Duel weapon must be Jailbird or SCP1509."
stop
end
end
global $serPackActive = true
global $serPackName = "Duel"
global $serPackPhase = "Starting"
attempt
RunScript eventDuel @eventParticipants $eventWeapon
on_error with $startError
delete $serPackActive
delete $serPackName
delete $serPackPhase
Reply "EVENT PACK | Failed to start Duel: {$startError}"
stop
end
Reply "EVENT PACK | Started Duel with {$eventWeapon}."
stop
end
Reply "EVENT PACK | Unknown event. Use: event list"