2. Unzip the cd_doorlock.zip folder and place this folder in your server's resource folder.
3. Add the resource to your server start config (server.cfg): ensure cd_doorlock. If you are using a framework, it must be placed anywhere below your framework resource e.g., es_extended, not above.
ensure es_extended
ensure cd_doorlock
Step 1 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes to the [cd_doorlock/fxmanifest.lua]. We have made this easier by commenting on the lines you possibly need to change.
Step 2 - Configure Resource
You MUST read all configurable options inside the [cd_doorlock/configs/config.lua] file and configure them to suit your server's needs. Please read the ”commentedouthelp text” at the end of each line so you can understand what each config option does.
The most important sections are the options under the Framework and Important sections at the top of the config.lua. Everything else is optional.
Introducing our new 'auto_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
All of the configurations for doors are done through the UI in the game;- not through a database, text files or configs.
Step 3 - Configure Key Binds
Before starting this resource on your main/live server, we highly advise configuring your key binds because this resource uses Fivem's Key Mapping.
Where can I configure my key binds?
You can configure key binds in the Keys and Commands section near the bottom of the [cd_doorlock/configs/config.lua].
Why do I need to do this?
Well long story short;- once a player has joined your server with this resource running you can no longer force change their key binds for this resource through the config.lua, only they can change it in the in-game pause menu settings. Although it will change for the players who join after you have changed it.
The benefit of this system is that it's much more optimised and players can easily change their key binds on keyboards or controllers. You can also check out the Default Keybinds for this resource.
Step 4 - Move the JSON Files
Is this your first time installing this script?
YES = You MUST do this step, or the script will not work.
No = DO NOT do this step, as you will lose your entire server's doors.
Go to the [cd_doorlock/JSON files/INSTALLATION STEP FROM DOCS] folder.
Copy the 2 JSON files [door_data.json] and [location_groups.json] and the 1 folder [gabz_locations].
Paste them into the [JSON files]folder. It's as simple as that.
Because the door_data.json and the other JSON files contain your server's door data (basically your door database). When existing customers update to a new version, we don't want you to accidentally overwrite your saved door data.
OPTIONAL FEATURES
This section is to help you understand how the built-in features of this resource work and, if applicable, how you can make them compatible with other resources. These features are not required; they are optional and can be configured in the [configs/config.lua].
Importing Gabz Maps
This script is made as simple to use as possible; therefore, all doors for every Gabz Map come pre-configured. You can choose which map you want to import the door lock files for, and the script will set them up automatically. You can have 500+ doors fully configured with just a few clicks. Ensure you enter the door permissions to set the default permissions for the doors.
Creating New Doors
New doors can only be created in-game through the UI using the /doorlockui chat command.
Editing Door Configuration
Editing door configurations can only be done in-game through the UI using the /doorlockui chat command. There are 2 ways to choose which door to edit.
Option 1 - Choose a door to edit using the search bar on the UI.
Option 2 - Choose a door to edit using our target system.
When using this method, the door MUST be fully closed when selecting a door to edit. For gates and garage doors, it's advised to lock the door first.
Deleting Doors
From this tab on the UI in-game, you can easily delete door locks for individual doors or delete the whole maps door locks with a single click (a location group). (eg., the 100+ doors for Bolingbroke prison can be deleted instantly with a single click). The delete option is only visible to admins.
Creating New Import Files
What is the purpose of creating new import files?
This is completely optional but can be helpful in some situations, such as being able to add/remove door locks from an MLO with a single click while the server is live or being able to send your friend pre-configured door locks for an MLO so he can set up door locks on his server with a single click.
Step 1 - Download the template.
Step 2 - Make a backup of your door_data.json file in [cd_garage/JSON files] folder because we must wipe your door_data.json file to do this.
Step 3 - Delete everything inside the door_data.json file, and replace it with [].
Step 4 - Go in-game and create the doors for the MLO. Make sure to use a new and unique location group.
Step 5 - After creating all the doors, copy the full code from inside the door_data.json file and paste it into the doorlock_template.json. Specifically, paste it where it says "PASTE HERE" - EXAMPLE.
Step 6 - Rename the doorlock_template.json file to whatever you like, but you must also change the "name" inside the JSON file - EXAMPLE.
Step 7 - You now have a working import file for our door lock resource. You can add it inside the gaz_locations folder, and you can import it in-game.
INFORMATION
Default Key Binds
These keys can be modified and/or disabled in the Keys and Commands section of the [configs/config.lua].
Please make sure you understand how Key Mapping works.
Key
Description
E
Open the closest door.
Chat Commands
These chat commands can be renamed and/or disabled in the Keys and Commands section of the [configs/config.lua].
The exact usage for each command will be displayed in the chat suggestions when using the commands in-game.
Command
Description
/doorlock
Open the closest door.
/doorlockui
Open the door lock UI to create/delete/edit doors.
Events
These events are completely optional; you can use them if needed.
The 1st argument [state] sets the lockdown state (false = unlock all doors, true = lock all doors). The 2nd argument is how you define the building to lockdown. All players inside the building will be notified of the lockdown.
(number) Returns the ID of a door. Required for some events. The 1st and 2nd arguments is how you define which door's ID to get. (this id is not unique and can change).
(number) Returns the ID of a door. Required for some events. The 1st and 2nd arguments is how you define which door's ID to get. (this id is not unique and can change).
🔔 Folder Name Make sure the name of the folder either cd_doorlock.
🔔 Encrypted Files Do not edit the encrypted files in any way.
On the UI only 2 tab’s are showing not 4?
eg., you are an admin but only the Control and Settings tab are visible on the UI; but it should show all 4 tabs (Create/Edit, Control, Import & Settings). So you are unable to create new doors or import doors.
✔️ This is because you don’t have admin permissions set up correctly on your server. There could be multiple reasons for this.
1. The Config.AdminAccess in the config.lua has not been configured correctly for your server.
2. If you use ESX or QBCORE your players permissions are set up incorrectly through your framework. This is nothing to do with this script.
3. If you are using the Standalone framework option, and you have enabled Ace Perms; the ace perms are most likely not set up correctly in your server.cfg. To confirm this is the issue you can change the script to use the "command" ace perm and if the doors work then this is your issue, as the "command" ace perm gives every player access.
4. If you are using the Standalone framework option, and you have enabled Discord Perms; badger discord perms is required and it must be named [Badger_Discord_API].
New doors don’t save (using ZAP-Hosting)?
eg., if you use ZAP-Hosting, and you create new doors but they don’t save after a script/server restart.
✔️ This is because data is not being written to JSON file’s due to permission issues. (Only for people using zap-hosting).
Follow the following steps.
1. Stop the server.
2. Move the files to your server using filezilla or winscp.
3. Set the permissions for all JSON files to read write and execute for owner, group and user - https://www.pipeten.com/support/scripting/changing-file-permissions-using-filezilla/.
4. Then start the server.
Can't find a gate/garage door when using the "Edit Selected" button?
eg., if you try to edit a gate/garage door using our target system using the edit selected button and see this error: "This door is not in the system. Please create one first".
✔️ This is because the coords of the gate/garage door has changed due to it being open. Simply lock the gate/garage door and try again and it will work.
ERROR CODES
If you see an error code not listed below, please open a script support ticket in the Codesign Discord.
0001/0002- The simple answer is that you did not complete Step 4 - Move the JSON Files of the installation guide.
7854 - You are pressing E to interact with a door, but no doors are nearby. It's possible you are out of range of the door, so get closer.
3001 - You are pressing E to interact with a door, but no doors have been created/imported yet.
6035 - One or more of your items in the Config.LockpickItems.lockpick_items table in the config.lua is not a valid item in your framework.
0427 - You have not completed Step 1 - Fxmanifest correctly. You must go into the fxmanifest.lua and uncomment the line for ox_lib.
4387 - You are pressing E to interact with a door, but your job/identifier does not match the job/identifier required to interact with this door.
7854 - You are pressing E to interact with a door, but no doors are nearby.
3001 - You are pressing E to interact with a door, but no doors have been created/imported yet.
6624 - The StartLockpicking function in the configs/client_customise_me.lua should be returning a boolean (true or false), to indicate whether the lockpicking was a success or failure. But for some reason it is not.
CHANGELOG
Files Changed
Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.
All Files - This means you should make a backup of the JSON Files folder, delete your old cd_doorlock folder, download and add in the latest version, replace the new JSON Files folder with the one you made a backup of, configure the configs folder and restart your server.
All Files Except config.lua - This means you should do all of the above (in the All Files section) but additionally make a backup of the config.lua file and replace the new config.lua file with the one you made a backup of.
Specific Files - This means you can copy and paste the SPECIFIC new files over the old ones and restart the server.
Update Type
On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.
Mandatory - This means you MUST update to this new version, or the old versions will no longer work.
Optional - This means it's completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.
PLEASE READ! (JSON files)
When updating a resource that uses JSON files as a database as this one does, DO NOT delete/replace the files/folders inside the JSON files folder, as this will delete/overwrite your saved database.
Skipping Updates
If you are attempting to update to the latest version but have skipped previous updates, you should update all files just to be safe. For example., let's say you are currently on v4.0.1, you did not update when v4.0.2 was released, and now v4.0.3 is released, and you want to update; you should always use the “All Files” update method.
05/10/2022
Files Changed:
Update Type:
Changelog:
STATUS
Development Stage: COMPLETE
Alpha Test Stage: COMPLETE
Beta Test Stage: COMPLETE
03/12/2022 - 04/06/2023
v1.0.1 - v1.0.11 (10 versions)
Files Changed:
Update Type:
Changelog:
Add
Added code to automatically debug the script - the debug data will show in the F8 console prints.
Added exports to get the current state of a door.
Added new door pre-sets for the Maze Bank Arena
Added the full gabz map door files
Built-in DrawTextUI: Added a newly updated built-in draw text UI, which is optional.
Draw3DText: Added draw 3d text, which is optional.
Ace Perms: Added the option to use ace perms as an alternative to framework job checks.
Discord Role Perms: Added the option to use discord roles as permissions as an alternative to framework job checks.
Multiple Choice Permissions Access: With this new feature, you are no longer forced to choose 1 way of adding permissions. You can use multiple all at the same time.
For example., you no longer need to just use your frameworks admin or job checks; in addition to the standard framework admin/job checks, you can now set some doors to only be usable by those with a certain discord role, some doors to only be usable by those with certain ace perms and other doors to only be usable by certain fivem identifiers such as steam/license/fivem etc. On top of that, you can also set a door to use framework job checks, discord roles, ace perms and identifiers all at the same time!
Auto Lock Doors: You can now configure doors to auto-lock after x amount of seconds. Suggestion by Stixxzor#1513.
Added German locales.
Auto Framework Detection - We have added a new feature we are calling 'auto_detect', which will automatically identify your framework resource and framework notifications and apply the appropriate default settings.
When using ESX/Qbcore we have added the ability for you to add a character's identifier/citizen id into the identifiers permissions tab when adding door access perms.
Added the import files for Gabz January map update.
You now need to double-click E to confirm you wish to lockpick a door you can't access.
When entering a passcode or lockpicking, your player will automatically walk up to the door and start an animation to make it look more realistic.
You can now start lockpicking directly from the passcode UI (bottom left button).
Added Dutch locales.
Added pre-configured okok, ps-ui and ox_lib notifications that will be automatically detected and applied on script start.
Edit
Added extra checks to ensure the door_data.json file can't accidentally be overwritten, resulting in the deletion of saved door files.
Improved debug prints.
Reworked the door cameras so you no longer need to be close to them to operate them.
Updated debug info.
Doors with a passcode no longer require any door access perms.
When triggering an event to open/close a door with a lockpick or passcode from external resources, it instantly opens/closes it rather than opening the lockpick/passcode UI.
Doors with passcodes and lockpicks now work better together. Passcodes will always be prioritized before lockpicking.
Only players who don't have perms for a door can use the passcode UI. If a door has a passcode on it and a player has perms for that door, the door will instantly open. If you want players to use a passcode, ensure you don't set any other perms than the passcode.
Fix
Fixed an issue with the external events to set door states.
The maximum job grade is no longer restricted to 16.
Fixed the max length of job grades when adding door permissions for jobs
Fixed the UI search bar issues.
Fixed an issue with adding door perms when using the standalone method.
Fixed the drawtextui from opening when opening the pause menu.
Fixed issues related to vRP.
Fixed the 'mul string with number' client-side error.
Fixed some UI errors relating to job.
Fixed minor issues with the camera display icons in the control tab.
Fixed the random text appearing on the screen for a brief moment when adding/updating a door.
Fixed some multi perms not working correctly.
Fixed an issue with ace and discord perms not being saved when importing maps
Fixed framework identifier not working when adding it to the identifier list on a door's perms.
Fixed a js error on standalone servers for players who don't have admin perms when they try to open the UI.
Fixed an issue where some job grades could not see doors. They should be able to see in the control tab.
Fix esx depreciated event warning from spamming.
Fixed animations/walking to the door when you are in a vehicle.
Hide door opened/locked notifications when triggering them from an external resource.
Fixed issues with the control tab.
Fixed issues with perms.
14/06/2023
Files Changed:
Update Type:
Changelog:
Add
Added a new tab to the door perms UI, which allows you to set which items players must have in their inventory to lock/unlock doors.
When pressing E to lock-pick a door, we have added a config option to require the player to have a lock-pick item in their inventory.
Added usable lock-pick items that can be used to lock-pick the closest door (if the door can be lock-picked).
Added random chance police alerts when a player is lockpicking a door.
Added debug zones for the door lock radius, enabled when Config.Debug is enabled.
Added a new option when creating new doors,” Double gates”, which will support double gates.