mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 03:01:31 +00:00
Merge pull request #1528 from esx-framework/get-shared-object
feat(es_extended/shared/main): restore backwards compat
This commit is contained in:
@@ -4,9 +4,12 @@ exports("getSharedObject", function()
|
||||
return ESX
|
||||
end)
|
||||
|
||||
AddEventHandler("esx:getSharedObject", function()
|
||||
local Invoke = GetInvokingResource()
|
||||
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))
|
||||
AddEventHandler("esx:getSharedObject", function(cb)
|
||||
if ESX.IsFunctionReference(cb) then
|
||||
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)
|
||||
|
||||
-- backwards compatibility (DO NOT TOUCH !)
|
||||
|
||||
Reference in New Issue
Block a user