Skip to content

Commit

Permalink
chore: update bpt_doorlock to version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Oct 8, 2023
1 parent 6131bba commit c92c96d
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 134 deletions.
43 changes: 4 additions & 39 deletions server-data/resources/[bpt_addons]/bpt_doorlock/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,9 @@
# bpt_doorlock
<h1 align='center'>bpt_dorlock</a></h1>
<p align='center'><a href='https://discord.gg/ksGfNvDEfq'>Discord</a>

Port management resource, currently only compatible with es_extended.
Port management resource, currently only compatible with es_extended & qb-core.
[latest release](https://github.com/bitpredator/bpt_doorlock/releases/latest/download/bpt_doorlock.zip)

## Dependencies

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

The ports are stored in a database to facilitate the use of the resource

## Client API

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

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

## Server API

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

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

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

- Listen for event when door is toggled

```lua
AddEventHandler('bpt_doorlock:stateChanged', function(source, doorId, state, usedItem)
if usedItem == 'trainticket' then
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem(usedItem, 1)
end
end)
```
### [oxmysql](https://github.com/overextended/oxmysql)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ game 'gta5'

-- Resource Information
name 'bpt_doorlock'
version '1.0.0'
version '1.0.2'
license 'MIT'
author 'bitpredator'
repository 'https://github.com/bitpredator/bpt_doorlock'
Expand Down
Loading

0 comments on commit c92c96d

Please sign in to comment.