From 3dd57aaf49348c7eedbdbfc04a9201bc0bf88bb5 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 16 Jun 2024 16:26:09 +0200 Subject: [PATCH 1/3] fix: big bug --- [core]/es_extended/client/functions.lua | 1 - [core]/es_extended/common/functions.lua | 3 ++- [core]/es_extended/fxmanifest.lua | 3 ++- [core]/es_extended/server/common.lua | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua index f5576bf2d..bf6269352 100644 --- a/[core]/es_extended/client/functions.lua +++ b/[core]/es_extended/client/functions.lua @@ -1,4 +1,3 @@ -ESX = {} Core = {} ESX.PlayerData = {} ESX.PlayerLoaded = false diff --git a/[core]/es_extended/common/functions.lua b/[core]/es_extended/common/functions.lua index 0e9adb08f..b21bfee62 100644 --- a/[core]/es_extended/common/functions.lua +++ b/[core]/es_extended/common/functions.lua @@ -1,5 +1,6 @@ -local Charset = {} +ESX = {} +local Charset = {} for i = 48, 57 do table.insert(Charset, string.char(i)) end diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index 202a47393..0b5e60422 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -12,8 +12,9 @@ shared_scripts { 'config.lua', 'config.weapons.lua', - 'common/modules/*.lua', + 'common/functions.lua', 'common/*.lua', + 'common/modules/*.lua', } server_scripts { diff --git a/[core]/es_extended/server/common.lua b/[core]/es_extended/server/common.lua index f69f5838e..464792837 100644 --- a/[core]/es_extended/server/common.lua +++ b/[core]/es_extended/server/common.lua @@ -1,4 +1,3 @@ -ESX = {} ESX.Players = {} ESX.Jobs = {} ESX.JobsPlayerCount = {} From 9ec650c65660435f939a9c83af5461569db55e1a Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 16 Jun 2024 16:58:47 +0200 Subject: [PATCH 2/3] Revert "fix: big bug" --- [core]/es_extended/client/functions.lua | 1 + [core]/es_extended/common/functions.lua | 3 +-- [core]/es_extended/fxmanifest.lua | 3 +-- [core]/es_extended/server/common.lua | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua index bf6269352..f5576bf2d 100644 --- a/[core]/es_extended/client/functions.lua +++ b/[core]/es_extended/client/functions.lua @@ -1,3 +1,4 @@ +ESX = {} Core = {} ESX.PlayerData = {} ESX.PlayerLoaded = false diff --git a/[core]/es_extended/common/functions.lua b/[core]/es_extended/common/functions.lua index b21bfee62..0e9adb08f 100644 --- a/[core]/es_extended/common/functions.lua +++ b/[core]/es_extended/common/functions.lua @@ -1,6 +1,5 @@ -ESX = {} - local Charset = {} + for i = 48, 57 do table.insert(Charset, string.char(i)) end diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index 0b5e60422..202a47393 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -12,9 +12,8 @@ shared_scripts { 'config.lua', 'config.weapons.lua', - 'common/functions.lua', - 'common/*.lua', 'common/modules/*.lua', + 'common/*.lua', } server_scripts { diff --git a/[core]/es_extended/server/common.lua b/[core]/es_extended/server/common.lua index 464792837..f69f5838e 100644 --- a/[core]/es_extended/server/common.lua +++ b/[core]/es_extended/server/common.lua @@ -1,3 +1,4 @@ +ESX = {} ESX.Players = {} ESX.Jobs = {} ESX.JobsPlayerCount = {} From b8f48f81205014a50e1e6df1d559dfe0c1368fd4 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 16 Jun 2024 17:00:01 +0200 Subject: [PATCH 3/3] Revert "refactor(es_extended): put identical object related code into one file" --- .../{common/object.lua => client/common.lua} | 16 ++++++++-------- [core]/es_extended/fxmanifest.lua | 8 +++++--- [core]/es_extended/server/common.lua | 9 +++++++++ 3 files changed, 22 insertions(+), 11 deletions(-) rename [core]/es_extended/{common/object.lua => client/common.lua} (97%) diff --git a/[core]/es_extended/common/object.lua b/[core]/es_extended/client/common.lua similarity index 97% rename from [core]/es_extended/common/object.lua rename to [core]/es_extended/client/common.lua index bd8f80097..2191d17a2 100644 --- a/[core]/es_extended/common/object.lua +++ b/[core]/es_extended/client/common.lua @@ -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) \ No newline at end of file +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) diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index 202a47393..03113e1df 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -11,9 +11,6 @@ shared_scripts { 'config.lua', 'config.weapons.lua', - - 'common/modules/*.lua', - 'common/*.lua', } server_scripts { @@ -30,6 +27,8 @@ server_scripts { 'server/main.lua', 'server/commands.lua', + 'common/modules/*.lua', + 'common/functions.lua', 'server/modules/actions.lua', 'server/modules/npwd.lua', 'server/modules/createJob.lua' @@ -43,6 +42,9 @@ client_scripts { 'client/main.lua', + 'common/modules/*.lua', + 'common/functions.lua', + 'common/functions.lua', 'client/modules/actions.lua', 'client/modules/death.lua', diff --git a/[core]/es_extended/server/common.lua b/[core]/es_extended/server/common.lua index f69f5838e..68bc94c94 100644 --- a/[core]/es_extended/server/common.lua +++ b/[core]/es_extended/server/common.lua @@ -18,6 +18,15 @@ 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")