> 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

Here you will find the install and config guide to 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>
