> For the complete documentation index, see [llms.txt](https://rickys-organization-6.gitbook.io/hwc-documentions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rickys-organization-6.gitbook.io/hwc-documentions/hwc-doorlock.md).

# HWC DoorLock

## 🔐 HWC Doorlock - Installation Guide

#### Advanced Door Management System for FiveM

***

### 📥 Installation

Follow these steps to correctly install **HWC Doorlock** on your server:

#### 1️⃣ Add Resource

Place the resource into your server:

```
resources/[standalone]/hwc-doorlock
```

***

#### 2️⃣ Import Database (Optional but Recommended)

If you are using persistence:

* Navigate to:

```
hwc-doorlock/sql/install.sql
```

* Import into your database using **HeidiSQL / phpMyAdmin**

***

#### 3️⃣ Configure Resource

Edit:

```
config/config.lua
```

Set your preferences:

* Framework options
* Permissions
* Door defaults
* Access behaviour

***

#### 4️⃣ Add ACE Permissions ⚠️ REQUIRED

Before using the resource, you **MUST** add the following to your `server.cfg`:

```
# HWC Doorlock - Admin Permissions
add_ace group.admin "hwc-doorlock.admin" allow
add_ace group.admin "hwc-doorlock.command" allow

# Replace with your Discord ID
add_principal identifier.discord:YOUR_DISCORD_ID group.admin
```

#### 🔑 What This Does

* Grants access to:
  * Door creation UI
  * Editing & deleting doors
  * Admin commands
* Links your Discord to admin permissions

💡 **Important:**\
If this step is skipped, the UI will not open and admin features will not work.

***

#### 5️⃣ Ensure Resource

Add to your `server.cfg`:

```
ensure hwc-doorlock
```

***

#### 6️⃣ Restart Server

Either:

* Full restart

**OR**

```
refresh
start hwc-doorlock
```

***

### 📁 Resource Structure

#### Shared

* `shared/constants.lua`
* `shared/shared.lua`
* `shared/door_helper.lua`
* `bridge/framework.lua`

#### Server

* `server/database.lua`
* `server/utils/logger.lua`
* `server/utils/validator.lua`
* `server/managers/door_manager.lua`
* `server/managers/streaming_manager.lua`
* `server/core.lua`
* `server/main.lua`
* `server/advanced.lua`
* `server/advanced_features.lua`
* `server/plugins.lua`

#### Client

* `client/main.lua`
* `client/advanced.lua`

#### UI

* `ui/index.html`
* `ui/app.js`
* `ui/style.css`
* `ui/sounds/`

***

### 🔗 Framework Bridge

`bridge/framework.lua` provides a unified system across:

* QBCore
* ESX
* QBox
* Standalone

#### Handles:

* Player data
* Permissions
* Inventory checks
* Notifications

***

### 🧩 Plugin System (Optional)

Located in:

```
server/plugins.lua
```

Used for custom logic such as:

* VIP-only doors
* Time-based access
* Weather-based access
* External resource integration

💡 Not required for normal usage.

***

### 🧹 Clean Resource Layout

Removed unused/legacy files:

* Old UI systems (`creator.*`, `doorui.*`)
* Deprecated client modules
* Staging folders

***

### 📝 Notes

* Always check `fxmanifest.lua` for active files
* Uses standard FiveM structure:
  * `client`
  * `server`
  * `shared`
  * `config`
  * `ui`

***

### 🚨 Troubleshooting

**UI not opening?**\
→ Check ACE permissions

**Doors not saving?**\
→ Ensure SQL is imported

**No admin access?**\
→ Verify Discord ID is correct

***

### 💬 Support

Need help?

Join the Discord:\
👉 <https://discord.gg/muw855d3js>


---

# 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://rickys-organization-6.gitbook.io/hwc-documentions/hwc-doorlock.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.
