Skip to main content

mCasino.api.slots

Game

mCasino Slots API

Types​

SlotPlayer​

interface SlotPlayer {
ply: Player
amount: number
startTime: number--

Start time of the spin

symbols: {number}--

The spin symbols

reward: number
}

Slot Player

Functions​

paytable​

This item only works when running on the client. Client
mCasino.api.slots.paytable() → DPanel::mCasino_slotsPaytable

Shows the slots paytable

getPlayers​

This item only works when running on the client. Client
mCasino.api.slots.getPlayers() → {SlotPlayer}

Returns the subscribed players

getPlayer​

This item only works when running on the client. Client
mCasino.api.slots.getPlayer(ply: Player) → SlotPlayer?

Returns the slot player information if available

bet​

This item only works when running on the client. Client
mCasino.api.slots.bet(
amount: number--

The amount to bet

) → ()

Attempts to spin, handles amount checking and throws popup if insufficient balance

handleSpinComplete​

This item only works when running on the client. Client
mCasino.api.slots.handleSpinComplete(
ply: Player,--

Casino player

bet: number,--

Bet amount

spinData?: SlotPlayer,
autoSpin: boolean,--

Is auto spin enabled?

onSpin: (shouldSpin: boolean) → (),--

Called if auto spin is enabled, you should check if the panel exists as this can happen in the future

onStatus?: (status: string) → (),--

Updates to status

onWin?: () → ()--

Called when player wins

) → ()

Handles once the spin is complete, handles auto spin and balance check

handleUpdate​

This item only works when running on the client. Client
mCasino.api.slots.handleUpdate(
ply: Player,
lastSpin: number,--

Last spin time

onSpin: (data: SlotPlayer) → (),--

Called if the wheel should spin

onStatus?: (status: string) → ()--

Updates to status

) → ()

Handles the update for client consumption