Question about commands
Posted: Sat Sep 17, 2011 9:30 pm
I have a 3 cvars, one in ui, one in cgame and one in game. I want to have a command where if you type it in the console it echos like this:
UI Cvar value: <value of ui cvar>
Cgame Cvar value: <value of cgame cvar>
Game Cvar value: <value of game cvar>
Of course, there are 3 states you could be in: 1. In main menu which means you aren't connected to a server, 2. "connected to" a local server, 3. Connected to a remote server.
If you were in state 1, then the game cvar value would just reply like "not connected to server", and if you were in state 2 or 3 then what you'd get back would be from the local or remote server depending on which you are on.
Also there is the possibility that the user is using a ui.qvm doesn't have the ui cvar at all, so in that case I'd say something like "ui cvar value: not present".
Can this even be done? These are read only cvars by the way.
UI Cvar value: <value of ui cvar>
Cgame Cvar value: <value of cgame cvar>
Game Cvar value: <value of game cvar>
Of course, there are 3 states you could be in: 1. In main menu which means you aren't connected to a server, 2. "connected to" a local server, 3. Connected to a remote server.
If you were in state 1, then the game cvar value would just reply like "not connected to server", and if you were in state 2 or 3 then what you'd get back would be from the local or remote server depending on which you are on.
Also there is the possibility that the user is using a ui.qvm doesn't have the ui cvar at all, so in that case I'd say something like "ui cvar value: not present".
Can this even be done? These are read only cvars by the way.