1 #using scripts\codescripts\struct;
3 #using scripts\shared\audio_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\system_shared;
6 #using scripts\shared\util_shared;
8 #insert scripts\shared\shared.gsh;
9 #insert scripts\shared\version.gsh;
11 #precache( "client_fx", "_t6/misc/fx_equip_tac_insert_light_grn" );
12 #precache( "client_fx", "_t6/misc/fx_equip_tac_insert_light_red" );
14 #namespace tacticalinsertion;
18 level._effect[
"tacticalInsertionFriendly"] =
"_t6/misc/fx_equip_tac_insert_light_grn";
19 level._effect[
"tacticalInsertionEnemy"] =
"_t6/misc/fx_equip_tac_insert_light_red";
24 latLongStruct =
struct::get(
"lat_long",
"targetname" );
25 if ( isdefined( latLongStruct ) )
27 mapX = latLongStruct.origin[0];
28 mapY = latLongStruct.origin[1];
29 Lat = latLongStruct.script_vector[0];
30 Long = latLongStruct.script_vector[1];
34 if ( isdefined( level.worldMapX ) && isdefined( level.worldMapY ) )
36 mapX = level.worldMapX;
37 mapY = level.worldMapY;
45 if ( isdefined( level.worldLat ) && isdefined( level.worldLong ) )
48 Long = level.worldLong;
58 SetMapLatLong( mapX, mapY, Long, Lat );
61 function spawned( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
72 self endon(
"entityshutdown" );
73 level endon(
"player_switch" );
77 self.tacticalInsertionFX = PlayFXOnTag( localClientNum, level._effect[
"tacticalInsertionFriendly"],
self,
"tag_flash" );
81 self.tacticalInsertionFX = PlayFXOnTag( localClientNum, level._effect[
"tacticalInsertionEnemy"],
self,
"tag_flash" );
86 loopOrigin =
self.origin;
95 self waittill(
"entityshutdown" );
96 StopFX( localClientNum, fxHandle );
103 if (!isdefined(
self ) || !isdefined(
self.tacticalInsertionFX ) )
116 self endon(
"entityshutdown" );
120 level waittill(
"player_switch" );
122 if ( isdefined(
self.tacticalInsertionFX ) )
124 stopFx( localClientNum,
self.tacticalInsertionFX );
125 self.tacticalInsertionFX = undefined;