The most vital part of Tebex Store is the ability to give the purchased products to the player as soon as they have made a purchase. The majority of our customers 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.

How Do Commands Work?

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 player Notch a gold block:

/give Notch 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 player 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 instantly. You may be wondering how we automatically replace the username with the player 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!

Variables To Customise Your Commands

As we support the use of different games across the Tebex Store we offer slightly different ways of getting a player name or their ID. All games support the same default variables, but some games may have additional variables.

Username Variables Across All Games

  • {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 player used to log into your store.

Minecraft: Java Edition Username Variables

  • {name} - Legacy variable for the player's username.
  • {uuid} - Legacy variable for the player's UUID.

Garry's Mod Username Variables

  • {steamid} - This returns the older format Steam ID e.g. (STEAM_0:0:1000).

Ark: Survival Evolved Username Variables

  • {ue4id} - This returns the UE4 ID for the player on that server (online commands only).

Other Variables Available Across All Games

  • {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 (days).
  • {packageName} - The name of the package.
  • {purchaserName} - The name of the player who purchased a gift package. 
  • {purchaserUuid} - The UUID of the player who purchased a gift package.
  • {purchaseQuantity} - The quantity of the package that was purchased.

The Different Types Of Commands Available

Tebex Store supports different types of commands to execute at different stages (For example you might want to execute a command when the player first purchases and execute a different command if they chargeback). 

Initial 

Initial commands will execute when the player purchases the package.

Expiry 

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.

Renewal 

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.

Chargeback 

These commands are executed when a chargeback is opened. You could use this command type to ban the player from your server.

Refund

These commands are executed when you refund a payment.

Global Commands

Global commands enable you to setup commands which execute across all packages, for example if you wanted to setup a chargeback command without having to add them to all packages.

  1. Go to Commands > Global Commands.
  2. Enter the commands which you want to execute across all packages.
  3. Click Update.

For Global Commands, there's a couple of things you should note:

  1. The Execute once per payment and not per package option will make the global command execute once per payments rather than per package which may be useful for broadcasting on your server that a purchase has been made. 
  2. The list of 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.
Did this answer your question?