ItsMods
custom dvar - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: custom dvar (/Thread-custom-dvar.html)



custom dvar - thre3pi - 07-30-2011

I would like to put a custom dvar in my server.cfg for setting mode to public or private for ready up.

in the server config I have:

Code:
set xabolts_mode "public" //public or private

in my whitelist.cfg I have:

Code:
setmoddvar xabolts_mode

in zone_source I have:

Code:
rawfile,whitelist.cfg

Now I'm wondering how I can get the dvar into a script? I've tried something like the following:

Code:
if( getDvar("xabolts_mode") == "private" ) { gogoreadyetcetc }

Is this the way to go about it or is there another way or a better way to do this? Thanks.


RE: custom dvar - koil - 07-30-2011

if( getDvarInt("xabolts_mode") == "private" )
{
gogoreadyetcetc
}
else
{
other options
}


are you sure ur white list is working? type xabolts in console see if it comes up..


RE: custom dvar - thre3pi - 07-30-2011

When I type xabolts in console on my server I get nothing.

I followed one of the other threads in setting up the whitelist through server.cfg, do I need to have it exec from somewhere else?


RE: custom dvar - koil - 07-30-2011

do you have any menu files? thats your best bet.. running it from server.cfg seemed to fail for me as well..




RE: custom dvar - thre3pi - 07-30-2011

I'll give that a try, thanks.
Tried adding it to menu and till nothing, any way I can tell for sure if my whitelist is working other than that? If working and I have the dvar xabolts_mode in the whitelist I should be able to open console and type xabolts_mode and see what it is set to on my server? Does the name of the whitelist matter as long as it is the same all around...when exec, etc?


RE: custom dvar - thre3pi - 08-01-2011

Still having some issues getting my custom dvar to work, here is what I have:

(07-30-2011, 22:57)thre3pi Wrote: in the server config I have:

Code:
xabolts_mode "public" //public or match

in my whitelist.cfg I have:

Code:
setmoddvar xabolts_mode

in zone_source I have:

Code:
rawfile,whitelist.cfg

So I have the following in a script file:

Code:
if( getDvar("xabolts_mode") == "match" ) { dostuff }

I start a private match and type /exec server in the console and I get whitelist executed, which is good, but then I get:

Code:
command unknown xabolts_mode

Do I have to initialize this dvar somewhere in script first then get the new setting from the server.cfg? Just can't seem to get this to work.






RE: custom dvar - thre3pi - 08-09-2011

Still can't get this to work, see the post above this one for what I have. I saw xkmod had lots of custom dvars in the server.cfg. I still get command unknown when executing server.cfg which then executes whitelist. This both on listen and gs server. Thanks for any help.