mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
feat(es_extended/shared/main): restore backwards compat
This commit is contained in:
@@ -4,9 +4,12 @@ exports("getSharedObject", function()
|
|||||||
return ESX
|
return ESX
|
||||||
end)
|
end)
|
||||||
|
|
||||||
AddEventHandler("esx:getSharedObject", function()
|
AddEventHandler("esx:getSharedObject", function(cb)
|
||||||
local Invoke = GetInvokingResource()
|
if ESX.IsFunctionReference(cb) then
|
||||||
error(("Resource ^5%s^1 Used the ^5getSharedObject^1 Event, this event ^1no longer exists!^1 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
|
cb(ESX)
|
||||||
|
end
|
||||||
|
local invokingResource = GetInvokingResource()
|
||||||
|
print(("^3[WARNING]^0 Resource ^5%s^0 used the ^5getSharedObject^0 event. This is not the recommended way to import ESX. Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent to find out why."):format(invokingResource))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- backwards compatibility (DO NOT TOUCH !)
|
-- backwards compatibility (DO NOT TOUCH !)
|
||||||
|
|||||||
Reference in New Issue
Block a user