-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfacilityStatusCommand.ser
More file actions
39 lines (33 loc) · 1.32 KB
/
Copy pathfacilityStatusCommand.ser
File metadata and controls
39 lines (33 loc) · 1.32 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
# Disabled by default: remove # from the filename to enable this script.
# Read-only facility diagnostics available from every command console.
# Demonstrates map collections, reference iteration and status helpers.
!-- CustomCommand facilitystatus
-- availableFor player remoteAdmin server
-- description "Shows warhead, decontamination and map-object status"
-- cooldown 3s
$warhead = "idle"
if {WarheadInfo isDetonated}
$warhead = "detonated"
elif {WarheadInfo hasStarted}
$warheadTime = FormatDuration {WarheadInfo duration} "MMm SSs"
$warhead = "counting down ({$warheadTime})"
elif {WarheadInfo isLocked}
$warhead = "idle (locked)"
end
$decontamination = "pending"
if {DecontaminationInfo hasStarted}
$decontamination = "active or complete"
else
$deconTime = FormatDuration {DecontaminationInfo timeToStart} "MMm SSs"
$decontamination = "starts in {$deconTime}"
end
&generators = GetFromMap generators
$engagedGenerators = 0
over &generators with *generator
if {*generator -> engaged}
$engagedGenerators = $engagedGenerators + 1
end
end
&pickups = GetPickups
&ragdolls = GetFromMap ragdolls
Reply "Warhead: {$warhead}<br>Decontamination: {$decontamination}<br>Generators: {$engagedGenerators}/{&generators -> length} engaged<br>Loose pickups: {&pickups -> length} | Ragdolls: {&ragdolls -> length}"