From 28e6c6259accf59ee220862d6e290e5507704155 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Fri, 24 Nov 2023 20:10:32 +0100 Subject: [PATCH] accessing undefined variable Invoke --- .github/CHANGELOG.md | 3 ++- .../resources/[esx]/es_extended/client/common.lua | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a6fd5279b..7c2ce016c 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -60,4 +60,5 @@ 35. [esx-radio] fix: fixed No such export addChannelCheck in resource pma-voice @bitpredator 36. [bpt_vehicletax]: chore: clean up the code @bitpredator 37. [jsfour-idcard]: fix: value assigned to variable ESX is overwritten @bitpredator -38. [es_extended]: refactor/fix: cleanup, remove useless code, formatting + unused argument last @bitpredator +38. [es_extended]: refactor/fix: cleanup, remove useless code, formatting + fix lint error: unused argument last; +accessing undefined variable Invoke @bitpredator diff --git a/server-data/resources/[esx]/es_extended/client/common.lua b/server-data/resources/[esx]/es_extended/client/common.lua index c19574a5f..a8c52e0d0 100644 --- a/server-data/resources/[esx]/es_extended/client/common.lua +++ b/server-data/resources/[esx]/es_extended/client/common.lua @@ -1,12 +1,11 @@ -AddEventHandler('esx:getSharedObject', function(cb) - print(('[^3WARNING^7] ^5%s^7 used ^5esx:getSharedObject^7, this method is deprecated and should not be used! Refer to ^5https://bitpredator.github.io/bptdevelopment/docs/esx-tutorial/sharedevent^7 for more info!'):format(Invoke)) - cb(ESX) -end) - exports('getSharedObject', function() return ESX end) if GetResourceState('ox_inventory') ~= 'missing' then Config.OxInventory = true -end \ No newline at end of file +end + +RegisterNetEvent('esx:getSharedObject', function() + print(('[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://bitpredator.github.io/bptdevelopment/docs/esx-tutorial/sharedevent for how to fix!'):format(GetInvokingResource)) +end) \ No newline at end of file