搜索
开启左侧

帮我保留源文件翻译

[复制链接]
乐乐乐 发表于 2025-4-29 22:21:09 | 显示全部楼层 |阅读模式
# Ox Doorlock

Door management resource, with compatibility for ox_core, qb-core, and es_extended.  
Successor to nui_doorlock with less scuff and more stuff.

_The UI needs to be built - use the [latest release](https://github.com/overextended/ ... oad/ox_doorlock.zip) if you want to drag-n-drop._

## Dependencies

### [oxmysql](https://github.com/overextended/oxmysql)

Doors are stored in a database for ease-of-use and to allow data to be easily cleared or shared.

mysql-async is no longer supported.
  - does not support error-catching (pcall)
  - people use older versions which do not support parameters as arrays
  - it isn't maintained and has issues that will never be resolved

### [ox_lib](https://github.com/overextended/ox_lib) (v2.3.0 or higher)

Used for some UI elements (i.e. notifications, progress circle, input), and cache.

### [ox_target](https://github.com/overextended/ox_target) (preferred) or [qtarget](https://github.com/overextended/qtarget) (deprecated) or [qb-target](https://github.com/qbcore-framework/qb-target)

(Optional) Used for lockpicking.

## Usage

Use the `/doorlock` command to open the UI and enter the settings for your new door.  
Once you confirm the settings, activate your targeting resource (typically LALT) to select the entity (or entities) to use.

Adding any arguments after the command will open the closest door to you, to easily modify it.

## Conversion

Placing nui_doorlock config files into the `convert` folder will convert the data and insert it into the database.  
Success is _not_ guaranteed if using a fork on nui_doorlock, like the qb version.

## Client API

- Use the closest door. Still performs server-side checks, so may fail.

```lua
exports.ox_doorlock:useClosestDoor()
```

- Pick the lock of the closest door. Still performs server-side checks, so may fail.

```lua
exports.ox_doorlock:pickClosestDoor()
```

## Server API

- Get data for door

```lua
local mrpd_locker_rooms = exports.ox_doorlock:getDoor(1)
local mrpd_locker_rooms = exports.ox_doorlock:getDoorFromName('mrpd locker rooms')
```

- Set door state (0: unlocked, 1: locked)

```lua
TriggerEvent('ox_doorlock:setState', mrpd_locker_rooms.id, state)
```

- Listen for event when door is toggled

```lua
AddEventHandler('ox_doorlock:stateChanged', function(source, doorId, state, usedItem)
    if usedItem == 'trainticket' then
        local xPlayer = ESX.GetPlayerFromId(source)
        xPlayer.removeInventoryItem(usedItem, 1)
    end
end)
```

## Door Settings

### 哈哈哈

- 门锁名称
  - 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/d ... e/Client/skillcheck)).
- Area size
  - Custom difficulty area size.
- Speed multiplier
  - Custom difficulty idicator speed.


回复 论坛版权

使用道具 举报

ChatGPT 发表于 2025-4-29 22:21:36 | 显示全部楼层
# Ox Doorlock

门管理资源,兼容 ox_core、qb-core 和 es_extended。  
是 nui_doorlock 的继任者,减少了问题并增加了功能。

_用户界面需要构建 - 如果您想要拖放,请使用 (https://github.com/overextended/ox_doorlock/releases/latest/download/ox_doorlock.zip)。_

## 依赖项

### (https://github.com/overextended/oxmysql)

门的信息存储在数据库中,以便于使用,并允许数据轻松清除或共享。

mysql-async 不再受支持。
  - 不支持错误捕捉 (pcall)
  - 人们使用不支持参数作为数组的旧版本
  - 它没有维护,并且存在不会解决的问题

### (https://github.com/overextended/ox_lib) (v2.3.0 或更高版本)

用于某些用户界面元素(即通知、进度圈、输入)和缓存。

### (https://github.com/overextended/ox_target)(推荐)或 (https://github.com/overextended/qtarget)(已弃用)或 (https://github.com/qbcore-framework/qb-target)

(可选)用于撬锁。

## 使用方法

使用 `/doorlock` 命令打开用户界面并输入新门的设置。  
确认设置后,激活您的目标资源(通常为 LALT)以选择要使用的实体(或多个实体)。

在命令后添加任何参数将打开离您最近的门,以便轻松修改。

## 转换

将 nui_doorlock 配置文件放入 `convert` 文件夹将转换数据并将其插入数据库。  
如果使用类似 qb 版本的 nui_doorlock 的分支,成功 _不_ 得到保证。

## 客户端 API

- 使用最近的门。仍然会执行服务器端检查,因此可能失败。
exports.ox_doorlock:useClosestDoor()

- 撬开最近的门。仍然会执行服务器端检查,因此可能失败。
exports.ox_doorlock:pickClosestDoor()

## 服务器 API

- 获取门的数据
local mrpd_locker_rooms = exports.ox_doorlock:getDoor(1)
local mrpd_locker_rooms = exports.ox_doorlock:getDoorFromName('mrpd locker rooms')

- 设置门的状态(0:解锁,1:上锁)
TriggerEvent('ox_doorlock:setState', mrpd_locker_rooms.id, state)

- 监听门被切换时的事件
AddEventHandler('ox_doorlock:stateChanged', function(source, doorId, state, usedItem)
    if usedItem == 'trainticket' then
        local xPlayer = ESX.GetPlayerFromId(source)
        xPlayer.removeInventoryItem(usedItem, 1)
    end
end)

## 门设置

### 哈哈哈

- 门锁名称
  - 用于轻松识别门。
- 密码
  - 任何人都可以通过使用代码或短语解锁门。
- 自动锁定间隔
  - 门将在 x 秒后自动上锁。
- 互动距离
  - 只有在 x 米内才能使用门。
- 门速
  - 滑动/车库/自动门或上锁时摆动门的移动速度。
- 锁定
  - 默认将门设置为锁定状态。
- 双扇
  - 门是两扇门的组合,一起控制。
- 自动
  - 滑动/车库/自动门。
- 撬锁
  - 与目标资源交互时可以撬锁。
- 隐藏 UI
  - 门上不会显示任何指示器(例如图标、文本)。

### 字符

- 字符 ID
  - 框架使用的字符标识符(例如 player.charid、xPlayer.identifier、Player.CitizenId)。

### 组

- 组
  - 依框架而定,指工作、帮派等。
- 等级
  - 允许该组访问的最低等级(0 允许所有人)。

### 物品

- 物品
  - 物品的名称。
- 元数据类型
  - 需要元数据支持(例如 ox_inventory)来检查 slot.metadata.type。

### 撬锁

- 难度
  - 设置技能检查的难度(参见 (https://overextended.github.io/docs/ox_lib/Interface/Client/skillcheck))。
- 区域大小
  - 自定义难度区域大小。
- 速度倍增器
  - 自定义难度指示器的速度。
回复

使用道具 举报

文明发言,和谐互动
文明发言,和谐互动
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|FiveM技术教程分享 ( 冀ICP备2021005225号-1 ) |网站地图

GMT+8, 2025-5-11 04:48 , Processed in 0.282215 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

© 2001-2013 ELITE论坛【技术无价-分享快乐】

快速回复 返回顶部 返回列表