Skip to main content

mCasino.api.crash

Game

mCasino Crash API

Types​

CrashPlayer​

interface CrashPlayer {
ply: Player
ply_sid: string--

Player SteamID

amount: number
cashout: number--

Auto cashout amount

profit?: number
cashoutFinal?: number
cashedOut?: boolean
lost?: boolean
}

Crash Player

Functions​

handleUpdate​

This item only works when running on the client. Client
mCasino.api.crash.handleUpdate(
panel: DPanel,--

The panel the update is being called to

onPlayer: (ply: CrashPlayer) → (),--

Called on every player

onLocalPlayer?: (ply?: CrashPlayer) → (),--

Returns the local casino player if found

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

Updates to status

onWin?: () → ()--

Called when player wins

) → ()

Calculates and processes crash update for client consumption

shouldStart​

This item only works when running on the client. Client
mCasino.api.crash.shouldStart(
lastState: string--

The last state before this update

) → boolean

Checks whether the crash graph should start

shouldFinish​

This item only works when running on the client. Client
mCasino.api.crash.shouldFinish(
lastState: string--

The last state before this update

) → boolean

Checks whether the crash graph should finish

bet​

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

The amount to bet

cashout: number--

The auto cashout amount

) → ()

Attempts to place a bet, handles state, amount checking and throws popup if insufficient balance

getPlayers​

mCasino.api.crash.getPlayers() → {CrashPlayer}

Returns the players for the game

getStates​

mCasino.api.crash.getStates() → {string}

Returns the states for the game

getState​

mCasino.api.crash.getState() → string

Returns the current state for the game

getValue​

mCasino.api.crash.getValue() → number

Returns the target value of the crash

getCurrentValue​

mCasino.api.crash.getCurrentValue() → number

Returns the current multiplier of the game

game​

INTERNAL
mCasino.api.crash.game() → {}

Returns the internal game table, the contents of this table may change in updates