> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/vip-shop/tebex-integration/memberships.md).

# Memberships (Subscriptions)

Memberships are monthly, auto renewing Tebex subscriptions. Each tier grants a monthly reward bundle (coins, cash, gold, supplies, ammo, weapons, even a horse) plus a standing, server enforced discount on every coin purchase.

## The default ladder

| Tier              | Billing              | Monthly rewards                                                                         | Store discount |
| ----------------- | -------------------- | --------------------------------------------------------------------------------------- | -------------- |
| Deputy            | Monthly subscription | 500 coins, $250 cash, provisions, 100 revolver rounds                                   | 5%             |
| Marshal           | Monthly subscription | 1,200 coins, $750 cash, 5 gold, medic kit, 200 repeater rounds, a Schofield             | 10%            |
| Legend            | Monthly subscription | 3,000 coins, $2,000 cash, 15 gold, a full ammo crate, a LeMat, a Blood Bay Thoroughbred | 15%            |
| Founder's Charter | One time, lifetime   | One time grant: 2,500 coins and a Golden Turkoman                                       | 10% forever    |

Price each tier however fits your community; the shop reads prices live from Tebex. Tiers, labels, reward bundles and discount rates are all configurable in `Config.Memberships`. See [Memberships and Discounts](/script-documentation/vip-shop/configuration/memberships.md).

## Tebex package setup

Create the three tiers as Subscription (monthly) packages and the Founder as a one time package, all inside the `Passes` category.

Commands per package:

| Event                             | Commands                                                                       |
| --------------------------------- | ------------------------------------------------------------------------------ |
| Purchase and every renewal        | `vipshop_setmembership {sid} deputy 35` plus `vipshop_givetier {sid} deputy`   |
|                                   | `vipshop_setmembership {sid} marshal 35` plus `vipshop_givetier {sid} marshal` |
|                                   | `vipshop_setmembership {sid} legend 35` plus `vipshop_givetier {sid} legend`   |
| Expiry or cancellation (optional) | `vipshop_setmembership {sid} none`                                             |
| Founder (purchase only)           | `vipshop_setmembership {sid} founder` plus `vipshop_givetier {sid} founder`    |

Notes:

* `vipshop_givetier` delivers the tier's whole reward bundle from `Config.Memberships[tier].rewards`, using the same delivery engine as the catalog, so items land in the satchel, weapons in the inventory and horses in the stable.
* `35` is the membership duration in days: 30 days of billing plus a 5 day grace window, so a late renewal never interrupts perks. If a renewal never comes, the membership lapses on its own; the expiry command is an optional accelerator.
* Founder gets no day count, which means lifetime.
* Tick "Require player to be online" on all of these packages. Reward deliveries need the player in game; Tebex holds the command until they connect.

## What the player experiences

* The Outlaw Passes page shows their standing ("Riding as MARSHAL, renews Aug 12") and their tier card is marked ACTIVE.
* Every coin price in the purchase dialog shows the discounted total, the struck through original, and a tier chip such as "Marshal, 10% off".
* The discount is applied server side with `floor(price x (1 - discount) + 0.5)`. The UI merely mirrors it, so it cannot be spoofed.
* The reward bundle arrives with a notification the moment Tebex fires the renewal commands.
* Cancellation and card management happen on the buyer's Tebex receipt page, linked in their purchase email.

## Admin control

```
vipshop_setmembership <serverId|identifier> <deputy|marshal|legend|founder|none> [days]
vipshop_givetier <serverId> <deputy|marshal|legend|founder>
```

Both work from the console or for any player with the `vipshop.admin` ace. If the target is online, their shop UI updates instantly.
