Issuing Cars via Tebex
Cars can be issued to players automatically, even while they are offline. This requires the customer to enter their CSN during purchase on Tebex.
Alternatively, cars can be issued for redemption or collection, allowing players to redeem or collect their vehicle after joining the server.
If the player is online, the car will be made collectible or redeemable immediately.
If the player is offline, the car will become collectible or redeemable the next time they join.
Automatic Issuing of Cars (Offline Supported)
To automatically add cars while a player is offline, the customer must enter their CSN when purchasing the Tebex package. This requires the CSN to be configured as a variable in your Tebex store.
I personally don't like this approach as customers often make errors when entering their CSN but this script does have a fallback when a customer enters an invalid CSN (outlined below). I recommend issuing for redemption / collection but I've included this option should you wish to use it.
Creating the Tebex Package for Automatic Addition
Create a new Tebex package.
Add an appropriate title, description, and image.
Navigate to the Variables tab.
Configuring the Deliverable (Automatic Addition)
Select Game Server Commands.
Under Game Servers, select your game server.
Command Configuration
Under When the package is purchased, enter a variation of the following command:
Replace carmodel with the vehicle spawn name.
Additional Settings
Game Server to Execute On:
Select your server
Require Player to Be Online:
Save and publish the package.
Once published, customers will be prompted to enter their CSN during purchase, and the vehicle will be automatically added to the configured Config.AutoAddedVehicleGarage. If the player is online they'll be notified of this in game.
Fallback: Invalid CSN Handling
If a customer enters an invalid CSN during purchase:
The script will automatically detect the issue.
The purchase will be added to the tebexfailed table in your database.
Claiming a Failed Purchase
The player can manually claim the vehicle using the /claim command followed by the Tebex transaction ID.
Example:
The vehicle will then be made collectible or redeemable, depending on your configuration.
Important:
Vehicles must either:
Be redeemable via /redeem, or
Have a configured collection location set in the script configuration.
Issuing Cars for Redemption / Collection Only
If you want vehicles to be issued only for redemption via /redeem or collection from a configured location, the CSN variable is not required. Customers will not need to enter their CSN during purchase.
Creating the Tebex Package for Redemption / Collection
Create a new Tebex package.
Add an appropriate title, description, and image.
Add a Game Server Commands deliverable.
Under Game Servers, select your game server.
Command Configuration
Under When the package is purchased, enter a variation of the following command:
Replace carmodel with the vehicle spawn name.
Additional Settings
Game Server to Execute On:
Select your server
Require Player to Be Online:
Save and publish the package.
Once published, the vehicle will be available for redemption via /redeem or collection from a configured location, depending on your script configuration. The player will be notified that this is available in game.