GetGlobalString - Client but not Server?

Having a bit of a problem. I’m making a gamemode, and in the init.lua file I have this line:


SetGlobalString( "ta_mode", "capture" )

And on the client, when I do GetGlobalString( “ta_mode” ) it works fine and shows “capture”. However, it does not return that value on the server until I manually set it again. Any ideas why?



] lua_run print(GetGlobalString("ta_mode"))
> print(GetGlobalString("ta_mode"))...

] lua_run_cl print(GetGlobalString("ta_mode"))
capture


Note:
[ul][li]This is confirmed to work for more than one global string (client but not server)
[/li][li]I tried putting it into the InitPostEntity, no luck (thought maybe something was going screwy)
[/li][li]This would be incredibly helpful if someone solved it. Server not being able to read global variables is really really bad, especially for Fretta (can’t tell if we’re InRound so it destroys the game…)
[/li][li]If I set the string via console and then check it from the server it works fine
[/li][/ul]

Hmm, from your code it’s possible you only set the Global String on the client, that’s usually what gets people, but if you have put it in init.lua then it should be doing it serverside.
It working when you set the variable through the console implies that there’s nothing wrong with the function, but how you’re calling it in your init.lua file.

Yeah, that’s my thoughts exactly. Here’s exactly how it is in the init.lua:


AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "cl_ambience.lua" )
AddCSLuaFile( "cl_hud.lua" )
AddCSLuaFile( "cl_vgui.lua" )
AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "util.lua" )

include( "player.lua" )
include( "shared.lua" )
include( "data.lua")
include( "util.lua")
include( "sv_general.lua" )
include( "sv_techie.lua" )
include( "sv_squads.lua" )
include( "sv_round.lua" )

ta.AddFilesRecursive("../sound/ta","")
ta.AddFilesRecursive("../materials/ta","")
ta.AddFilesRecursive("../models/devin","")
ta.AddFilesRecursive("../materials/HUD/killicons","")

resource.AddFile("models/weapons/w_binoculars.mdl")
resource.AddFile("models/weapons/v_binoculars.mdl")
resource.AddFile("models/weapons/devin/w_wrench.mdl")
resource.AddFile("models/weapons/devin/v_wrench.mdl")
resource.AddFile("models/weapons/v_punch.mdl")
resource.AddFile("models/weapons/w_fists_t.mdl")
resource.AddFile("models/items/v_medkit.mdl")
resource.AddFile("models/items/w_medkit.mdl")
resource.AddFile("resource/fonts/Army.ttf")

SetGlobalString("ta_ambience","battle")
SetGlobalString("ta_mode","capture")

I can’t figure out what would be wrong.