Browse docs

Coinsystem V2

Installation

Automatic installation of the complete database schema is available from 2.4.5.

Install the current sky_base and configure oxmysql as its SQL adapter. Start the database, framework and configured integrations before these resources:

server.cfg
ensure sky_base
ensure sky_coinsystem

Coinsystem automatically creates missing tables and adds missing columns through Sky.DB.Migrate. The included import.sql describes the same schema for reference or manual preparation; no manual SQL import is needed. Existing player records are retained. The database user needs permission to create and alter tables and to read and write their data.

This database-based version does not require add_filesystem_permission sky_base write sky_coinsystem. Other installed Sky scripts may still need their filesystem permissions.

Updating an existing installation

Back up the Coinsystem tables, replace the resource files, and start the resource. Missing tables and columns are installed automatically, including pending case rewards and Tebex delivery records. Balances, VIP data, redeem codes, stock and discounts remain in their existing tables.

Coinsystem already stores its current persistent data in SQL; it has no legacy JSON data files to import. The old migration.sql for a V1 upgrade is a separate historical migration and is not run automatically.

Configuration

Configure Everything Online
All settings are managed through our config tool

Open Configurator

Commands

Gives coins to a specified player.

/givecoins [playerId] [amount]

Generates a new redeem code with the specified amount.

/gencode [amount]

Generates a new redeem code for the specified vip tier.

/genvipcode [tierId]

Creates a discount for a specific shop product or case. You can edit existing discounts by using this command again.

/discount [productLabel] [percentage] [expiresInHours]
If the label contains spaces, it must be enclosed in double quotes (e.g., "Progen T20")

Exports

Open the Shop Interface.

client.lua
exports.sky_coinsystem:open()

Give coins to a player.

server.lua
exports.sky_coinsystem:giveCoins(playerId, amount)

Remove coins from a player.

server.lua
exports.sky_coinsystem:removeCoins(playerId, amount)

Get coins of a player.

server.lua
exports.sky_coinsystem:getCoins(playerId)

Get the vip tier of a player. Returns the tier id or nil.

server.lua
exports.sky_coinsystem:getVipStatus(playerId)

Custom Rewards

Coinsystem supports custom shop rewards through the shared sky_base/config/sv_functions.lua reward hook.

See Custom Rewards for the full setup guide and examples.


Test Drive Integrations

Coinsystem provides cancelable server blockers, lifecycle events, and a vehicle state bag for test drive integrations.

See Test Drive Events & Blockers for signatures, parameters, end reasons, and examples.


Support

Need help? Our support team is always ready to assist

Join Discord