> 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/developer-guide.md).

# Developer Guide

## Overview

This guide is intended for developers looking to customize or extend the ZeroGravity suite. Here, you will find information on code structure, event handling, and integration with frameworks like ESX.

## Code Structure

* **PIN Code Minigame:**
  * **fxmanifest.lua:** Resource manifest declaring the UI page and scripts.
  * **client.lua & server.lua:** Core logic for starting the minigame, handling player input, and triggering events.
  * **HTML/CSS/JS:** The NUI interface is built using standard web technologies (located in the `html` folder).
* **Fake Plates Module:**
  * **config.lua:** Contains all configuration settings (pricing, cooldown, NPC settings, Discord webhook, etc.).
  * **server.lua:** Manages service callbacks, logs events, and handles transactions.
  * **client.lua:** Contains NPC spawning, interaction menus, and in-game service handling.

## Extending Functionality

* **Integrating a Custom UI:**
  * You can replace native notifications with a custom NUI interface by editing the HTML/CSS/JS files.
* **Adjusting Permissions:**
  * Modify permission-check functions in the client and server scripts to integrate with your chosen framework (e.g., ESX, QBCore).
* **Enhancing Logging:**
  * Update the logging functions in `server.lua` to include additional details or integrate with other logging platforms.
* **Adding New Services:**
  * Use the existing structure in Fake Plates Module as a template to add further vehicle-related services.

## Troubleshooting

* **Model Loading Errors:**
  * Ensure that NPC models are correctly specified and that sufficient time is allowed for loading.
* **Webhook Issues:**
  * Verify your Discord webhook URL in `config.lua` if logs are not appearing.
* **Cooldown and Timing:**
  * Adjust timing variables in `config.lua` to match your server’s needs.

For additional support, consider consulting the inline comments in each source file.


---

# 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/developer-guide.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.
