Old esx:getSharedObject Event Fix
This repository contains a fix for the old esx:getSharedObject
event for the new ESX Legacy versions. The esx:getSharedObject
event was previously used to obtain a shared object in ESX resources, but it was deprecated in version 1.9 and replaced with a new export/import method instead.
However, some older resources still rely on the old esx:getSharedObject
event and may break when updated to the latest version of ESX. This repository provides a fix for this issue by restoring the old esx:getSharedObject
event so that older resources can continue to function as intended.
-
Download the latest release of this repository.
-
Extract the content of the archive and do the following steps...
-
Copy the
common.lua
from theclient
folder. -
Go to your
es_extended/client
folder. -
Replace the existing file with my file.
-
Copy the
common.lua
from theserver
folder. -
Go to your
es_extended/server
. -
Replace the existing file with my file.
After installing the fix, restart your server, and you can use the esx:getSharedObject
event as you would normally in older resources. For example, you can use the following code to get the ESX shared object in a client script:
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.CreateThread(function()
while ESX == nil do
Citizen.Wait(0)
end
-- Do something with the ESX shared object
end)
If you encounter any issues or have suggestions for improving this fix, please feel free to open an issue or submit a pull request on GitHub.
This repository is licensed under the MIT License. See the LICENSE file for more information.