Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowing the player to use the old ways to get the shared object while in the same time allowing the export #1381

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions [core]/es_extended/client/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ exports("getSharedObject", function()
return ESX
end)

AddEventHandler("esx:getSharedObject", function()
--[[AddEventHandler("esx:getSharedObject", function()
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)
end)]]
AddEventHandler("esx:getSharedObject", function(cb)
cb(ESX)
end) -- same as common.lua in server side
8 changes: 6 additions & 2 deletions [core]/es_extended/server/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ RegisterNetEvent("esx:onPlayerSpawn", function()
ESX.Players[source].spawned = true
end)

AddEventHandler("esx:getSharedObject", function()
--[[AddEventHandler("esx:getSharedObject", function()
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)
end)]]

AddEventHandler("esx:getSharedObject", function(cb)
cb(ESX)
end) -- allowing the player to get the shared object without the new export :)

exports("getSharedObject", function()
return ESX
Expand Down
Loading