IF-GameShop is a FiveM script that integrates with Tebex, allowing players to purchase and redeem in-game items or currency packs. This solution provides a seamless experience where players can buy packages on your Tebex store and access the purchased content within the game using simple commands. The script supports multiple frameworks, such as ESX, QB, and STANDALONE.
-
Tebex Integration: Connects directly to your Tebex shop using command actions.
-
In-Game Commands: Players can use specific commands to access the shop and redeem currency or game kits.
-
Currency Packages: Predefined currency packs players can buy and redeem for in-game currency.
You can add more than +4 packs and scroll it. -
Gift and Redeem System: Players can assign a purchased pack to a specific player and provide them the tebex code to redeem.
-
Game Kits: Item kits with various items like weapons and money that players can purchase and redeem.
-
Discord Webhook: Optional feature to send purchase logs to a specified Discord webhook.
Package Configuration
Two types of packages are supported: Currency Packages and Game Kits. Configure these in config/currency.lua
and config/gamekits.lua
, respectively.
General Config
- Framework
- ESX, QB or STANDALONE (Standalone may request edits, check
client/framework/standalone
andserver/framework/standalone
)
- ESX, QB or STANDALONE (Standalone may request edits, check
- TebexShop
- Set your Tebex Shop root domain. It’ll be used to redirect the player to the package page.
- Shop Commands
- If you want, you can edit the CoinShop and GameKit open commands.
- Discord Webhook
- Define your server name, logo and webhook url, so you will be able to track all actions made, including purchases.
Currency Packages
Each currency package allows players to redeem in-game currency. The configuration includes:
- packageName: Name of the package as listed in Tebex.
- packageId: The specific Tebex package ID to link directly.
- price: The cost of the package.
- reward: Details of the currency reward (amount and account).
- img: Path to the image representing the package.
- background_type: Custom background color for display.
- discounts: Optionally set specific discounts by percentage.
Example:
{
packageName = '100 Coins',
packageId = 6532315,
price = 15,
reward = { amount = 100, account = 'coins' },
img = 'assets/currency-shop/money_bag.png',
background_type = "blue",
}
Game Kits
Game kits contain various in-game items like weapons and currency that players can redeem. Each kit configuration includes:
- packageName: The exact name of the kit in Tebex.
- packageId: Tebex package ID for linking.
- description: List of items included in the kit.
- img: Image file path for the kit icon.
- price: Cost of the kit.
- onBuy function: Logic for adding items to the player’s inventory upon purchase.
Example:
{
packageName = 'GameKit 1',
packageId = 6532314,
description = { 'x1 PISTOL .50', 'x1 HATCHET', 'R$5000' },
img = 'assets/gamekits/character_green.png',
price = 30,
onBuy = function(playerId)
local FPlayer = Framework.GetPlayer(playerId)
if FPlayer then
FPlayer.AddInventoryItem('WEAPON_PISTOL50', 1)
FPlayer.AddInventoryItem('WEAPON_HATCHET', 1)
FPlayer.AddAccountMoney('money', 5000)
end
end
}
Commands
/kitshop
: Opens the game kit shop./coinshop
: Opens the currency shop.
Discord Webhook Logging (Optional)
To enable logging, configure your DiscordWebhook
details in Config.lua
:
- serverName: Name of your server (appears in logs).
- logo: Avatar Logo (appears in logs).
- url: Your Discord webhook URL.
Connecting Tebex to Your Server
-
Create or Log Into Your Tebex Account:
- Go to Tebex.io, create an account or log in if you already have one.
-
Linking Your Server:
- In your Tebex Dashboard, navigate to Game Servers on the left menu.
- Click CONNECT GAME SERVER in the top right.
- Select PLUGIN when prompted, choose your server, and select the packages you want to activate (or choose SELECT ALL).
- Copy the
sv_tebexSecret
key provided and paste it into yourserver.cfg
file on the top lines.
-
Connecting Tebex with FiveM:
- Restart your server. If everything is set up correctly, you should see the connection status on Tebex change from “NOT CONNECT” to “CONNECT” within seconds.
Creating a Tebex Package for In-Game Redemption
To allow players to redeem purchases in-game, create a package in Tebex and set it up to send the correct command to your FiveM server.
-
Navigate to the Packages Section:
- In Tebex, go to PACKAGES from the left menu and click ADD NEW in the top right.
-
Set Up the Package:
- Enter the title of the product carefully; this title must match the
packageName
defined in your script configuration. - Fill out the package details (price, description, etc.).
- Enter the title of the product carefully; this title must match the
-
Configure the Package to Trigger an In-Game Command:
- In the “Configure what your customers should receive upon purchasing this package” section, select +GAME SERVER COMMANDS.
- Choose your server from the dropdown.
- Click ADD COMMAND and enter the exactly following command
purchase_package_tebex {"transid":"{transaction}", "packagename":"{packageName}"}
- Click the settings icon next to this command, set Game server to Execute On to your server, and select Execute the command even if the player is offline to ensure the command processes regardless of the player’s status.
Once this is set up, whenever a player purchases a package, it will trigger this command on your server, allowing them to redeem their items or currency in-game.
For any issues or questions, open a Ticket at our community and check our IF Official Documentation.
- Standalone
- ESX
- QBCore
|-------------------------------------|----------------------------|
| Code is accessible | No |
| Subscription-based | No |
| Lines (approximately) | +1700 |
| Requirements | Standalone |
| Support | Yes |