An Introduction To Commands
Last updated
Last updated
The most vital part of Tebex Store is the ability to give the purchased products to the customer as soon as they have made a purchase. The majority of our sellers use our official plugins along with commands to do this and we'll explain below how this system works. We also support integration with your game server via RCON, MySQL and Webhooks however this article will not cover these topics.
When we refer to commands we are simply talking about the commands you would normally enter in your game server or via it's management console. For example in Minecraft you might enter the following command to give the customer Notch a gold block:
The way Tebex commands work is simple - when you create a package you enter a list of commands which you want to be executed on your server once a purchase has been made. For example, if we wanted to sell a package which gave the customer a gold block, you would enter the following command in your package configuration:
Once this package has been purchased the plugin will execute that command normally within 1~3 minutes. You may be wondering how we automatically replace the username with the customer who purchased, and that's done by variables. In the image above you can see we have replaced the username Notch with the variable {name} - the {name} aspect of the command would automatically be replaced with the username upon purchase. Awesome!
This system allows you to execute any commands you wish - if the command is executable on your server (For example from another third party plugin) then it'll work via Tebex too!
You will need to look up the relevant wikis for the game you are using, as well as any plugins or modifications you are using. We do not have a directory of commands as there are simply far too many to list. As a server owner, you should expect to spend a lot of time researching, and understanding the commands available for the various systems you will use, is very important.
As we support the use of different games across the Tebex Store we offer slightly different ways of getting a customer username or their ID. All games support the same default variables, but some games may have additional variables.
{id} - This will return the primary ID for that game type (Steam64 ID, Xbox Live XUID, Mojang UUID etc.)
{username} - This will return the username the customer used to log into your store.
{name} - Legacy variable for the customers username.
{uuid} - Legacy variable for the customer's UUID.
{steamid} - This returns the older format Steam ID e.g. (STEAM_0:0:1000).
{ue4id} - This returns the UE4 ID for the customer on that game server (online commands only).
{hexid} - This returns the Hex ID (e.g. steam:110000abf6b0001) for the customer (online commands only).
{transaction} - The transaction ID of the payment.
{server} - Will output the name of the server.
{price} - The amount paid.
{currency} - The currency of the payment.
{time} - The time of purchase, e.g. 15:30.
{date} - The date of purchase, e.g. 13/01/2012.
{email} - The email address of the customer.
{ip} - The IP address of the customer.
{packageId} - The ID of the package.
{packagePrice} - The price of the package.
{packageExpiry} - The expiry length of the package (represented in the package's expiry period).
{packageName} - The name of the package.
{purchaserName} - The name of the customer who purchased a gift package.
{purchaserUuid} - The UUID of the customer who purchased a gift package.
{purchaseQuantity} - The quantity of the package that was purchased.
Tebex Store supports different types of commands to execute at different stages (For example you might want to execute a command when the customer first purchases and execute a different command if they chargeback).
Initial commands will execute when the customer purchases the package.
An expiry command is executed after the expiry period you set in your package configuration. These are useful if you only want a package to last for a certain amount of time for example if you are selling a monthly membership rank. You would set the rank to active with initial commands and remove the rank with expiry commands.
These commands are executed when you are using subscription packages. This could be for executing a command which gives a player an additional 30 days of a rank membership, or a unique reward that is only given to players who renew their subscription! (Good incentive to stay subscribed).
These commands are executed when a chargeback is opened. You could use this command type to ban the customer from your game server if wanted.
These commands are executed when you refund a payment, for example, you may wish to remove the customer from their rank or role on your game server.
Global commands enable you to set up commands which execute across all packages, for example, if you wanted to set up a chargeback command without having to add them to all packages.
Go to Game Servers > Global Commands.
Enter the commands which you want to execute across all packages.
Click Update.
For Global Commands, there are a couple of things you should note:
The execute once per payment and not per package option may be useful for broadcasting on your game server that a purchase has been made.
The list of game servers that you select from the dropdown are not the servers that the command will execute on, they are the servers that are eligible for the command to execute on. So if you select Server A and Server B within the global command options, when a purchase is made for a package against Server A, the global command will only execute on Server A - and not Server B. If the package is against Server A, Server B and Server C then the global command will only execute on Server A and Server B.
If you resend the commands on a payment, the global command is also resent.