samp.directory
← Scripts e bibliotecas

billysimonee3328-ops/MiniGame-V1-Feature-System

MiniGame Grid Feature System (Version 1.0.0) with TextDraw for GTA SA-MP

Filterscript★ 1atualizado set. de 2026MITPawn
Abrir no GitHub

README.md

SA-MP / open.mp TextDraw Memory Grid Mini-Game

A dynamic, interactive TextDraw-based mini-game designed for SA-MP and open.mp servers. This mini-game challenges players' memory and reaction speed by hiding target numbers within a constantly shifting grid of numbers.


Author & Credits

  • Developer: Billy Simonee (ANX)
  • Language: Pawn
  • Platform: SA-MP / open.mp

Mechanics & Game System

  1. Target Initialization:

    • Upon initialization via ShowPlayerMiniGame, the system generates 6 unique random numbers assigned as primary targets.
    • Out of these 6 numbers, 3 are randomly selected using the Fisher-Yates Shuffle algorithm to become Hidden Targets.
  2. Transition & Delay Mechanism:

    • During the initial 3 seconds, all target numbers are displayed to allow players time to memorize them.
    • After 3 seconds (DelayHiddenNumberMiniGame), the 3 selected target numbers are masked with "??" and their background boxes turn red (0xFF0000FF).
    • Interactive grid buttons are enabled only after the numbers are hidden.
  3. Dynamic Grid Shuffling:

    • The selection grid (IDs 73–132) constantly re-shuffles its values every 2 seconds via the MiniGameRandomSelect timer.
    • The system automatically injects the 3 hidden target numbers into random slots within the grid during each shuffle, ensuring that a correct option is always present.
  4. Click Detection & Penalties:

    • Correct Selection: Clicking a hidden target reveals its true value and changes the target indicator box color to Green (0x00FF00FF).
    • Incorrect Selection: Clicking a wrong number triggers an error sound (Sound ID 5206), briefly flashes the loading bar red, and applies a time penalty (advancing the loading bar by 5%).
  5. Time Management & Cleanup:

    • A progress bar tracks the remaining time.
    • If time expires or the player disconnects, active timers (LoadingProgressBar, MiniGameNumberSelectRandTimer) are terminated immediately, and array variables are reset to prevent memory leaks.
  • 🧩 Dynamic Grid & TextDraw System: Fully responsive and clean UI constructed using custom TextDraws.
  • 🔀 Randomized Target Shuffling: Automatically generates unique target numbers and randomized positions for each game session.
  • ⏱️ Time Penalty & Bonus Mechanics:
    • Correct Guess (-= 10): Rewards players by restoring/extending the loading progress bar.
    • Wrong Guess (+= 5): Applies a penalty, draining the progress bar faster.
  • 🔊 Audio & Visual Feedback: Dynamic color state changes (green for correct, red for wrong) with native game sound effects.
  • 🛠️ Optimized Pawn Code: Memory-safe execution with proper stack handling and minimal timer overhead.

Dependencies


TextDraw Index Mapping

Index RangeFunction / Component
1 - 60Interactive Transparent Button Layer (Selectable)
61 - 66Target Indicator Boxes (Target Index - 6)
67 - 72Primary Target Number TextDraws
73 - 132Selection Grid Number Displays (Button Index + 72)
134Loading Progress Bar

Usage

  1. Ensure all required includes are present in your server's include folder.
  2. Include the source code within your gamemode or filterscript.
  3. Call the function to display the mini-game to a player:
// Displays the mini-game with a default 60-second limit
ShowPlayerMiniGame(playerid, 60);

// Or execute via the built-in command
CMD:minigame(playerid, params[])
{
    ShowPlayerMiniGame(playerid);
    return 1;
}

Esta página é montada com o que o GitHub publica sobre o repositório. O samp.directory não hospeda o código. Avisar de um problema com esta página

billysimonee3328-ops/MiniGame-V1-Feature-System: Filterscript de SA-MP | samp.directory