-
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.
Merge pull request #528 from bitpredator/develop
refactor: replace ox_doorlock with bpt_doorlock
- Loading branch information
Showing
58 changed files
with
333 additions
and
2,029 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 bitpredator | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# bpt_doorlock | ||
|
||
Port management resource, currently only compatible with es_extended. | ||
[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) | ||
``` |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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
48 changes: 48 additions & 0 deletions
48
server-data/resources/[bpt_addons]/bpt_doorlock/fxmanifest.lua
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
-- FX Information | ||
fx_version 'cerulean' | ||
use_experimental_fxv2_oal 'yes' | ||
lua54 'yes' | ||
game 'gta5' | ||
|
||
-- Resource Information | ||
name 'bpt_doorlock' | ||
version '1.0.0' | ||
license 'MIT' | ||
author 'bitpredator' | ||
repository 'https://github.com/bitpredator/bpt_doorlock' | ||
|
||
-- Manifest | ||
shared_script { | ||
'@ox_lib/init.lua', | ||
'config.lua', | ||
} | ||
|
||
client_script { | ||
'client/main.lua', | ||
'client/utils.lua', | ||
} | ||
|
||
server_script { | ||
'@oxmysql/lib/MySQL.lua', | ||
'server/convert.lua', | ||
'server/framework/*.lua', | ||
'server/main.lua', | ||
} | ||
|
||
ui_page 'web/build/index.html' | ||
|
||
files { | ||
'web/build/index.html', | ||
'web/build/**/*', | ||
'locales/*.json', | ||
'audio/data/bptdoorlock_sounds.dat54.rel', | ||
'audio/dlc_bptdoorlock/bptdoorlock.awc', | ||
} | ||
|
||
data_file 'AUDIO_WAVEPACK' 'audio/dlc_bptdoorlock' | ||
data_file 'AUDIO_SOUNDDATA' 'audio/data/bptdoorlock_sounds.dat' | ||
|
||
dependencies { | ||
'oxmysql', | ||
'ox_lib' | ||
} |
18 changes: 18 additions & 0 deletions
18
server-data/resources/[bpt_addons]/bpt_doorlock/locales/en.json
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"unlocked_door": "Unlocked door", | ||
"locked_door": "Locked door", | ||
"lock_door": "[E] Lock door", | ||
"unlock_door": "[E] Unlock door", | ||
"door_lock": "Door lock", | ||
"passcode": "Passcode", | ||
"lockpick_broke": "Your lockpick broke", | ||
"pick_lock": "Pick lock", | ||
"add_lock": "Add doorlock", | ||
"edit_lock": "Edit doorlock", | ||
"remove_lock": "Remove doorlock", | ||
"cannot_unlock": "Unable to unlock door", | ||
"cannot_lock": "Unable to lock door", | ||
"create_modify_lock": "Create a doorlock, or modify an existing one", | ||
"add_door_textui": "**Create new door** \nInteract with [LMB] \nCancel with [RMB]", | ||
"command_closest": "Open UI directly to closest doorlock" | ||
} |
18 changes: 18 additions & 0 deletions
18
server-data/resources/[bpt_addons]/bpt_doorlock/locales/it.json
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"unlocked_door": "Porta sbloccata", | ||
"locked_door": "Porta chiusa", | ||
"lock_door": "[E] Chiudi porta", | ||
"unlock_door": "[E] Apri porta", | ||
"door_lock": "Serratura della porta", | ||
"passcode": "codice di accesso", | ||
"lockpick_broke": "il tuo grimaldello si è rotto", | ||
"pick_lock": "Scassina serratura", | ||
"add_lock": "Aggiungi serratura", | ||
"edit_lock": "Modifica serratura", | ||
"remove_lock": "Rimuovi serratura", | ||
"cannot_unlock": "Impossibile aprire la porta", | ||
"cannot_lock": "Impossibile chiudere la porta", | ||
"create_modify_lock": "Crea una serratura o modificane una esistente", | ||
"add_door_textui": "**Crea una nuova porta** \nInteragire con [LMB] \nAnnulla con [RMB]", | ||
"command_closest": "Apri l'interfaccia utente direttamente alla serratura più vicina" | ||
} |
5 changes: 3 additions & 2 deletions
5
...rces/[ox]/ox_doorlock/sql/ox_doorlock.sql → ...addons]/bpt_doorlock/sql/bpt_doorlock.sql
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,7 +1,8 @@ | ||
CREATE TABLE | ||
IF NOT EXISTS `ox_doorlock` ( | ||
IF NOT EXISTS `bpt_doorlock` ( | ||
`id` int (11) unsigned NOT NULL AUTO_INCREMENT, | ||
`name` varchar(50) NOT NULL, | ||
`data` longtext NOT NULL, | ||
PRIMARY KEY (`id`) | ||
); | ||
) | ||
; |
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
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.