Donator Shop
Step by step installation guide, common issues & solutions, code snippets, error codes, config previews, locales previews, SQL previews, and changelogs; all in 1 easily accessible place.
Buy Here

1. Unzip the cd_donatorshop.zip folder and place this folder in your servers resource folder.
2. Add the resource to your server start config: ensure cd_donatorshop (it must be placed anywhere below your framework resource eg., es_extended, not above). The name of the folder must not be changed or the resource will not function correctly.
3. WARNING do not edit the encrypted files in any way.

ALL EXISTING CUSTOMERS WHO WERE USING PREVIOUS VERSIONS ON ESX MUST FOLLOW THE 2 STEPS BELOW:
  • In the cd_donatorshop database table replace the char1: with license: or steam: depending on what your Config.IdentifierType is set to in the config.lua.

You MUST import the SQL file to your database. This SQL file is located inside theREAD_ME_AFTER_PURCHASING folder, the file is named SQL_main.sql. Watch this video if you are unsure how to do this HeidiSQL / PHPMyAdmin.

You may need to make some changes to the fxmanifest.lua, depending on your framework and dependencies. We have made this easier for you by commenting on the lines which you may need to change.

You MUST read all of the configurable options inside the config.lua and configure them to suit your server's needs. Please read the ”commented out help text” at the end of each line so you can understand what each option does so you know if you need to change it or not.
The most important sections are the options under the Framework and Important sections at the top of the config.lua. Everything else is optional.

Open the dependencies folder. The sub-folders inside will be the required dependencies. There will be a text file inside each sub-folder which includes a GitHub link. Download the dependencies from our GitHub using the links provided. Then add it to your resources folder.

Create your game server on your Tebex Webstore to generate your secret key. Watch this Video Guide if you have not done this before.
Below is some important information from the Video guide above.
sv_tebexSecret CHANGE_ME
Paste the ConVar above into your server config along with your Tebex Secret Key.

Create a product on your Tebex Webstore and use the command we have provided below. Watch this Video Guide if you have not done this before.
Below is the command we speak about in the video.
tebex_purchase {"transaction_id":"{transaction}", "package":"{packageName}", "date":"{time} {date}", "buyer_name":"{purchaserName}", "buyer_email":"{email}"}
Subscriptions: To allow compatibility with monthly subscriptions read here - #Subscriptions.

The name of the product on your tebex webstore MUST be exactly the same as the ProductName inside the Config.TebexListings table in the configs/config.lua. The amount is the number of coins a player will receive when they purchase this product.
The product name on your Tebex Webstore.
The product name in the Config of cd_donatorshop.

You can add or remove products in the Config.Shop config table in the configs/config.lua. There are commented-out examples at the bottom of the config.lua that will explain everything you need to know in order to create custom products that your server can sell in-game. You can also remove or add more products on the in-game shop UI.
If you are using QBCore and wish to sell "character name changes" or "phone number changes" in your shop UI, you must add this code snippet below into qb-core/server/player.lua.
RegisterServerEvent('cd_donatorshop:UpdateCharInfo')
AddEventHandler('cd_donatorshop:UpdateCharInfo', function(source, action, data)
if action == 'charname' then
QBCore.Players[source].PlayerData.charinfo.firstname = data.firstname
QBCore.Players[source].PlayerData.charinfo.lastname = data.lastname
elseif action == 'phone' then
QBCore.Players[source].PlayerData.charinfo.phone = data.phone
end
QBCore.Player.Save(source)
QBCore.Players[source].Functions.UpdatePlayerData()
end)

When a player has purchased a product from your tebex webstore, tebex will trigger a chat command on your server within 2-10 minutes to log the purchase information to your database. After this is done, the player can do the following chat command in-game - /redeem (tebex_transaction_id_here) , which will then save the player's donator coins to the database and they will be available to spend.

To allow compatibility with reoccurring/monthly subscriptions; simply repeat the final part of #Step 6 where you add a command, but on the 2nd command change when the command is sent - as seen in this screenshot. This will automatically add the same amount of donator tokens to a player when their subscription renews.

Add the 3 files in the download below into your zdiscord/server/commands folder. Then you can use the bot commands below in your discord. This is currently QBCore only unless you modify the code.
/pointlist [cid]
/pointadd [cid] [points_to_add]
/pointremove [cid] [points_to_remove]
commands.rar
3KB
Binary
credits to #sudokill9#2754

All of these chat commands can be renamed and disabled/enabled in the config/code.
The exact usage for each command will be displayed in the chat suggestions when using the commands.
Command
Example
Description
/redeem
/redeem tbx-8832421a77453-etd002
The command to redeem donator coins after their purchase.
/add_balance
/add_balance 1 10
(Staff Command) The example command will add 10 donator coins to id 1.
/remove_balance
/remove_balance 2 20
(Staff Command) The example command will remove 20 donator tokens from id 2.

These exports are completely optional, you can use them if needed.
server-side-exports
Get Balance
Returns a players balance (numberm).
exports['cd_donatorshop']:GetBalance(source)
Add Balance
Adds tokens to a player.
exports['cd_donatorshop']:AddBalance(source, amount)
Remove Balance
Removes tokens from a player.
exports['cd_donatorshop']:RemoveBalance(source, amount)
Can Purchase Check
Checks if a player can afford to make a purchase.
exports['cd_donatorshop']:CanPurchaseCheck(source, cost)

Please check out our Troubleshooting Guide before contacting our support.
🔔 Folder Name Make sure the name of the folder is cd_donatorshop.
Can’t Redeem a Purchase? Has a player has made a purchase on your tebex store and the purchase is still not able to be redeemed in game after 10 minutes?
SQL Unknown Column? Do you see an SQL error in the server console similar to this example - ER_BAD_FIELD_ERROR: Unknown colum 'job_personalspawn' in 'where clause'?
Tebex Secret Key? Do you see this authentication error In your server console [cd_donatorshop] - Unable To Start (sv_tebexSecret is nil)?

If you see an error code which isn't listed below please open a script support ticket in the Codesign Discord.
Server
Client
0886 - The GetIdentifier function in the configs/server_customise_me.lua is returning a nil value instead of a string containing the player's identifier.
4454 - This means a player is trying to use the "tebex_purchase" command manually, and that command is only supposed to be triggered by tebex when a player makes a purchase.
7742/7784 - This could mean either you are triggering the "tebex_purchase" from the console, which you shouldn't be? Or tebex is not sending the correct data due to step 2 not being completed correctly.
N/A

Files Changed: Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.
  • All Files - This means you should delete your old cd_donatorshop folder, download and add in the latest version, reconfigure the configs folder and restart your server.
  • Specific Files - This means you can simply copy and paste the SPECIFIC new files over the old ones and restart the server.
Update Type: On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.
  • Mandatory - This means you MUST update to this new version or the old versions will no longer work.
  • Optional - This means its completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.
v1.0.0
v4.0.0
v4.0.1
v4.0.2
v4.0.3
v4.0.4
v4.0.5

v1.0.0 - v1.0.5
Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
STATUS
  • Development Stage: COMPLETE
  • Alpha Test Stage: COMPLETE
  • Beta Test Stage: COMPLETE
Add
  • Added ability to blacklist words in the plate change.
  • Added locales for the identifiers UI.
  • Added a server print to notify server owners when a purchase has been made.
  • Added a new shop product - Character Name Changes. There are several checks put in place to make sure players enter a first and last name and it also checks for blacklisted words.
  • Added a new shop product - Vehicle packs. Meaning full vehicle packs can be configured and sold through the main shop UI. Also added extra protection against lua injectors with discord webhooks.
  • Added a computer desk at the location of the donator shop UI to mark its location.
  • Added the ability to manually place each donator vehicles coords instead of the script automatically generating the coords. This is a config option so it can be toggled.
  • Added the ability to set a maximum allowed character slot limit in the config when using the Codesign Multicharacter script.
  • Added discord logs to the staff add/remove token command.
Edit
  • Notifications on the UI now stack.
  • Success notifications on the UI now display more info after a purchase has been made successfully.
Fix
  • Fixed vehicle plate change bug when not using cd_garage.
  • Fixed notification typo on the staff add/remove balance command.
  • Fixed esx perms check typo.
  • Fixed random linux crashing bug.
  • Fixed the purchase command so players cant use it.
  • Fixed missing locale for the item rewards on the UI notification.
  • Fixed the total cost when purchasing multiple character slots.
  • Fixed a random bug where you would see an visual error when exiting the donator shop referring to "VehicleTable".
  • Fixed various typos in the locales.lua.
  • Fixed bug where you could purchase a product with 0 quantity chosen and you would see the "NaN" error.
  • Fixed a typo in the previous version causing the 7784 error code.
  • Fixed the date not saving in the cd_donatorshp_logs database table.
  • Temporary fix for the canary issue until the new Tebex FiveM license system is ready to launch, when this is released we will be fully switching over to the new system.

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Authentication
  • We are now using the official Authentication System provided by FiveM. The old auth system will be taken offline 1 week from now (give or take a few days if needed).
Add
  • Added drag-and-drop compatibility with the QBcore framework.
  • Added support for oxmysql.
  • Added duplicate checks to make sure players cant change their phone number to one that already exists.
  • Added server exports to check, get and remove donator points from the database from other scripts.
  • Added a config option to use steam or license as a, identifier type.
Edit
  • Cleaned up the code a little bit to be easier to understand for newer developers.
  • Added a new get identifier type, (1 for the unique characters id and 1 for the players global id) so servers using the advanced multicharacter method can redeem and use their donator perks across all of their characters.
  • Reworked the vehicle related code to work with the new garage v4.0.0 update.
  • Allowed ability for you to choose which identifiers display on the shop UI.
Fix
  • Fixed a bug with the inside vehicles not deleting when you purchasing a car pack.
  • Fixed the version check from erroring when github is having issues.
  • Fixed a bug where if you had 5 tokens and you purchased a product for 10 tokens it would not send a error message informing the player they don't have enough tokens.
  • Fixed the bug where the display vehicles would show model names instead of labels from the config.
  • Fixed the blacklisted word check not checking correctly when the word was capitalized.
  • Fixed the bug where players could change the plate even if the new plate was nil.
  • Fixed the bug where when purchasing a character slot the new max_chars number in the database turned into a float instead of an integer.
  • Fixed the bug where if you had a product on your Tebex store named $100,000 and another product named $100,000,000 and a player redeemed the $100,000,000 product, it would give the amount of tokens for the $100,000 product instead of the $100,000,000 one.
  • Fixed the item/weapon spawn names from showing on notifications instead of the labels.

Files Changed:
  • All files
  • Specific Files
fxmanifest.lua - (IMPORTANT)
server/server.lua - (IMPORTANT)
server/reward_players.lua
client/functions.lua
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added accurately translated locales - 'CZ' / 'ES' / 'FI' / 'FR' / 'NL' / 'SE' / 'SK'
Fix
  • Fixed an issue with multiple products being purchased from Tebex not adding the correct donator coins amount to player.
  • Fixed the wrong data being saved in database when using QBCore.
  • Fixed a bug with car pack purchases.

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Edit
  • Logs from the UI purchases will send a lot faster after a purchase is made.
Fix
  • Fixed the balance showing as NaN on the UI.
  • Fixed the undefined message on the UI's checkout page when adding 0 amount.
  • Fixed a potential exploit when purchasing a vehicle while items are still queued and being purchased from the UI.
  • Fixed an issue with the UI purchase logs not showing the correct total amount.

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added the ability to test drive display vehicles with the option choose how long they can test drive them for, option to spawn test vehicles max, option to only allow players to test drive vehicles if they enough tokens to purchase them and the option to disable it completely.
  • Added compatibility with the new oxsql version.
  • Added new locales in lua and js.
Edit
  • You now need to press E twice to purchase a display vehicle to make sure people don't accidently purchase.
Fix
  • Fixed openPage error randomly showing up.
  • Fixed the prop table spawning in the air.
  • Fixed weapons not having serial numbers on QBCore.

Files Changed:
  • All files
  • Specific Files
fxmanifest.lua - (IMPORTANT)
configs/server_customise_me.lua
client/functions.lua
Update Type:
  • Mandatory
  • Optional
Changelog:
Fix
  • Fixed people being able to abuse the test vehicle by giving the vehicle to another player.
  • Fixed QBCore perms.

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Edit
  • Cleaned up the code and reshuffles some files.
  • Updated the locales.
Fix
  • Fixed an issue when purchasing extra multicharacter slots.
Copy link
On this page
START HERE
INSTALLATION GUIDE
Step 0 - For existing customers
Step 1 - Insert the SQL
Step 2 - Fxmanifest
Step 3 - Configure the resource
Step 4 - Install the dependencies
Step 5 - Create Game Server
Step 6 - Create a Product
Step 7 - Config.TebexListings
Step 8 - Customise the UI
Step 9 - Redeem a Purchase
OPTIONAL
Subscriptions
zdiscord Integration
INFORMATION
Chat Commands
Exports
COMMON ISSUES
ERROR CODES
CHANGELOG