1 #using scripts\shared\system_shared;
2 #using scripts\shared\clientfield_shared;
3 #using scripts\shared\filter_shared;
4 #using scripts\shared\callbacks_shared;
6 #insert scripts\shared\clientfields.gsh;
7 #insert scripts\shared\shared.gsh;
8 #insert scripts\shared\version.gsh;
14 #define OOB_TIMELIMIT_MS_DEFAULT 6000 //Change the value in the _oob.gsc file to match this one
15 #define OOB_TIMELIMIT_MS_DEFAULT_MP 3000 //Change the value in the _oob.gsc file to match this one
16 #define OOB_TIMEKEEP_MP 3000 //Change the value in the _oob.gsc file to match this one
20 if(SessionModeIsMultiplayerGame())
33 if( !SessionModeIsZombiesGame() )
43 if(
self != GetLocalPlayer( localClientNum ) )
47 SetUIModelValue( oobModel, 0 );
59 if ( isdefined( localPlayer ) )
65 function onOutOfBoundsChange( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
68 localPlayer = GetLocalPlayer( localClientNum );
70 if(!isdefined(level.oob_sound_ent))
72 level.oob_sound_ent = [];
75 if( !isdefined( level.oob_sound_ent[localClientNum] ) )
77 level.oob_sound_ent[localClientNum] =
Spawn( localClientNum, (0,0,0),
"script_origin" );
82 if( !isdefined( localPlayer.oob_effect_enabled ) )
86 localPlayer.oob_effect_enabled =
true;
88 level.oob_sound_ent[localClientNum] PlayLoopSound(
"uin_out_of_bounds_loop", 0.5 );
93 if( isdefined(level.oob_timekeep_ms) && isdefined(
self.oob_start_time) && isdefined(
self.oob_active_duration) &&
94 ((getServerTime(0) -
self.oob_end_time) < level.oob_timekeep_ms) )
96 SetUIModelValue( oobModel, getServerTime( 0,
true ) + (level.oob_timelimit_ms -
self.oob_active_duration) );
100 self.oob_active_duration = undefined;
101 SetUIModelValue( oobModel, getServerTime( 0,
true ) + level.oob_timelimit_ms );
104 self.oob_start_time = getServerTime(0,
true);
107 newValf = newVal / 31.0;
109 localPlayer Randomfade( newValf );
113 if( isdefined(level.oob_timekeep_ms) && isdefined(
self.oob_start_time))
115 self.oob_end_time = getServerTime( 0,
true );
117 if(!isdefined(
self.oob_active_duration))
119 self.oob_active_duration = 0;
122 self.oob_active_duration +=
self.oob_end_time -
self.oob_start_time;
132 localPlayer Randomfade( 0 );
134 if( isDefined(level.oob_sound_ent) && isdefined( level.oob_sound_ent[localClientNum] ) )
136 level.oob_sound_ent[localClientNum] StopAllLoopSounds( 0.5 );
140 SetUIModelValue( oobModel, 0 );
142 if( isdefined( localPlayer.oob_effect_enabled ) )
144 localPlayer.oob_effect_enabled =
false;
145 localPlayer.oob_effect_enabled = undefined;
151 controllerModel = GetUIModelForController( localClientNum );
152 return CreateUIModel( controllerModel,
"hudItems.outOfBoundsEndTime" );