server cvar not traping in client


(Demolama) #1

ok the server side cvar works fine… but when I try to pass it over to the client it returns a 0 not the value in which the cvar holds

cg_main.c

	{ &ds_axisNumCO,			"", "0", 0 }, // communicated by systeminfo 

cg_servercmds.c CG_ParseServerinfo

trap_Cvar_Set("ds_axisNumCO",Info_ValueForKey(info,"d_axisNumCO"));
	ds_axisNumCO.integer = atoi( Info_ValueForKey(info,"d_axisNumCO") );

I later use it with CG_Text_Paint_Ext to print out the number to the client

 s = va( "%i", ds_axisNumCO.integer);
CG_Text_Paint_Ext( 630, 140, 0.15f, 0.15f, colorGreen, s, 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont1 );

which I know this part of the code works… its just that the trap_ cvar isnt working

IVe done this before and it worked… true it was a qboolean last time and not an intenger value like this time… but it still trapped the cvar… but for some reason I cant get this one to trap and I followed what I did last time

anyone got a clue as to why this cvar isnt trapping in the client cvar?


(bacon) #2

What’s the code for d_axisNumCO?


(Demolama) #3
{ &d_axisNumCO, "d_axisNumCO", "15", CVAR_USER_CREATED| CVAR_ARCHIVE, 0, qtrue },

edit: I found the problem

I can used CVAR_SERVERINFO and then it will work… but then it shows up on the serverinfo screen and I dont want that… I can only use so many CVAR_SERVERINFO’s in the first place before the Q3 engine goes blah

I guess Im stuck with this :angry:


(digibob) #4

You could manually put it in another configstring yourself.


(Rain) #5

May as well just make it CVAR_WOLFINFO, then…

I think he might be looking for CVAR_SYSTEMINFO, though…