Studios
Tebexhouse-3.jpg

Tebex Setup

SoonTebexQbox
PAGE 04 OF 07  ·  CONFIGURATION → TEBEX SETUP → EXAMPLESdocs.glitchstudios.dev
Browse docs

Server key#

Set the secret in server.cfg. You find it in the Tebex panel under Integrations, Game servers:

sv_tebexSecret "your-tebex-secret-key"

Package commands#

Give every package these commands, with "Execute even if the player is offline" ticked:

Tebex tab Command
Initial purchase glitchpackage {id} {transaction} {purchaseQuantity} {packageName}
Renewal (memberships) glitchpackage {id} {transaction} {purchaseQuantity} {packageName}
Chargeback and refund glitchpackage_remove {id} {transaction} {purchaseQuantity} {packageName}
Expiry (memberships) glitchmembership_end {id} {packageName}

The command names are fixed. Then add each package to Config.Packages under the same name it has in Tebex.

A membership is active from its purchase or renewal for Config.MembershipDays. Expiry, refund and chargeback end it straight away. A missed renewal ends it when the days run out.

When a command fails#

  • The transaction code is stored, so a resent command never pays twice.
  • If a command fails part way (for example a database error), the server removes its transaction mark, posts the reason to your log channel and the resend from Tebex starts over. Steps that already happened are skipped.
  • A command for a package that is not in Config.Packages lands in the log and does nothing else.

Older single-reward commands#

These still work for staff and for extra perks:

glitchtokens_add <fivemId> <amount> <code> [quantity]
glitchtokens_remove <fivemId> <amount> <code> [quantity]
glitchperk_add <fivemId> <xpboost|plate|charslot|vip> <amount> <code>
glitchperk_remove <fivemId> <xpboost|plate|charslot|vip> <amount> <code>

For vip the amount is days. A charslot is applied the next time the player joins. A package set up with both glitchtokens_add and glitchpackage pays its tokens once, because they share the code.