# files

```
moh-vipshowroom/
├── fxmanifest.lua        Resource manifest — load order and NUI declaration
├── config.lua            All configuration variables and vehicle data
├── bridge_client.lua     Framework/target/notify abstraction layer (client-side)
├── client.lua            Main client logic — ped, test drive, NUI callbacks
├── server.lua            Server logic — player data retrieval, logging, webhook
└── html/
    └── index.html        NUI panel — showroom UI and test drive timer overlay
```

***

## File Responsibilities

### `fxmanifest.lua`

Declares the resource to FiveM. Defines load order: `config.lua` as shared (available on both client and server), then the client scripts, then server scripts, and finally the NUI page.

### `config.lua`

The only file you need to edit for normal setup. Contains every tunable value: coordinates, durations, keys, ped settings, blip settings, notification templates, Discord webhook, and the full `Config.VipCars` table.

Loaded as a `shared_script` so both `client.lua` and `server.lua` can read `Config.*` without duplication.

### `bridge_client.lua`

Runs on the client. Detects the active framework, target system, and notification system at startup, then exposes:

* `Bridge.Notify(msg, type, duration)` — unified notification call
* `Bridge.AddEntityTarget(entity, label, icon, cb, dist)` — unified target registration
* `Bridge.RemoveEntityTarget(entity)` — target cleanup
* `Bridge.DrawText3D(x, y, z, text)` — proximity hint text helper

### `client.lua`

Handles all in-game client behavior:

* Spawning and configuring the showroom ped
* Placing the map blip
* Proximity loop fallback (when no target system is present)
* Opening/closing the NUI panel
* Spawning and managing the test drive vehicle
* Three monitoring threads during a test drive
* All `RegisterNUICallback` handlers

### `server.lua`

Handles all server-side behavior:

* Detecting the active framework and loading the core object
* Listening for `vipshowroom:purchaseRequest`
* Resolving player identity (name, citizenid/identifier, steam) across frameworks
* Validating incoming data
* Printing to the server console
* Posting Discord webhook embeds

### `html/index.html`

Self-contained NUI page. Includes all HTML, CSS, and JavaScript inline. Communicates with Lua via `window.addEventListener('message', ...)` (Lua→NUI) and `fetch(GetParentResourceName(), ...)` (NUI→Lua).


---

# Agent Instructions: 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:

```
GET https://mohssins.gitbook.io/mohscriptsdocs/moh-vipshowroom/files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
