PDA

View Full Version : setting a cvar with "set" or without



kung foo man
18th November 2012, 07:45
Hey all,

why can I change sv_hostname without a "set", but g_allowvote needs a "set", otherwise it wont change?

Regards

Mitch
18th November 2012, 10:22
Because sv_hostname is default set and used in the engine. g_allowvote is probably not set yet.

Earliboy
30th January 2013, 12:36
Undefined = need set
Defined = just cvar

IzNoGoD
30th January 2013, 13:15
If some var is already set as a cvar, it doesnt need set.
If it is not, cod will auto-assume its a command, thus it needs set.

This way you can fuck with players that do /quit a lot, by setclientcvar("quit","hehehe");. The client then would need to do /cmd quit in order to actually quit the game.

After the first set command of a cvar, future operations will not require the "set" prefix.