Integration

Integration for Tebex and Discord

Tebex

Settting up Tebex integration is very useful/helpful. This will allow players to purchase a package from your tebex and redeem it through the coin shop using the tebex id.

For example i have a package named "100 Coins" and i purchase it, go in game and redeem the tebex id i can recieve 100 coins! Heres how to set it up:

  1. First things first we need to connect Tebex to your FiveM server, to do so you can follow the video provided from Tebex themselves: https://www.youtube.com/watch?v=it-eiJDwV5E

  2. Now that you have set up your game server on Tebex, heres how to set up the game server command on your package: Command: bs:cs:redeem "id = {transaction}, package = {packageName}"

  1. Now that you have set the command up to your package, lets link the package to the script.

  2. First head into data/integration.lua and at the top you will find the following:

    Tebex = {    
        ['Test Package'] = 5000,  
    }
  1. You need to match the package name as the text inside the box like so: (the number is the amount of coins they will recieve)

  2. If i wanted to add another package called "2000 Coins" i would do the exact same and add create a new line in the Tebex table like so:

  1. Now that you have set up your packages, you can test by setting your package price to 0 on Tebex and purchasing it and then trying to redeem it. The following should pop up in your live console (if debug is enabled):

  2. To redeem use the tebex transaction id given by Tebex sent via emails and head into the coin shop to the redeem page!

Discord

Setting up Discord integration is very simple and useful however is not needed. Reasons to use it

  • Will grab the players profile picture for the top right of the coin shop

  • Can set up role permissions (player will need to require a role on discord to purchase an item from the coin shop)

  • Admin commands with discord role permissions such as /addcoins /removecoins

  • You most likely already have a discord bot inside of your server and can just easily use the same bot and be done in seconds.

If you do not already have a bot for FiveM heres how to set one up:

https://www.youtube.com/watch?v=zrNloK9b1ro

Make sure the bot is inside of your server as well grab the server guild id of your discord server.

Heres an example:

Discord = {
    BotToken = 'ODg5ODk0MTcwNjk5ODk4OTMw.GHymIb', -- Bot token
    GuildID = '1140475039305715763', -- Discord server guild id
    Commands = '1140475039343460416' -- Role id for admins to access commands such as /addcoins and /removecoins
}

Last updated