Slot Machine

Full Documentation

Last Updated @ 05/20/2026

Description

Slot Machine is an AMX Mod X plugin that opens a web-styled MOTD slot game inside Counter-Strike 1.6. Players use dedicated Slot Coins to spin a 3-row by 5-column grid, earn rewards from 22 configured paylines, collect cumulative Slot Points, win or receive Free Spins, and compete on a top 10 leaderboard.


The plugin is driven by three config files: slot_machine.ini for commands, access, betting, storage, and jackpot notifications; slot_items.ini for symbols, weights, and rewards; and slot_coins.ini for coin package cards and currency costs.


The MOTD pages stay synced with the game server: the main slot page sends spin requests, the server calculates the grid and rewards, then the page refreshes with the new balance, exact winning-cell mask, reward text, remaining free spins, Slot Points, and player stats.

Core Features

22 Paylines

Each spin builds 3 rows and 5 columns. The server checks 22 paylines, including rows, zigzags, V-shapes, and short branch lines, and highlights the exact winning cells returned by the plugin.

Slot Coins Economy

Slot Coins are the dedicated spin currency. Players buy them from configured packages, spend them on spins, and can win more through symbol rewards.

Slot Points Unlocks

Slot Points are cumulative progression points. Other plugins can require SLOT_POINTS before a player may use selected skins, models, perks, or VIP features.

Free Spins

Free spins can be won from the Free Spin scatter symbol or granted by admin commands and optional add-ons. Slot-won free spins keep the bet that won them; external free spins use FREE_SPIN_BET.

Provider Tokens

The default setup uses CS money for coin purchases and money rewards. Additional currency or reward providers are optional Slot sub-plugins.

Leaderboard

Player records store wins, spins, Slot Coins, Slot Points, free spins, and bet. The leaderboard can sort by coins, points, wins, or name.

Main Slot Page

This is the page opened by /slot, /slots, .slot, or .slots. It displays the player's current Slot Coins, Slot Points, free spins, wins, spins, active bet, and the 3x5 reel grid.


The spin button sends the selected bet to the server. The server checks access state, checks whether the player has a slot-won free spin, externally granted free spin, or enough Slot Coins, subtracts the correct cost, builds the grid, applies rewards, saves stats, then returns the result to this page. The page highlights wins using the exact cell mask returned by the plugin, so paylines and scatter wins are shown accurately.


Regular resolutionMain slot page regular resolution
640x480 resolutionMain slot page 640x480
Non-Steam clientMain slot page non-steam
Bet steps come from BET_STEPS. The Max Bet button selects the highest configured step the player can afford.
Free spin display shows available free spins and uses the right bet source: selected bet for slot-won free spins, FREE_SPIN_BET for external grants.
Navigation links to the info page, coin store, and leaderboard while preserving the player's current state.

Symbols & Rewards Page

This page is opened by /slotinfo, /slotsinfo, /slothelp, or the info button from the main slot page. It reads the active symbols exported from slot_items.ini and shows each symbol icon, name color, reward label, and 3+ / 4+ / 5-match chances.


Only five symbols are shown per page. If you add more symbols to slot_items.ini, the page automatically paginates them and keeps the same back button state so players can return to the main slot without losing their last grid/result view.


Regular resolutionSymbols and rewards page regular resolution
640x480 resolutionSymbols and rewards page 640x480
Non-Steam clientSymbols and rewards page non-steam

What The Info Page Uses

DataSourceShown As
IMAGEslot_items.iniSymbol icon
COLORslot_items.iniSymbol name color
INFO / DESCslot_items.iniReward column text
WEIGHTslot_items.iniDisplayed chance calculations for direct paylines or ALL_OVER scatter symbols

Slot Coins Store

This page is opened by /coins, /slotcoins, /buycoins, or the coin button from the main slot page. It lists packages from slot_coins.ini, shows each package image, Slot Coins amount, cost display, cost color, and whether the current player can afford the package.


When a player clicks a package, the page sends a buy command. The server validates that the package exists, finds the configured currency provider, checks the player's provider balance, subtracts the provider cost, adds the Slot Coins, saves the balance, and returns a buy status to the page.


Regular resolutionSlot Coins store regular resolution
640x480 resolutionSlot Coins store 640x480
Non-Steam clientSlot Coins store non-steam
Default packages are 100, 500, 1000, 2500, 5000, and 10000 Slot Coins.
Default currency is MONEY, supplied by slot_currency_money.amxx.
Unavailable packages are disabled if the matching currency provider is missing or the player cannot afford the cost.

Top 10 Leaderboard

This page is opened by /slot10 or /sl. The plugin reads the top 10 players from the Slot Machine SQL table and sends rows containing nick, Slot Coins, Slot Points, and wins.


The default sort is controlled by LEADERBOARD_SORT in slot_machine.ini. Valid values are coins, points, wins, and nick. The current config sorts by Slot Coins first.


Regular resolutionTop 10 leaderboard regular resolution
640x480 resolutionTop 10 leaderboard 640x480
Non-Steam clientTop 10 leaderboard non-steam
Sort ValueSQL Order
coinsSlot Coins descending, then name
pointsSlot Points descending, then name
winsWins descending, then name
nickName ascending, then Slot Coins

Files Overview

FilePurpose
slot_machine.amxxCore game plugin: commands, storage, spins, rewards, MOTD URLs, and public natives
slot_currency_money.amxxCoin package currency provider using CS money (MONEY)
slot_reward_money.amxxReward provider that pays CS money through the MONEY reward token
slot_machine.iniMain plugin settings: storage, save type, commands, access, bet steps, free spin bet, notifications
slot_items.iniSymbols, icon paths, colors, chance weights, reward labels, and reward definitions
slot_coins.iniSlot Coin package cards, costs, currency tokens, display text, colors, and coin images
SlotMachine.txtLanguage file used by the in-game messages and MOTD labels
plugins-slots.iniAll optional Slot sub-plugin entries are added here

Main Config - slot_machine.ini

slot_machine.ini controls storage, commands, access, betting, free spins, leaderboard sorting, and jackpot chat notifications.


slot_machine.ini configuration preview
KeyCurrent ValueMeaning
STORAGE_TYPEsqliteUse local SQLite storage. mysql uses the AMXX SQL settings from sql.cfg.
SAVE_TYPEnickPlayer key used for storage. Supported: nick, ip, steamid.
LEADERBOARD_SORTcoinsDefault leaderboard order.
BET_STEPS50, 100, 250, 500, 1000, 2000, 3000, 5000Allowed bet values. The first value is the minimum/default bet; the last value is the maximum bet.
FREE_SPIN_BET500Bet value used when a player consumes an externally granted/admin free spin. Free spins won from the reels keep the player's selected bet from the winning spin.
ACCESS_STATEDEADWho may open/spin: ALIVE, DEAD, or BOTH.
ACCESS_FLAGemptyOptional AMXX flag required to open Slot Machine pages. Empty means everyone can use it.
JACKPOT_NOTIFY1Broadcast a chat message when the jackpot symbol fills all 5 cells in a row.
JACKPOT_SYMBOLSevenSymbol section name from slot_items.ini used for jackpot notification.
CHAT_PREFIX^4[Slots]^1Prefix used for Slot Machine chat messages.

Commands From slot_machine.ini

Config KeyCurrent CommandsOpens / Does
MAIN_COMMANDS/slot, /slots, .slot, .slotsMain Slot Machine page
COIN_COMMANDS/coins, /slotcoins, /buycoinsSlot Coins store
INFO_COMMANDS/slotinfo, /slotsinfo, /slothelpSymbols, rewards, and chance page
LEADERBOARD_COMMANDS/slot10, /slTop 10 leaderboard
POINT_COMMANDS/sp, /slotpointsPrint current Slot Points in chat

Storage From slot_machine.ini

The plugin stores wins, spins, Slot Points, Slot Coins, free spins, current bet, nick, SteamID, IP, and last seen timestamp in slot_machine_players.


SettingHow It Works
STORAGE_TYPE = sqliteCreates/uses a local SQLite database named slot_machine. This is the default mode.
STORAGE_TYPE = mysqlUses the AMXX SQL settings from configs/sql.cfg and creates the same player table if missing.
SAVE_TYPESelects the player key: nick, ip, or steamid.

Core Admin Console Commands

CommandAccessDescription
sm_give_points <name/id> <amount>ADMIN_RCONAdd or remove Slot Points
sm_give_coins <name/id> <amount>ADMIN_RCONAdd or remove Slot Coins
sm_reset_points <name/id>ADMIN_RCONReset Slot Points to 0
sm_give_wins <name/id> <amount>ADMIN_RCONAdd recorded wins
sm_reset_wins <name/id>ADMIN_RCONReset wins and spins
sm_give_spins <name/id> <amount>ADMIN_RCONGive free spins

Symbols & Rewards - slot_items.ini

Each section in slot_items.ini is one reel symbol. The section name becomes the display name, IMAGE points to the MOTD icon, COLOR controls the display color, WEIGHT controls the target 3+ chance, and REWARD defines what the player receives for 3, 4, or 5 matches. Regular symbols are paid from the first matching cells on a payline; ALL_OVER symbols pay when 3+ copies appear anywhere on the 3x5 grid.


slot_items.ini symbols and rewards configuration preview
COINS rewards are Slot Coin bet multipliers. With a 500 bet, COINS[2,5,12] pays 1000, 2500, or 6000 Slot Coins.
HP, ARMOR, Slot Points, and provider rewards scale from the minimum bet using bet / first BET_STEPS value and round up.
Optional caps like :200 cap the final HP, armor, Slot Coin, or provider balance after reward application.
ALL_OVER / scatter symbols are limited to one copy per reel and can pay even when they are not on a payline.
Current SymbolWeightReward
Cherries15COINS[2,5,12]
Lemon10MONEY[200,500,1000] + ARMOR[5,10,20]:200
Grape5SLOT_POINTS[1,3,8]
Bell3COINS[3,8,20] + XP[5,15,40] + HP[5,10,20]:150
Seven1COINS[8,20,50] + SLOT_POINTS[5,15,50]
Free Spin2ALL_OVER = 1, FREE_SPIN[5,8,13]

Any reward token outside the core Slot rewards and the default MONEY reward should come from an optional Slot reward provider sub-plugin.

Coin Packages - slot_coins.ini

Each package section name is the Slot Coins amount the player receives. The default package setup uses the MONEY currency provider. Other currency providers are optional Slot sub-plugins.


slot_coins.ini coin packages configuration preview
KeyMeaning
COIN_IMAGEMain Slot Coin icon used in MOTD headers and amount labels.
IMAGEPackage card image.
COSTHow much provider currency the package costs.
COST_TOKENCurrency provider token. Must match a loaded slot_currency_*.amxx provider.
COST_DISPLAYText shown on the coin store card. Supports <value> placeholder.
COST_COLORCost text and card accent color.

Providers & Public API

The default setup uses CS money for both buying Slot Coins and paying money rewards. Additional currency or reward providers are optional Slot sub-plugins and should be listed in amxmodx/configs/plugins-slots.ini.


Currency Provider Publics

public slot_currency_token(output[], len)
public slot_currency_get(id)
public slot_currency_subtract(id, amount)

Currency providers are used only by slot_coins.ini package costs. The default provider is MONEY from CS money. Other tokens are supplied by optional Slot sub-plugins.

Reward Provider Publics

public slot_reward_token(output[], len)
public slot_reward_get(id)
public slot_reward_add(id, amount)

Reward providers are used in slot_items.ini reward fields. The default reward provider is MONEY, so a symbol can include MONEY[200,500,1000]. Other reward tokens come from optional Slot sub-plugins.

Public Natives

NativeDescription
slot_get_user_points(id)Returns cumulative Slot Points.
slot_give_user_points(id, amount)Adds or removes Slot Points, clamped at 0.
slot_get_user_coins(id)Returns current Slot Coins.
slot_give_user_coins(id, amount)Adds or removes Slot Coins, clamped at 0.
slot_get_user_free_spins(id)Returns stored free spins.
slot_give_user_free_spins(id, amount)Adds or removes free spins, clamped at 0.
slot_get_user_wins(id)Returns total winning spins.
slot_get_user_spins(id)Returns total spins played.

Sub-Plugins

Slot Sub-Plugins Page

Optional Slot add-ons, extra currency providers, extra reward providers, admin tools, gifts, activity rewards, and perk integrations are kept on the Slot sub-plugins page.


Add every optional Slot sub-plugin entry in amxmodx/configs/plugins-slots.ini, then restart or change map so AMXX loads the add-on with the Slot Machine library.


Open Slot Sub-Plugins

ChatManager Tags

crx_chatmanager.sma reads the Slot Machine library and replaces these placeholders when the library is available:


$slot_coins$ - current Slot Coins balance from slot_get_user_coins
$slot_points$ - cumulative Slot Points from slot_get_user_points
$slot_wins$ - total winning spins from slot_get_user_wins
"^4[$slot_coins$ coins | $slot_points$ pts]^1 ^3%name%^1 : %message%"

You can also create selectable custom tags in ChatManager's [Chat Tags] section and lock them behind Slot Points.


[Chat Tags]
"slotpoints" "500" "[Slots]"

This example unlocks the [Slots] chat tag for players with at least 500 Slot Points.

Troubleshooting

SymptomWhat To Check
/slot does not openConfirm MAIN_COMMANDS contains the command, ACCESS_STATE matches the player's alive/dead state, and ACCESS_FLAG is empty or the player has the configured flag.
Coin store has missing/disabled packagesCheck slot_coins.ini package sections and make sure each COST_TOKEN has a loaded slot_currency_*.amxx provider.
Coin purchase failsThe player may not have enough provider currency, or the provider public slot_currency_subtract is missing/failing.
Symbol list is outdatedslot_items.ini is loaded at startup. Restart or change map after editing symbol/reward configuration.
Rewards do not appearMake sure reward tokens in slot_items.ini match core rewards or optional provider sub-plugins loaded from plugins-slots.ini.
Optional provider rewards do nothingConfirm the matching Slot reward provider sub-plugin is loaded and that its dependency plugin is running.
HP/armor reward won while deadThis is expected. The plugin queues HP and armor and applies them after the player's next real spawn.
Chat placeholders stay unchangedConfirm ChatManager has Slot placeholders enabled and the Slot Machine library is loaded.

Need Help?

Need help tuning odds, rewards, coin packages, providers, or add-ons? Reach out and I can help wire it cleanly for your server economy.