Skip to content

Commit

Permalink
refactor(es_extended): put identical object related code into one fil…
Browse files Browse the repository at this point in the history
…e + put common scripts in shared instead of same thing in client_scripts / server_scripts
  • Loading branch information
Arctos2win authored Apr 18, 2024
1 parent 4e16dca commit 6d628ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
exports("getSharedObject", function()
return ESX
end)

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)
exports("getSharedObject", function()
return ESX
end)

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)
8 changes: 3 additions & 5 deletions [core]/es_extended/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ shared_scripts {

'config.lua',
'config.weapons.lua',

'common/modules/*.lua',
'common/*.lua',
}

server_scripts {
Expand All @@ -27,8 +30,6 @@ server_scripts {
'server/main.lua',
'server/commands.lua',

'common/modules/*.lua',
'common/functions.lua',
'server/modules/actions.lua',
'server/modules/npwd.lua'
}
Expand All @@ -41,9 +42,6 @@ client_scripts {

'client/main.lua',

'common/modules/*.lua',
'common/functions.lua',

'common/functions.lua',
'client/modules/actions.lua',
'client/modules/death.lua',
Expand Down
9 changes: 0 additions & 9 deletions [core]/es_extended/server/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ RegisterNetEvent("esx:onPlayerSpawn", function()
ESX.Players[source].spawned = true
end)

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)

exports("getSharedObject", function()
return ESX
end)

if Config.OxInventory then
Config.PlayerFunctionOverride = "OxInventory"
SetConvarReplicated("inventory:framework", "esx")
Expand Down

0 comments on commit 6d628ed

Please sign in to comment.