1 #using scripts\codescripts\struct;
3 #using scripts\shared\system_shared;
5 #insert scripts\shared\shared.gsh;
7 #precache( "material", "zombie_stopwatchneedle" );
8 #precache( "material", "zombie_stopwatch" );
9 #precache( "material", "zombie_stopwatch_glass" );
17 if( !isdefined( level.stopwatch_length_width ) )
19 level.stopwatch_length_width = 96;
25 self notify (
"stop_prev_timer");
26 self endon (
"stop_prev_timer");
27 self endon (
"disconnect");
29 if( !isdefined(
self.stopwatch_elem ) )
31 self.stopwatch_elem = newClientHudElem(
self);
32 self.stopwatch_elem.horzAlign =
"left";
33 self.stopwatch_elem.vertAlign =
"top";
34 self.stopwatch_elem.alignX =
"left";
35 self.stopwatch_elem.alignY =
"top";
36 self.stopwatch_elem.x = 10;
37 self.stopwatch_elem.alpha = 0;
38 self.stopwatch_elem.sort = 2;
40 self.stopwatch_elem_glass = newClientHudElem(
self);
41 self.stopwatch_elem_glass.horzAlign =
"left";
42 self.stopwatch_elem_glass.vertAlign =
"top";
43 self.stopwatch_elem_glass.alignX =
"left";
44 self.stopwatch_elem_glass.alignY =
"top";
45 self.stopwatch_elem_glass.x = 10;
46 self.stopwatch_elem_glass.alpha = 0;
47 self.stopwatch_elem_glass.sort = 3;
48 self.stopwatch_elem_glass setShader(
"zombie_stopwatch_glass", level.stopwatch_length_width, level.stopwatch_length_width );
53 if( isdefined( stop_notify ) )
61 self.stopwatch_elem setClock( time, 60,
"zombie_stopwatch", level.stopwatch_length_width, level.stopwatch_length_width );
62 self.stopwatch_elem.alpha = 1;
63 self.stopwatch_elem_glass.alpha = 1;
65 self notify(
"countdown_finished" );
67 self.stopwatch_elem.alpha = 0;
68 self.stopwatch_elem_glass.alpha = 0;
74 self endon (
"stop_prev_timer");
75 self endon(
"countdown_finished" );
77 self waittill( stop_notify );
79 self.stopwatch_elem.alpha = 0;
80 self.stopwatch_elem_glass.alpha = 0;
85 self endon(
"disconnect" );
86 self endon (
"stop_prev_timer");
87 self endon(
"countdown_finished" );
91 self.stopwatch_elem.y = 20;
92 self.stopwatch_elem_glass.y = 20;