Jump to content

Commandlines - Variable calling defaut variable if checkbox = true


WolwX

Recommended Posts

Hello,

 

I have some questions about variables.

 

I wish to create a command line including the use of a custom port, but only if a variable is activated.

That's for Counter Strike Source, I want to be able to set the custom port for SourceTV if the user "active" the STV function.

 

So I created a STV variable, and if checkbox = true, I add thoses information : "-tv_enable 1 -tv_maxclients 50 tv_port $[service.CustomPort1]"

But that's result by "-tv_enable 1 -tv_maxclients 50 tv_port " without including the custom port

 

I tried to add this information into "On value"

 

Perhaps I can manage that by another way ?

Using an other variable with the parent value in relation with my STV variable can be a way to do it ?

Edited by WolwX
Link to comment
Share on other sites

You can do this with predefined commandlines. Create a commandline named HLTV Enabled with this:

-console  -game cstrike -condebug +maxplayers $[service.Slots] +ip  $[service.IpAddress] -port $[service.GamePort] ![startupMap] ![FpsMax] -tv_enable 1 -tv_maxclients 50 tv_port $[service.CustomPort1]

Remember to configure the query monitoring to allow one extra slot because enabling hltv adds one slot to the slots sent in the commandline.

Link to comment
Share on other sites

If you want to have a checkbox when the user creates a new custom commandline I have configured an example in our demo panel. You can log in with demoadmin/demoadmin :

 

 

  1. Select the Commandlines tab. You can see I replaced -nohltv with ![HLTV] tv_port $[service.CustomPort1] in all commandlines. http://www.tcadmin.com:8880/Interface/GameHosting/EditGame.aspx?gameid=1
     

  2. I created the variable named HLTV. In the Commandline Parameter Options tab I configured it as a checkbox. When checked the value is -tv_enable 1 -tv_maxclients 50 when unchecked the value is -nohltv
    http://www.tcadmin.com:8880/Interface/GameHosting/EditGameCustomVariable.aspx?gameid=1&variableid=6
     

  3. When the user is building a commandline he will see a checkbox to enable/disable hltv. I created 2 commandlines here:
    http://www.tcadmin.com:8880/Interface/GameHosting/ServiceCmdLine.aspx?serviceid=7
    Select the Custom Commandlines tab. One has hltv enabled the other has it disabled.

 

 

The ports are assigned when the game server is created. After it is created the only way you can assign new ports is in the service settings.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 15 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use