diff --git a/docs/ox_doorlock/Events/server.md b/docs/ox_doorlock/Events/server.md new file mode 100644 index 00000000..3d29f7d3 --- /dev/null +++ b/docs/ox_doorlock/Events/server.md @@ -0,0 +1,14 @@ +# Server + +## ox_doorlock:stateChanged + +Triggered when a doors state is updated. + +```lua +AddEventHandler('ox_doorlock:stateChanged', function(source, doorId, state, usedItem) end) +``` + +- source: `number` or `nil` +- doorId: `number` +- state: `0` or `1` +- usedItem: `string` or `false` diff --git a/docs/ox_doorlock/Functions/Client/pickClosestDoor.md b/docs/ox_doorlock/Functions/Client/pickClosestDoor.md new file mode 100644 index 00000000..539b471a --- /dev/null +++ b/docs/ox_doorlock/Functions/Client/pickClosestDoor.md @@ -0,0 +1,5 @@ +Attempt to pick the lock of the closest door. Dependant on server-side checks and may fail. + +```lua +exports.ox_doorlock:pickClosestDoor() +``` diff --git a/docs/ox_doorlock/Functions/Client/useClosestDoor.md b/docs/ox_doorlock/Functions/Client/useClosestDoor.md new file mode 100644 index 00000000..c5fc0abc --- /dev/null +++ b/docs/ox_doorlock/Functions/Client/useClosestDoor.md @@ -0,0 +1,5 @@ +Interact with the closest door. Dependant on server-side checks and may fail. + +```lua +exports.ox_doorlock:useClosestDoor() +``` diff --git a/docs/ox_doorlock/Functions/Server/getDoor.md b/docs/ox_doorlock/Functions/Server/getDoor.md new file mode 100644 index 00000000..edc3dda4 --- /dev/null +++ b/docs/ox_doorlock/Functions/Server/getDoor.md @@ -0,0 +1,7 @@ +Gets data for a door with the given id, matching the id for the database entry. + +```lua +exports.ox_doorlock:getDoor(id) +``` + +- id: `number` diff --git a/docs/ox_doorlock/Functions/Server/getDoorFromName.md b/docs/ox_doorlock/Functions/Server/getDoorFromName.md new file mode 100644 index 00000000..368fb7ca --- /dev/null +++ b/docs/ox_doorlock/Functions/Server/getDoorFromName.md @@ -0,0 +1,7 @@ +Gets data for a door with the given name, matching the name for the database entry. + +```lua +exports.ox_doorlock:getDoorFromName(name) +``` + +- name: `string` diff --git a/docs/ox_doorlock/convert.md b/docs/ox_doorlock/convert.md new file mode 100644 index 00000000..7b49531c --- /dev/null +++ b/docs/ox_doorlock/convert.md @@ -0,0 +1,6 @@ +# Door Conversion + +Door configuration files written for nui_doorlock (and its fork, qb-doorlock) can be automatically added to your MySQL database. + +- Any files with the `.lua` extension placed in the `ox_doorlock/convert` directory will be read on resource start. +- Conversion cannot be guaranteed, especially if the config was not written for nui_doorlock. diff --git a/docs/ox_doorlock/index.md b/docs/ox_doorlock/index.md new file mode 100644 index 00000000..de664ccb --- /dev/null +++ b/docs/ox_doorlock/index.md @@ -0,0 +1,51 @@ +--- +title: Getting started +sidebar_position: 1 +--- + +## Installation + +We always recommend using Git so you can track changes and update easily, however this requires building the UI. +Otherwise, download the [latest release](https://github.com/overextended/ox_doorlock/releases). + +### Building + +You can ignore this if you downloaded a release build. + +- [Download](https://www.nodejs.org/) and install the LTS version of Node.js. +- Open a terminal, command prompt, etc. and navigate to your resources folder. +- Execute the following commands + +```bash +npm install --location=global pnpm +git clone https://github.com/overextended/ox_core.git +cd web +pnpm i +pnpm build +``` + +### Dependencies + +- [oxmysql](https://github.com/overextended/oxmysql/) +- [ox_lib](https://github.com/overextended/ox_lib/) + +### Optional Dependencies + +- [ox_target](https://github.com/overextended/ox_target/) or [qtarget](https://github.com/overextended/qtarget) or [qb-target](https://github.com/qbcore-framework/qb-target) + - Doors can be lockpicked using the interaction menu. + +### Supported Frameworks + +These aren't necessary to run ox_doorlock, but they will add additional features. + +- [ox_core](https://github.com/overextended/ox_core) +- [esx](https://github.com/esx-framework/esx-legacy) +- [qb-core](https://github.com/qbcore-framework/qb-core) + +## Opening the UI + +Assuming you've installed the resource and it has started, you can use `/doorlock` to open the UI. + +- If the cursor is displayed but nothing appeared, the UI hasn't been built. +- Check you are authorised to use the command. + - Type `test_ace player.1 command.doorlock` in the server console (replace 1 with your server id). diff --git a/docs/ox_doorlock/settings.md b/docs/ox_doorlock/settings.md new file mode 100644 index 00000000..a0daac69 --- /dev/null +++ b/docs/ox_doorlock/settings.md @@ -0,0 +1,53 @@ +# Door Settings + +### General + +- Door name + - Used to easily identify the door. +- Passcode + - Door can be unlocked by anybody by using the code or phrase. +- Autolock interval + - Door will be locked after x seconds. +- Interact distance + - Door can only be used when within x metres. +- Door rate + - Door movement speed for sliding/garage/automatic doors, or swinging doors when locked. +- Locked + - Sets the door as locked by default. +- Double + - Door is a set of two doors, controlled together. +- Automatic + - Sliding/garage/automatic door. +- Lockpick + - Door can be lockpicked when interacting with a targeting resource. +- Hide UI + - No indicators (i.e. icon, text) will display on the door. + +### Characters + +- Character Id + - Character identifier used by a framework (i.e. player.charid, xPlayer.identifier, Player.CitizenId). + +### Groups + +- Group + - Framework dependent, referring to jobs, gangs, etc. +- Grade + - The minimum grade to allow access for the group (0 to allow all). + +### Items + +- Item + - Name of the item. +- Metadata type + - Requires metadata support (i.e. ox_inventory) to check slot.metadata.type + +### Lockpick + +- Difficulty + - Sets the skillcheck difficulty (see [docs](https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck)). +- Area size + - Custom difficulty area size. +- Speed multiplier + - Custom difficulty idicator speed. + diff --git a/sidebars.js b/sidebars.js index 4ace2451..913270e0 100644 --- a/sidebars.js +++ b/sidebars.js @@ -48,6 +48,11 @@ const sidebars = { label: 'Inventory', href: '/docs/ox_inventory', }, + { + type: 'link', + label: 'Doorlock', + href: '/docs/ox_doorlock', + }, ], ox_target: [ { @@ -161,6 +166,29 @@ const sidebars = { ], }, ], + ox_doorlock: [ + { + type: 'link', + label: '← Home', + href: '/docs', + }, + { + type: 'category', + label: 'Doorlock', + link: { + type: 'generated-index', + title: 'Ox Doorlock', + description: + 'Door management resource.', + }, + items: [ + { + type: 'autogenerated', + dirName: 'ox_doorlock', + }, + ], + }, + ], }; module.exports = sidebars;