hello i have some scripts in my server thats spaming this someone can help me ?
i assume you updated your esx version to versio 1.9+ in which they deleted the esx.getSharedObject event. You basically have 2 options:
Go back to esx version <=1.8.5 or
Set this in every resource that throws this error:
fxmanifest.lua add:
shared_script â@es_extended/imports.luaâ
In every script where you initialise ESX:
There will probably something like
ESX = nil
TriggerEvent(âesx:getSharedObjectâ, function(obj) ESX = obj end)
Delete it and replace with:
ESX = exports[âes_extendedâ]:getSharedObject()
edit: Sorry that was my bad. If you use the shared script in fxmanifest.lua you donât need to initialize esx in your resource as it happens automatically through the import. However you still can accomplish the same without touching the fxmanifest.lua and just use the
ESX = exports[âes_extendedâ]:getSharedObject()
Hi,
Incase you have multiple scripts using this and dont want to rewrite it all you can try this as âtemporary bypassâ since i dont know how long this will be supported.
In your es_extended folder go into client\common.lua and add the following code at the end of it
AddEventHandler("esx:getSharedObject", function(cb)
cb(ESX)
end)
Do the same for server\common.lua. This should fix all the errors since the old esx calls are still compatible with the newest version.
But you should still look into updating the scripts to the newest ESX since i dont know how long this works.
This will be supported for literally ever, its base functionality of FiveM. CFX would have to decide to break the entire game system for this type of callback functionality to no longer work.
its still doing the same
still the same
You will always receive those prints unless you remove the code that is generating that print.
You need to find those instances in your framework files, the ones that post that print, and then replace those handlers with the code above.
It would now be: ESX = exports[âes_extendedâ]:getSharedObject()