• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
custom dvar
#1
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.
  Reply
#2
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..
  Reply
#3
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?
  Reply
#4
do you have any menu files? thats your best bet.. running it from server.cfg seemed to fail for me as well..

  Reply
#5
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?
  Reply
#6
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.



  Reply
#7
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.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Black Ops 2 Custom background? jotape99 10 11,611 10-29-2013, 07:22
Last Post: xInfinity.
  Custom xanims DidUknowiPwn 8 6,650 08-28-2013, 08:17
Last Post: RaZ
  Help Make ac130 shoot custom bullets Ra3shed 0 2,553 07-23-2013, 13:02
Last Post: Ra3shed
  [Tutorial] Custom gametype HUD iAegle 17 14,161 07-14-2013, 01:16
Last Post: Nekochan
Video Custom Facepaints? Cuddlyedits 5 4,143 07-01-2013, 14:58
Last Post: iPaddie
  Help dedicated servers and custom dvars mattyman 0 2,340 06-22-2013, 07:33
Last Post: mattyman
  [Release] -InSaNe-'s DVAR Console dylankrajewski 41 23,038 06-16-2013, 14:50
Last Post: lark
Information [Tutorial] Adding DLC Maps as Custom Maps. Nekochan 151 137,447 05-25-2013, 01:05
Last Post: Nero Z zero
  QS Mod by GeKKo v 6.5 with Custom Maps GeKKoFL0X 35 28,641 05-21-2013, 19:30
Last Post: [HARD] Tony.
  [Request] custom gun mod ColorCorrects 2 2,922 05-18-2013, 22:19
Last Post: mitchhacker

Forum Jump:


Users browsing this thread: 1 Guest(s)