question

Anisimov Arthur avatar image
Anisimov Arthur asked

Premium Account System

Hi

I want to implement a premium system where a player can buy "premium" for X days with virtual currency.

How I think to implement this:
1) Run a CloudScript when a user request a purchase;
2) In CloudScript override UserReadOnlyData with value when the premium ends;

The question is what is the best way to store "premium item" in Economy Catalog to receive data about name, cost? I don't need to store it in inventory so I have to delete it when a player bought it. I can't use Bundle because Bundle must have content inside.


Or is there a better way to implement a premium?


Thanks

Account Management
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Sure, set up the item in the catalog to be consumable by time, with the period being the period of the subscription. Set it with a Time Group Name, so that if the player purchases another one, it adds that to the subscription timeout. So, if it's 3 days, and they buy two, they'll have 6 days - or you can have different subscription periods like 3 days, 7 days, etc., all sharing the Time Group Name, so that if they buy 3 days, then when they're down to 1 day they buy 7 days, they'll then have 8 remaining.

You'd then check that the player has the item in inventory as the way to check if they have the subscription.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.