Repository navigation
Home
A reusable shell-game include for open.mp gamemodes. It uses Incognito's Streamer, supports runtime-created tables and unlimited levels, and keeps every player's shells, ball, selector, state, and result private.
Requirements:
- open.mp
- Streamer plugin and
streamer.incfrom the same release - Pawn 3.10.11 or a compatible compiler.
Copy shellgame.inc into your compiler's include path:
#include <open.mp>
#include <streamer>
#include <shellgame>new gShellTable = INVALID_SHELLGAME_TABLE;
public OnGameModeInit()
{
gShellTable = ShellGame_CreateTable(
1465.7506, -1661.7269, 13.4512,
90.0,
0,
-1
);
if (gShellTable == INVALID_SHELLGAME_TABLE)
{
return 0;
}
ShellGame_SetTableEconomy(gShellTable, 100, 2.0);
ShellGame_SetTableLevels(gShellTable, 1, SHELLGAME_UNLIMITED);
return 1;
}The default capacity is one active player per table. Use:
ShellGame_SetTableCapacity(gShellTable, SHELLGAME_UNLIMITED);to allow unlimited simultaneous sessions.
Dealer warning: there is one shared dealer actor per table. With capacity
0(unlimited) or greater than1, its animation cannot be synchronized separately to the second and later players' private shuffles.
| Action | Input |
|---|---|
| Start / confirm / continue | ENTER |
| Move selector | Left / right |
| Stop after a win | SPACE |
If no valid quote is displayed, the first ENTER shows one and the next accepts that exact stake and return.
stake = $100 x level
shuffle movements = 4 + (level - 1)
movement duration = max(50 ms, 400 ms / (1 + 0.12 x (level - 1)))
feint chance = 5% per movement
win return = stake x 2.0
maximum level = unlimited
The ball object is destroyed after the preview shell closes. It does not exist during shuffling or selection, so transparent-shell mods cannot reveal it. The server tracks an immutable ball-shell identity and logical slot permutation, then recreates the ball only after the choice or timeout is locked.
See API Reference for configuration, functions, callbacks, and custom economies.
Documentation note: This documentation was prepared with assistance from an LLM and manually reviewed. Mistakes can still happen. If you find an error, please open an issue in the repository with the relevant page and suggested correction.