Sign in to follow this  
Vicious-Hybrid

Changing a Dvar While Server Running

Recommended Posts

Hi There CoD4 Friends,

Hope is all well,

 

I have a really daft question here, dose anyone know if dvars change back to the original input or when there changed within the mod scrips that they stay as that when the map changes.. 

for E.X 

set g_gametype "war" then a gametype vote it gets change to set g_gametype "dom"... Map changes

will it go back to set g_gametype "war" or stay as set g_gametype "dom"

 

and also will this work with any dvar and custom dvar

 

Thanks

Vicious-Hybrid

Edited by Vicious-Hybrid

Share this post


Link to post
Share on other sites

Hi, on server start all the dvars inside ur .cfg´s that are executed, are loaded once. After you can overwrite them. They won´t take initial value, that were set in .cfg´s, except you execute the .cfg´s again. Holds for any dvar and custom dvar, as far as I know.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Belial95 said:

Hi, on server start all the dvars inside ur .cfg´s that are executed, are loaded once. After you can overwrite them. They won´t take initial value, that were set in .cfg´s, except you execute the .cfg´s again. Holds for any dvar and custom dvar, as far as I know.

Hi,

Thank you for the reply, this has help a lot.. i never really had chance to play about with dvars so i hope it will let me do what i want it to do now

thank you again

Vicious-Hybrid

Share this post


Link to post
Share on other sites

To be clear: if u change a dvar with a script ( setDvar() ), it will change it permanently. Hence, on next map change, the dvar will have the value you gave it by the script. If you only change the variable, that is holding the dvar, for example, if a dvar is loaded into a variable like level.gametype, then it will change only the variable but not the dvar. After map change, the variable level.gametype will be equal to the initial value of the dvar, as long as the script won´t change the value of the variable.

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this