diff options
Diffstat (limited to 'Northstar.Custom')
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut | 12 | ||||
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut index 0428ecfa..d3e506ce 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut @@ -1,12 +1,22 @@ global function Sh_GGEarnMeter_Init -void function Sh_GGEarnMeter_Init() +struct { + string gamemode = "" +} file + +void function Sh_GGEarnMeter_Init(string gamemode) +{ + file.gamemode = gamemode + AddCallback_OnRegisteringCustomNetworkVars( RegisterSharedNetwork ) } void function RegisterSharedNetwork() { + if ( GAMETYPE != file.gamemode ) + return + RegisterNetworkedVariable( "gunGameLevelPercentage", SNDC_PLAYER_EXCLUSIVE, SNVT_FLOAT_RANGE, 0.0, 0.0, 1.0 ) Remote_RegisterFunction( "ServerCallback_GGEarnMeter_SetWeaponIcon" ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut index 42d264d9..477f328a 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut @@ -19,8 +19,7 @@ void function Sh_GamemodeGG_Init() // create custom gamemode AddCallback_OnCustomGamemodesInit( CreateGamemodeGG ) - if ( GAMETYPE != GAMEMODE_GG ) - Sh_GGEarnMeter_Init() + Sh_GGEarnMeter_Init(GAMEMODE_GG) } void function CreateGamemodeGG() |