OnDiceMatchEnd
A dice match ended - who won, or why it was called off.
The stakes have moved already: the winner holds both, a match called off gave each player theirs back. reason is
"goal", "gave up", "left", "died" or "timeout" when a player won, and "a fight", "walked away",
"failed", "out of step" or "the mode" (an EndDiceMatch without a winner) when it was called off. A player who
leaves the server is still one here: the match ends before OnPlayerDisconnect.
Syntax
Section titled “Syntax”function OnDiceMatchEnd(id, challenger, opponent, winner, reason, bet) -- ...end| Parameter | Type | |
|---|---|---|
id |
number | the match |
challenger |
number | the player who asked for it |
opponent |
number | the other player |
winner |
number | the winner, -1 when the match was called off |
reason |
string | how it ended (above) |
bet |
number | each player’s stake in Groschen |
Example
Section titled “Example”function OnDiceMatchEnd(id, challenger, opponent, winner, reason, bet) if winner >= 0 then SendClientMessageToAll(COLOR_SERVER, string.format("%s won %d Groschen at dice.", GetPlayerName(winner), 2 * bet)) endendSee also
Section titled “See also”OnDiceMatchStart · EndDiceMatch · the Dice group of the index
