‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_gadget_hacker.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\duplicaterender_mgr;
6 #using scripts\shared\hackable;
7 #using scripts\shared\system_shared;
8 #using scripts\shared\visionset_mgr_shared;
9 
10 #using scripts\shared\abilities\_ability_player;
11 #using scripts\shared\abilities\_ability_power;
12 #using scripts\shared\abilities\_ability_util;
13 
14 #insert scripts\shared\duplicaterender.gsh;
15 #insert scripts\shared\shared.gsh;
16 #insert scripts\shared\version.gsh;
17 
18 ‪REGISTER_SYSTEM( "gadget_hacker", &‪__init__, undefined )
19 
20 #define HACKER_OUTLINE_MATERIAL "mc/hud_outline_model_orange"
21 
22 function ‪__init__()
23 {
24 //TODO: ONCONNECT CANNOT USE THE ENTITY _ if this code every comes back (it's all commented out righ tnow - then you will need to deal with this:: callback::on_localclient_connect( &on_player_connect );
28 
29 
30 }
31 
32 function ‪on_player_connect( localClientNum )
33 {
34  if ( !IsDefined( self.hacker_sound_ent ) )
35  {
36  self.hacker_sound_ent = ‪spawn( localClientNum, self.origin, "script_origin" );
37  self.hacker_sound_ent linkto( self, "tag_origin" );
38  }
39 
40 }
41 
42 function ‪on_player_spawned( localClientNum )
43 {
44  self notify("stop_hacking_sounds");
45 }
46 
47 function ‪has_hacker_changed( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
48 {
49  self._gadget_has_hacker = newVal;
50  if ( newVal )
51  {
52  self thread ‪watch_hack_ents(localClientNum);
53  }
54  else
55  {
56  self notify("watch_hack_ents");
57  ‪hackable::set_hacked_ent( localClientNum, undefined );
58  }
59 
60 }
61 
62 function ‪watch_hack_ents(localClientNum)
63 {
64  self notify("watch_hack_ents");
65  self endon("watch_hack_ents");
66  self endon("death");
67 
68  while( IsDefined(self) && self._gadget_has_hacker )
69  {
70  targetArray = self GetTargetLockEntity(localClientNum);
71  if (targetArray.size>0)
72  {
73  ‪hackable::set_hacked_ent( localClientNum, targetArray[0] );
74  }
76  }
77 
78 
79 }
80 
81 function ‪has_hacking_changed( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
82 {
83  self._gadget_is_hacking = newVal;
84  if ( newVal != oldVal )
85  {
86  if ( newVal )
87  {
88  // self thread play_hacking_sounds(localClientNum);
89  }
90  else
91  {
92  // self notify("stop_hacking_sounds");
93  }
94  }
95 
96 }
97 
98 function ‪play_hacking_sounds( localClientNum )
99 {
100  self endon("death");
101  self endon("disconnect");
102 
103  // SOUND CALLS TO BE MOVED TO GDT FIELDS
104  //self PlaySound ( localClientNum, "gdt_hacker_on" );
105  //PlayLoopSound( localClientNum, self.hacker_sound_ent, "gdt_hacker_loop", 0.5 );
106  //self.hacker_sound_ent playloopsound( "gdt_hacker_loop", 0.5 );
107 
108 
109  self waittill("stop_hacking_sounds");
110  //self.hacker_sound_ent StopAllLoopSounds( 0.5 );
111  //StopAllLoopSounds( localClientNum, self.hacker_sound_ent, 0.1 );
112  //self PlaySound ( localClientNum, "gdt_hacker_off" );
113 }
‪has_hacker_changed
‪function has_hacker_changed(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _gadget_hacker.csc:47
‪CF_CALLBACK_ZERO_ON_NEW_ENT
‪#define CF_CALLBACK_ZERO_ON_NEW_ENT
Definition: version.gsh:103
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪spawn
‪function spawn(v_origin=(0, 0, 0), v_angles=(0, 0, 0))
Definition: struct.csc:23
‪on_spawned
‪function on_spawned(func, obj)
Definition: callbacks_shared.csc:245
‪on_player_spawned
‪function on_player_spawned(localClientNum)
Definition: _gadget_hacker.csc:42
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪__init__
‪function __init__()
Definition: _gadget_hacker.csc:22
‪watch_hack_ents
‪function watch_hack_ents(localClientNum)
Definition: _gadget_hacker.csc:62
‪play_hacking_sounds
‪function play_hacking_sounds(localClientNum)
Definition: _gadget_hacker.csc:98
‪on_player_connect
‪function on_player_connect(localClientNum)
Definition: _gadget_hacker.csc:32
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪WAIT_CLIENT_FRAME
‪#define WAIT_CLIENT_FRAME
Definition: shared.gsh:266
‪set_hacked_ent
‪function set_hacked_ent(local_client_num, ent)
Definition: hackable.csc:35
‪has_hacking_changed
‪function has_hacking_changed(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _gadget_hacker.csc:81