> For the complete documentation index, see [llms.txt](https://0grav1ty.gitbook.io/zerogravity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0grav1ty.gitbook.io/zerogravity/scripts/pin-code-minigame.md).

# PIN Code Minigame

## Overview

<figure><img src="/files/TOZCKPbeGqYgPKVjGMNq" alt=""><figcaption></figcaption></figure>

The **PIN Code Minigame** is designed for GTA V FiveM servers. It challenges players to enter a PIN code within a designated time limit. The minigame offers options such as customizable PIN length, time limits, and multiple attempts.

## Features

* **Customizable PIN Code Length:** Set the length of the PIN as needed.
* **Time Limit:** Configure the time allowed to enter the PIN.
* **Multiple Attempts:** Players can have several tries to input the correct code.
* **Predefined or Random Code:** Use a fixed code for testing or generate one randomly.
* **Native UI:** Uses native notifications and a custom NUI interface for an immersive experience.

## Installation & Usage

1. **Installation:**
   * Copy the `0g_pingame` folder (which contains the following files) to your FiveM resources directory:
     * `fxmanifest.lua`
     * `client.lua`
     * `server.lua`
     * `html/index.html`
     * `html/css/pin_code.css`
     * `html/scripts/pin_code.js`
     * `README.md`
   * Add `start 0g_pingame` to your `server.cfg`.
2. **Usage:**
   * To start the minigame in-game, type the command:

     ```
     /test_pincode
     ```
   * Upon successful completion, an event is triggered that can reward the player (see **Events** section).

## Events

* **0gravity\_pincodes:rewardPlayer(success)**
  * Triggered when the minigame ends.
  * Parameter `success` is a boolean indicating if the player entered the correct PIN.

For more details on the PIN Code Minigame, refer to the inline comments in the source code.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://0grav1ty.gitbook.io/zerogravity/scripts/pin-code-minigame.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
