-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update bpt_doorlock to version 1.0.2
- Loading branch information
1 parent
6131bba
commit c92c96d
Showing
5 changed files
with
108 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.