57 lines
1.6 KiB
Markdown
57 lines
1.6 KiB
Markdown
# poker.js — poker_handler() (satır 546)
|
||
|
||
[← poker.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
Parça 6/6 · [önceki](poker_handler-5.md)
|
||
|
||
```javascript
|
||
"/say §eEl sona erdi. " + table.name + " yeni el için bekliyor."
|
||
);
|
||
saveLobbyData(c, lobby);
|
||
refreshTablePlayers(c, tableId);
|
||
}
|
||
return;
|
||
}
|
||
|
||
// BAHİS / GÖRME
|
||
if (lastAction === "btn_bet") {
|
||
if (table.state === "playing" && table.players[table.turn_index].name === playerName) {
|
||
var betAmount = uiData.getDouble("bet_input");
|
||
var pIndex = getPlayerIndex(table, playerName);
|
||
|
||
if (betAmount <= table.players[pIndex].money) {
|
||
table.players[pIndex].money -= betAmount;
|
||
table.players[pIndex].bet += betAmount;
|
||
table.pot += betAmount;
|
||
|
||
c.executeCommand(
|
||
"/say §a" + playerName + " §f$" + betAmount + " §abahis yaptı/gördü."
|
||
);
|
||
|
||
passTurn(table);
|
||
saveLobbyData(c, lobby);
|
||
refreshTablePlayers(c, tableId);
|
||
} else {
|
||
player.send("§cYeterli paran yok!");
|
||
}
|
||
}
|
||
return;
|
||
}
|
||
|
||
// ÇEKİLME (FOLD)
|
||
if (lastAction === "btn_fold") {
|
||
if (table.state === "playing" && table.players[table.turn_index].name === playerName) {
|
||
var pIndex = getPlayerIndex(table, playerName);
|
||
table.players[pIndex].folded = true;
|
||
|
||
c.executeCommand("/say §c" + playerName + " çekildi (Fold).");
|
||
|
||
passTurn(table);
|
||
saveLobbyData(c, lobby);
|
||
refreshTablePlayers(c, tableId);
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
```
|