Jump to content

Allow user to set map or other settings during order


Dennis

Recommended Posts

When using the TCAdmin2_advanced module for WHMCS, you can allow your user to predefine basically anything that can be controlled using a variable in TCAdmin.

 

Set up the variable

Start by going to System > Settings > Games & Other Voice Servers > Game > Variables and create a new variable (if you haven't already done so yet).

I've already created a variable called 'Map' for ARK: Survival Evolved that will control what map the service is starting with.

B1ihLVr.png

Some variables will require you to set a default value (like in my case, as the server can't start without a map being specified).

If the variable is going to be specified in a command line, specify it under 'Variable Options' and set any other options here as well.

 

 

If you're setting up a variable that's used for a commandline

 

Go to System > Settings > Games & Other Voice Servers > Game and select the Commandlines tab. Specify the default commandline as such:

![Map]?MultiHome=$[service.IpAddress]?Port=$[service.GamePort]?QueryPort=$[service.QueryPort]?RCONPort=$[service.RConPort]?MaxPlayers=$[service.Slots]?listen   

If you're setting up a variable that's used for a configuration file

 

Go to System > Settings > Games & Other Voice Servers > Game and select Configuration Files. Either add or edit the file that will contain the setting for the variable. Go to the 'Template' tab of the configuration file.

example.cfg

 


//This is just a fictional configuration file
server.Hostname=$[HostName]
server.IpAddress=$[service.IpAddress]
server.GamePort=$[service.GamePort]
server.QueryPort=$[service.QueryPort]
server.MaxPlayers=$[service.Slots]
server.Map=![Map]

Now we've added our 'Map' variable to the server.Map setting.

 

 

Configure WHMCS

For the sake of this tutorial, I'll be adding a Custom Field to a product using the TCAdmin2_Advanced module in WHMCS.

 

Go to Setup > Products/Services > Click the edit button next to your game and choose the Custom Fields tab.

 

 

I've setup the field like this:

EkwSBOt.png

 

You can specify a value that is sent to TCAdmin and a value that is shown to the client when ordering like this:

TCAdminValue|VisibleToClient

The code from my screenshot will therefore look like this:

7btWXOQ.png

 

 

Now we just need to tell TCAdmin to use this value.

Go to yourwhmcsinstallation/modules/servers/tcadmin2_advanced and create a new file (called gamename.php fx). Include the following code in the file:

---------

https://pastebin.com/wnHLMriA (the forum kept messing up the post when adding more code)

---------

Be sure to update NameOfYourTCAdminVariable and NameOfYouCustomField with whatever you've named them in TCAdmin and WHMCS.

Example:

---------

https://pastebin.com/B76frbEa

 

 

That's it. If you have any questions, please feel free to ask :)

Read more about sending custom variables through WHMCS here: https://help.tcadmin.com/TCAdmin2_advanced_module_for_WHMCS#Sending_Custom_Variable_Values

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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