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:
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
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}"
Now that you have set the command up to your package, lets link the package to the script.
First head into
data/integration.lua
and at the top you will find the following:Tebex = { ['Test Package'] = 5000, }
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)
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:
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):
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