Skip to main content

mCasino.api.coinflip

Game

mCasino Coinflip API

Types​

CoinflipItem​

interface CoinflipItem {
type: number
value?: number
}

Coinflip Item

CoinflipPlayer​

interface CoinflipPlayer {
ply: Player
ply_sid: string--

Player SteamID

items: {CoinflipItem}
}

Coinflip Player

Functions​

handleUpdate​

This item only works when running on the client. Client
mCasino.api.coinflip.handleUpdate(
data: {},--

The game data received from the lobby

onPlayer: (
index: number
) → (),--

Called on every player

onStart?: () → (),--

Called when the game starts

onFlip?: () → (),--

Called when the flip starts

onWin?: (flip: boolean) → ()--

Called when the game has finished

) → ()

Calculates and processes crash update for client consumption

calculatePercentage​

This item only works when running on the client. Client
mCasino.api.coinflip.calculatePercentage(
data: {}--

The game data received from the lobby

) → (
number,
number
)--

Player 1 & 2 percentages

Calculates the percentages of item values