Issuing Aircraft via Tebex
Aircraft can be issued to players automatically, even while they are offline. This requires the customer to enter their CSN during purchase on Tebex.
Alternatively, aircraft can be issued for redemption or collection, allowing players to redeem or collect their aircraft after joining the server.
If the player is online, the aircraft will be made collectible or redeemable immediately.
If the player is offline, the aircraft will become collectible or redeemable the next time they join.
Automatic Issuing of Aircraft (Offline Supported)
To automatically add aircraft 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 Aircraft Addition
Create a new Tebex package.
Add an appropriate title, description, and image.
Navigate to the Variables tab.
Configuring the Deliverable (Automatic Aircraft 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 aircraftmodel with the aircraft 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 aircraft will be automatically added to the configured auto-added aircraft garage Config.AutoAddedAircraftGarage . 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 aircraft using the /claim command followed by the Tebex transaction ID.
Example:
The aircraft will then be made collectible or redeemable, depending on your configuration.
Important:
Aircraft must either:
Be redeemable via /redeem, or
Have a configured aircraft collection location set in the script configuration.
Issuing Aircraft for Redemption / Collection Only
If you want aircraft 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 Aircraft 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 aircraftmodel with the aircraft 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 aircraft will be available for redemption via /redeem or collection from a configured aircraft collection location, depending on your script configuration. The player will be notified that this is available in game.