-
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.
feat: bpt_doorlock - new resource for port management
- Loading branch information
1 parent
5c8ee72
commit ecdcc48
Showing
27 changed files
with
1,314 additions
and
0 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 |
---|---|---|
@@ -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) | ||
``` |
Binary file added
BIN
+479 Bytes
server-data/resources/[bpt_addons]/bpt_doorlock/audio/data/bptdoorlock_sounds.dat54.rel
Binary file not shown.
145 changes: 145 additions & 0 deletions
145
server-data/resources/[bpt_addons]/bpt_doorlock/audio/data/bptdoorlock_sounds.dat54.rel.xml
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,145 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Dat54> | ||
<Version value="7314721" /> | ||
<ContainerPaths> | ||
<Item>dlc_bptdoorlock\bptdoorlock</Item> | ||
</ContainerPaths> | ||
<Items> | ||
<!-- SimpleSounds --> | ||
<Item type="SimpleSound"> | ||
<Name>button_remote_simple</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ContainerName>dlc_bptdoorlock/bptdoorlock</ContainerName> | ||
<FileName>button_remote</FileName> | ||
<WaveSlotNum value="0" /> | ||
</Item> | ||
|
||
<Item type="SimpleSound"> | ||
<Name>door_bolt_simple</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ContainerName>dlc_bptdoorlock/bptdoorlock</ContainerName> | ||
<FileName>door_bolt</FileName> | ||
<WaveSlotNum value="0" /> | ||
</Item> | ||
|
||
<Item type="SimpleSound"> | ||
<Name>metal_locker_simple</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ContainerName>dlc_bptdoorlock/bptdoorlock</ContainerName> | ||
<FileName>metal_locker</FileName> | ||
<WaveSlotNum value="0" /> | ||
</Item> | ||
|
||
<Item type="SimpleSound"> | ||
<Name>metallic_creak_simple</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ContainerName>dlc_bptdoorlock/bptdoorlock</ContainerName> | ||
<FileName>metallic_creak</FileName> | ||
<WaveSlotNum value="0" /> | ||
</Item> | ||
|
||
|
||
|
||
<!-- SoundSets !--> | ||
<Item type="SoundSet"> | ||
<Name>dlc_bptdoorlock_set</Name> | ||
<Header> | ||
<Flags value="0xAAAAAAAA" /> | ||
</Header> | ||
<SoundSets> | ||
<Item> | ||
<ScriptName>button_remote</ScriptName> | ||
<ChildSound>button_remote_directional</ChildSound> | ||
</Item> | ||
<Item> | ||
<ScriptName>door_bolt</ScriptName> | ||
<ChildSound>door_bolt_directional</ChildSound> | ||
</Item> | ||
<Item> | ||
<ScriptName>metal_locker</ScriptName> | ||
<ChildSound>metal_locker_directional</ChildSound> | ||
</Item> | ||
<Item> | ||
<ScriptName>metallic_creak</ScriptName> | ||
<ChildSound>metallic_creak_directional</ChildSound> | ||
</Item> | ||
</SoundSets> | ||
</Item> | ||
|
||
<Item type="DirectionalSound"> | ||
<Name>button_remote_directional</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ChildSound>button_remote_simple</ChildSound> | ||
<InnerAngle value="20" /> | ||
<OuterAngle value="65" /> | ||
<RearAttenuation value="-3" /> | ||
<YawAngle value="90" /> | ||
<PitchAngle value="0" /> | ||
</Item> | ||
|
||
<Item type="DirectionalSound"> | ||
<Name>door_bolt_directional</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ChildSound>door_bolt_simple</ChildSound> | ||
<InnerAngle value="20" /> | ||
<OuterAngle value="65" /> | ||
<RearAttenuation value="-3" /> | ||
<YawAngle value="90" /> | ||
<PitchAngle value="0" /> | ||
</Item> | ||
|
||
<Item type="DirectionalSound"> | ||
<Name>metal_locker_directional</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ChildSound>metal_locker_simple</ChildSound> | ||
<InnerAngle value="20" /> | ||
<OuterAngle value="65" /> | ||
<RearAttenuation value="-3" /> | ||
<YawAngle value="90" /> | ||
<PitchAngle value="0" /> | ||
</Item> | ||
|
||
<Item type="DirectionalSound"> | ||
<Name>metallic_creak_directional</Name> | ||
<Header> | ||
<Flags value="0x00008004" /> | ||
<Volume value="200" /> | ||
<Category>scripted</Category> | ||
</Header> | ||
<ChildSound>metallic_creak_simple</ChildSound> | ||
<InnerAngle value="20" /> | ||
<OuterAngle value="65" /> | ||
<RearAttenuation value="-3" /> | ||
<YawAngle value="90" /> | ||
<PitchAngle value="0" /> | ||
</Item> | ||
</Items> | ||
</Dat54> |
Binary file added
BIN
+52.1 KB
server-data/resources/[bpt_addons]/bpt_doorlock/audio/dlc_bptdoorlock/bptdoorlock.awc
Binary file not shown.
107 changes: 107 additions & 0 deletions
107
server-data/resources/[bpt_addons]/bpt_doorlock/audio/dlc_bptdoorlock/bptdoorlock.awc.xml
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,107 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<AudioWaveContainer> | ||
<Version value="1" /> | ||
<ChunkIndices value="True" /> | ||
<Streams> | ||
<Item> | ||
<Name>button_remote</Name> | ||
<FileName>button_remote.wav</FileName> | ||
<Chunks> | ||
<Item> | ||
<Type>peak</Type> | ||
</Item> | ||
<Item> | ||
<Type>data</Type> | ||
</Item> | ||
<Item> | ||
<Type>format</Type> | ||
<Codec>ADPCM</Codec> | ||
<Samples value="25600" /> | ||
<SampleRate value="44100" /> | ||
<Headroom value="-161" /> | ||
<PlayBegin value="0" /> | ||
<PlayEnd value="0" /> | ||
<LoopBegin value="0" /> | ||
<LoopEnd value="0" /> | ||
<LoopPoint value="-1" /> | ||
<Peak unk="0" /> | ||
</Item> | ||
</Chunks> | ||
</Item> | ||
<Item> | ||
<Name>door_bolt</Name> | ||
<FileName>door_bolt.wav</FileName> | ||
<Chunks> | ||
<Item> | ||
<Type>peak</Type> | ||
</Item> | ||
<Item> | ||
<Type>data</Type> | ||
</Item> | ||
<Item> | ||
<Type>format</Type> | ||
<Codec>ADPCM</Codec> | ||
<Samples value="26069" /> | ||
<SampleRate value="44100" /> | ||
<Headroom value="-161" /> | ||
<PlayBegin value="0" /> | ||
<PlayEnd value="0" /> | ||
<LoopBegin value="0" /> | ||
<LoopEnd value="0" /> | ||
<LoopPoint value="-1" /> | ||
<Peak unk="0" /> | ||
</Item> | ||
</Chunks> | ||
</Item> | ||
<Item> | ||
<Name>metal_locker</Name> | ||
<FileName>metal_locker.wav</FileName> | ||
<Chunks> | ||
<Item> | ||
<Type>peak</Type> | ||
</Item> | ||
<Item> | ||
<Type>data</Type> | ||
</Item> | ||
<Item> | ||
<Type>format</Type> | ||
<Codec>ADPCM</Codec> | ||
<Samples value="36864" /> | ||
<SampleRate value="44100" /> | ||
<Headroom value="-161" /> | ||
<PlayBegin value="0" /> | ||
<PlayEnd value="0" /> | ||
<LoopBegin value="0" /> | ||
<LoopEnd value="0" /> | ||
<LoopPoint value="-1" /> | ||
<Peak unk="0" /> | ||
</Item> | ||
</Chunks> | ||
</Item> | ||
<Item> | ||
<Name>metallic_creak</Name> | ||
<FileName>metallic_creak.wav</FileName> | ||
<Chunks> | ||
<Item> | ||
<Type>peak</Type> | ||
</Item> | ||
<Item> | ||
<Type>data</Type> | ||
</Item> | ||
<Item> | ||
<Type>format</Type> | ||
<Codec>ADPCM</Codec> | ||
<Samples value="17489" /> | ||
<SampleRate value="44100" /> | ||
<Headroom value="-161" /> | ||
<PlayBegin value="0" /> | ||
<PlayEnd value="0" /> | ||
<LoopBegin value="0" /> | ||
<LoopEnd value="0" /> | ||
<LoopPoint value="-1" /> | ||
<Peak unk="0" /> | ||
</Item> | ||
</Chunks> | ||
</Item> | ||
</Streams> | ||
</AudioWaveContainer> |
Binary file added
BIN
+50 KB
...a/resources/[bpt_addons]/bpt_doorlock/audio/dlc_bptdoorlock/bptdoorlock/button_remote.wav
Binary file not shown.
Binary file added
BIN
+51.1 KB
...-data/resources/[bpt_addons]/bpt_doorlock/audio/dlc_bptdoorlock/bptdoorlock/door_bolt.wav
Binary file not shown.
Binary file added
BIN
+76.9 KB
...ta/resources/[bpt_addons]/bpt_doorlock/audio/dlc_bptdoorlock/bptdoorlock/metal_locker.wav
Binary file not shown.
Binary file added
BIN
+34.3 KB
.../resources/[bpt_addons]/bpt_doorlock/audio/dlc_bptdoorlock/bptdoorlock/metallic_creak.wav
Binary file not shown.
Oops, something went wrong.