Giving vouchers
Admins give vouchers with /hc give (one player) or /hc giveall (everyone online). Both work from the console, so Tebex package commands can run them.
/hc give <player> <GIFTCARD|COUPON> <amount> [template] [time|infinite] [key:value ...] [-s]
/hc giveall <GIFTCARD|COUPON> <amount> [template] [time|infinite] [key:value ...] [-s]
Everything after the amount is optional and can be in any order:
- template: a template name from
templates.yml. Default isdefault. Tab-complete lists the templates for the voucher type. - time: when the voucher expires, as
30m,12h,7d,2w, or a plain number of days.infinite(ornever) means no expiry, which is the default. - discount:value or discount:percentage (coupons): fixed amount off, or percentage. Defaults to
coupon-settings.discount_type. - effective_on:name (coupons): limit the coupon to a package or category using the names from your store. Separate several with commas. Names are tab-completed from the Tebex cache.
- -s (or
silent): give the voucher without the chat message to the player.
Examples#
/hc give Steve GIFTCARD 10
/hc give Steve GIFTCARD 25 premium 30d
/hc give Steve COUPON 10
/hc give Steve COUPON 10 flash 7d effective_on:vip
/hc give Steve COUPON 5 default discount:value
/hc giveall GIFTCARD 5 holiday 24h
Rules the plugin checks#
- Amounts must be greater than 0.
- A percentage coupon cannot be more than 100.
- A gift card voucher cannot be worth more than $495, because Tebex rejects larger gift cards.
- The template must exist, and unknown package or category names are rejected. Run
/hc refreshafter adding a package to your store.
If the player is offline, the voucher waits for them in /giftcards claim and they are told when they join.
From a Tebex package#
Add a game server command to the package, for example:
hc give {username} GIFTCARD 10
hc give {username} COUPON 15 default 7d effective_on:vip_rank
Instant claim
With instant-claim: true, no item is given. The code is created right away and goes straight into the player's /giftcards menu.