‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_gadget_roulette.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\system_shared;
6 #using scripts\shared\util_shared;
7 
8 #insert scripts\shared\shared.gsh;
9 #insert scripts\shared\version.gsh;
10 
11 
12 #namespace gadget_roulette;
13 
14 ‪REGISTER_SYSTEM( "gadget_roulette", &‪__init__, undefined )
15 
16 function ‪__init__()
17 {
20 }
21 
22 
23 function ‪roulette_clientfield_cb( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
24 {
25  ‪update_roulette( localClientNum, newVal );
26 }
27 
28 function ‪update_roulette( localClientNum, newVal )
29 {
30  controllerModel = GetUIModelForController( localClientNum );
31  if ( isdefined( controllerModel ) )
32  {
33  rouletteStatusModel = GetUIModel( controllerModel, "playerAbilities.playerGadget3.rouletteStatus" );
34  if ( isdefined( rouletteStatusModel ) )
35  {
36  SetUIModelValue( rouletteStatusModel, newVal );
37  }
38  }
39 }
40 
41 function ‪on_localplayer_spawned( localClientNum )
42 {
43  roulette_state = 0;
44 
45  if ( getserverhighestclientfieldversion() >= ‪VERSION_TU11 )
46  {
47  roulette_state = self ‪clientfield::get_to_player( "roulette_state" );
48  }
49 
50  ‪update_roulette( localClientNum, roulette_state );
51 }
52 
‪VERSION_TU11
‪#define VERSION_TU11
Definition: version.gsh:61
‪get_to_player
‪function get_to_player(field_name)
Definition: clientfield_shared.csc:38
‪CF_CALLBACK_ZERO_ON_NEW_ENT
‪#define CF_CALLBACK_ZERO_ON_NEW_ENT
Definition: version.gsh:103
‪on_localplayer_spawned
‪function on_localplayer_spawned(localClientNum)
Definition: _gadget_roulette.csc:41
‪__init__
‪function __init__()
Definition: _gadget_roulette.csc:16
‪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
‪roulette_clientfield_cb
‪function roulette_clientfield_cb(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _gadget_roulette.csc:23
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪update_roulette
‪function update_roulette(localClientNum, newVal)
Definition: _gadget_roulette.csc:28