-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheventManager.ser
More file actions
241 lines (206 loc) · 7.56 KB
/
Copy patheventManager.ser
File metadata and controls
241 lines (206 loc) · 7.56 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
# 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 "Nie masz uprawnienia serverevent.manage."
-- 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), cockfight (cock)<br>Start: event start deathmatch [ffa/team] [lcz/hcz/entrance] [weapon]<br>Start: event start cockfight [Jailbird/SCP1509]<br>Control: event status | event stop confirm"
stop
end
if $action is "status"
if {VarExists $serPackActive} is false
Reply "EVENT PACK | Żaden event nie jest aktywny."
stop
end
if $serPackActive is false
Reply "EVENT PACK | Żaden event nie jest aktywny."
stop
end
Reply "EVENT PACK | Aktywny: {$serPackName} | Etap: {$serPackPhase}"
stop
end
if $action is "stop"
if {VarExists $serPackActive} is false
Reply "EVENT PACK | Nie ma aktywnego eventu."
stop
end
if $serPackActive is false
Reply "EVENT PACK | Nie ma aktywnego eventu."
stop
end
if {VarExists $eventName} is false
Reply "EVENT PACK | Ta operacja restartuje rundę. Użyj: event stop confirm"
stop
end
if $eventName isnt "confirm"
Reply "EVENT PACK | Ta operacja restartuje rundę. Użyj: event stop confirm"
stop
end
Broadcast @all 5s "<color=#ff6b6b><b>EVENT PRZERWANY</b></color><br>Administrator zatrzymał event. Runda zostanie zrestartowana."
SetCustomInfo @all ""
Reply "EVENT PACK | Zatrzymywanie eventu i restart rundy."
wait 2s
RestartRound
stop
end
if $action isnt "start"
Reply "EVENT PACK | Nieznana akcja. Użyj: event list"
stop
end
if {VarExists $eventName} is false
Reply "EVENT PACK | Brakuje nazwy eventu. Użyj: event list"
stop
end
if {VarExists $serPackActive}
if $serPackActive
Reply "EVENT PACK | Event {$serPackName} już działa (etap: {$serPackPhase})."
stop
end
end
if {RoundInfo hasStarted}
Reply "EVENT PACK | Event można uruchomić wyłącznie z lobby przed rozpoczęciem rundy."
stop
end
if {RoundInfo hasEnded}
Reply "EVENT PACK | Runda właśnie się kończy. Zaczekaj na nowe 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 | Potrzeba co najmniej 2 uczestników (organizator nie jest liczony)."
stop
end
if $eventName is "deathmatch" or $eventName is "deadmatch" 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 | Tryb musi mieć wartość ffa albo 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 | Strefa musi mieć wartość lcz, hcz albo entrance."
stop
end
end
if {VarExists $optionThree}
$eventWeapon = run $DeathmatchWeapon $optionThree
if $eventWeapon is "invalid"
Reply "EVENT PACK | Nieobsługiwana broń. Użyj pełnej nazwy ItemType albo skrótu: 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 = "Uruchamianie"
attempt
RunScript eventDeathmatch @eventParticipants $eventMode $eventZone $eventWeapon
on_error with $startError
delete $serPackActive
delete $serPackName
delete $serPackPhase
Reply "EVENT PACK | Nie udało się uruchomić Deathmatchu: {$startError}"
stop
end
Reply "EVENT PACK | Uruchomiono Deathmatch: {$eventMode}, {$eventZone}, {$eventWeapon}."
stop
end
if $eventName is "cockfight" or $eventName is "cock"
$eventWeapon = "Jailbird"
if {VarExists $optionOne}
if $optionOne is "jailbird"
$eventWeapon = "Jailbird"
elif $optionOne is "scp1509" or $optionOne is "1509"
$eventWeapon = "SCP1509"
else
Reply "EVENT PACK | Broń Cockfightu musi mieć wartość Jailbird albo SCP1509."
stop
end
end
global $serPackActive = true
global $serPackName = "Cockfight"
global $serPackPhase = "Uruchamianie"
attempt
RunScript eventCockfight @eventParticipants $eventWeapon
on_error with $startError
delete $serPackActive
delete $serPackName
delete $serPackPhase
Reply "EVENT PACK | Nie udało się uruchomić Cockfightu: {$startError}"
stop
end
Reply "EVENT PACK | Uruchomiono Cockfight z bronią {$eventWeapon}."
stop
end
Reply "EVENT PACK | Nieznany event. Użyj: event list"