From bf903453758b9e6518ff6010e686a652c798824b Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:05:45 +0200 Subject: [PATCH] fix: (bpt_doorlock\client\main.lua) accessing undefined variable --- .../resources/[bpt_addons]/bpt_doorlock/client/main.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_doorlock/client/main.lua b/server-data/resources/[bpt_addons]/bpt_doorlock/client/main.lua index c2b20230c..9ba608dc8 100644 --- a/server-data/resources/[bpt_addons]/bpt_doorlock/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_doorlock/client/main.lua @@ -1,3 +1,5 @@ +local doors = {} + if not LoadResourceFile(lib.name, 'web/build/index.html') then error('Unable to load UI. Build bpt_doorlock or download the latest release.\n ^3https://github.com/bitpredator/bpt_doorlock/releases/latest/download/bpt_doorlock.zip^0') end @@ -169,13 +171,13 @@ RegisterNetEvent('bpt_doorlock:setState', function(id, state, source, data) if door.state == state and door.distance and door.distance < 20 then if Config.NativeAudio then - RequestScriptAudioBank('dlc_oxdoorlock/oxdoorlock', false) + RequestScriptAudioBank('dlc_bptdoorlock/bptdoorlock', false) local sound = state == 0 and door.unlockSound or door.lockSound or 'door_bolt' local soundId = GetSoundId() - PlaySoundFromCoord(soundId, sound, door.coords.x, door.coords.y, door.coords.z, 'DLC_OXDOORLOCK_SET', false, 0, false) + PlaySoundFromCoord(soundId, sound, door.coords.x, door.coords.y, door.coords.z, 'DLC_BPTDOORLOCK_SET', false, 0, false) ReleaseSoundId(soundId) - ReleaseNamedScriptAudioBank('dlc_oxdoorlock/oxdoorlock') + ReleaseNamedScriptAudioBank('dlc_bptdoorlock/bptdoorlock') else local volume = (0.01 * GetProfileSetting(300)) / (door.distance / 2) if volume > 1 then volume = 1 end