Discussion:
[hlcoders] goldsource get client cvar value on server
Tom Schumann
2015-05-31 07:23:04 UTC
Permalink
In my client.dll I have CVAR_CREATE( "somecvar", "1", FCVAR_ARCHIVE ); (so
that the cvar gets saved to config.cfg).
How can I get the value of somecvar from my server.dll? I know there
are pfnCvarValue and pfnCvarValue2 but is there something that can tell me
right away rather than waiting for a callback to return?
If not, is there a better way to do this?
Tom Schumann
2015-05-31 10:59:06 UTC
Permalink
Doing some investigation it looks like creating a cvar with
the FCVAR_USERINFO flag and then using pfnInfoKeyValue on the server-side
is the way to achieve this.
Post by Tom Schumann
In my client.dll I have CVAR_CREATE( "somecvar", "1", FCVAR_ARCHIVE ); (so
that the cvar gets saved to config.cfg).
How can I get the value of somecvar from my server.dll? I know there
are pfnCvarValue and pfnCvarValue2 but is there something that can tell me
right away rather than waiting for a callback to return?
If not, is there a better way to do this?
Loading...