CityRP Documentation Repository

core.plugins.holdem.sh_cards

Deck generation and 7-card Texas Hold'em hand evaluation. Evaluates the best 5-card hand from up to 7 cards (hole + community).

Functions

Sharedholdem.generateDeck() → string[]Source ☍

Build a fresh 52-card deck and Fisher-Yates shuffle it.

Returns

  1. string[]
Sharedholdem.getBestHand(cardIds) → table|nilSource ☍

Find the best 5-card hand among all combinations of the given cards.

Parameters

  • cardIdsstring[]2 to 7 card ids

Returns

  1. table|nil
Sharedholdem.getHandText(hand) → stringSource ☍

Human-readable hand description.

Parameters

  • handtable

Returns

  1. string
Sharedholdem.handBeats(a, b) → booleanSource ☍

Compare two hand results. Returns true if a beats b.

Parameters

  • atable
  • btable

Returns

  1. boolean
Sharedholdem.handsEqual(a, b) → booleanSource ☍

Returns true if hands are equal in rank.

Parameters

  • atable
  • btable

Returns

  1. boolean
Sharedholdem.parseCard(id) → number|nil, string|nilSource ☍

Parse "HA" / "C10" style card ids into rank value + suit.

Parameters

  • idstring

Returns

  1. 1number|nil
  2. 2string|nil
Sharedholdem.pickWinners(entries) → table[]Source ☍

Pick winners from a list of {ply=, hand=} entries.

Parameters

  • entriestable[]

Returns

  1. table[]