Results 1 to 4 of 4

Thread: setting a cvar with "set" or without

  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts

    setting a cvar with "set" or without

    Hey all,

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

    Regards
    timescale 0.01

  2. #2
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Because sv_hostname is default set and used in the engine. g_allowvote is probably not set yet.

  3. The Following User Says Thank You to Mitch For This Useful Post:

    kung foo man (18th November 2012)

  4. #3
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Undefined = need set
    Defined = just cvar
    No ... No ... this is not possible .......

  5. The Following User Says Thank You to Earliboy For This Useful Post:

    kung foo man (30th January 2013)

  6. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    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.

  7. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (30th January 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •