From 366c78cc40e49b9f1a298fed9d06f4b3adc0946e Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 28 Jan 2024 17:49:12 +0100 Subject: [PATCH 1/7] Hotfix health metadata not setting --- [core]/es_extended/client/main.lua | 79 +++++++++++-------- [core]/es_extended/client/modules/actions.lua | 1 + 2 files changed, 45 insertions(+), 35 deletions(-) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index bbc9528d..6dab784d 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -18,54 +18,47 @@ RegisterNetEvent("esx:requestModel", function(model) ESX.Streaming.RequestModel(model) end) +function ESX.SpawnPlayer(skin, coords, cb) + local p = promise.new() + TriggerEvent("skinchanger:loadSkin", skin, function() + p:resolve() + end) + Citizen.Await(p) + + local playerPed = PlayerPedId() + FreezeEntityPosition(playerPed, true) + SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false, true) + SetEntityHeading(playerPed, coords.heading) + while not HasCollisionLoadedAroundEntity(playerPed) do + Wait(0) + end + FreezeEntityPosition(playerPed, false) + cb() +end + RegisterNetEvent("esx:playerLoaded") AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) ESX.PlayerData = xPlayer - if Config.Multichar then - Wait(3000) - else - exports.spawnmanager:spawnPlayer({ - x = ESX.PlayerData.coords.x, - y = ESX.PlayerData.coords.y, - z = ESX.PlayerData.coords.z + 0.25, - heading = ESX.PlayerData.coords.heading, - model = `mp_m_freemode_01`, - skipFade = false, - }, function() - TriggerServerEvent("esx:onPlayerSpawn") + if not Config.Multichar then + ESX.SpawnPlayer(skin, ESX.PlayerData.coords, function() TriggerEvent("esx:onPlayerSpawn") TriggerEvent("esx:restoreLoadout") - - if isNew then - TriggerEvent("skinchanger:loadDefaultModel", skin.sex == 0) - elseif skin then - TriggerEvent("skinchanger:loadSkin", skin) - end - + TriggerServerEvent("esx:onPlayerSpawn") TriggerEvent("esx:loadingScreenOff") ShutdownLoadingScreen() ShutdownLoadingScreenNui() end) end - ESX.PlayerLoaded = true - - while ESX.PlayerData.ped == nil do + while not DoesEntityExist(ESX.PlayerData.ped) do Wait(20) end + + ESX.PlayerLoaded = true - while not HasCollisionLoadedAroundEntity(ESX.PlayerData.ped) do - Wait(0) - end - - if Config.EnablePVP then - SetCanAttackFriendly(ESX.PlayerData.ped, true, false) - NetworkSetFriendlyFireOption(true) - end - - local playerId = PlayerId() local metadata = ESX.PlayerData.metadata + if metadata.health then SetEntityHealth(ESX.PlayerData.ped, metadata.health) end @@ -74,6 +67,17 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) SetPedArmour(ESX.PlayerData.ped, metadata.armor) end + local timer = GetGameTimer() + while not HaveAllStreamingRequestsCompleted(ESX.PlayerData.ped) and (GetGameTimer() - timer) < 2000 do + Wait(0) + end + + if Config.EnablePVP then + SetCanAttackFriendly(ESX.PlayerData.ped, true, false) + NetworkSetFriendlyFireOption(true) + end + + local playerId = PlayerId() -- RemoveHudComponents for i = 1, #Config.RemoveHudComponents do if Config.RemoveHudComponents[i] then @@ -98,9 +102,9 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) end) end - if Config.DisableHealthRegeneration then - SetPlayerHealthRechargeMultiplier(playerId, 0.0) - end + --if Config.DisableHealthRegeneration then + --SetPlayerHealthRechargeMultiplier(playerId, 0.0) + --end if Config.DisableWeaponWheel or Config.DisableAimAssist or Config.DisableVehicleRewards then CreateThread(function() @@ -197,10 +201,15 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) end end + if IsScreenFadedOut() then + DoScreenFadeIn(500) + end + SetDefaultVehicleNumberPlateTextPattern(-1, Config.CustomAIPlates) StartServerSyncLoops() end) + RegisterNetEvent("esx:onPlayerLogout") AddEventHandler("esx:onPlayerLogout", function() ESX.PlayerLoaded = false diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua index cbe34fa0..0fec4584 100644 --- a/[core]/es_extended/client/modules/actions.lua +++ b/[core]/es_extended/client/modules/actions.lua @@ -25,6 +25,7 @@ local function GetData(vehicle) end CreateThread(function() + while not ESX.PlayerLoaded do Wait(200) end while true do ESX.SetPlayerData("coords", GetEntityCoords(playerPed)) if playerPed ~= PlayerPedId() then From 963f10ca5b1495b6634a7d00ca742d00b4dc74cf Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Sun, 28 Jan 2024 21:03:04 +0100 Subject: [PATCH 2/7] remove comments ( debug ) --- [core]/es_extended/client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index 6dab784d..5c2b3375 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -102,9 +102,9 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) end) end - --if Config.DisableHealthRegeneration then - --SetPlayerHealthRechargeMultiplier(playerId, 0.0) - --end + if Config.DisableHealthRegeneration then + SetPlayerHealthRechargeMultiplier(playerId, 0.0) + end if Config.DisableWeaponWheel or Config.DisableAimAssist or Config.DisableVehicleRewards then CreateThread(function() From 585a4e4c2e797c0748d758a070b57798a312597b Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:25:10 +0100 Subject: [PATCH 3/7] fix:(resurrect local player) --- [core]/es_extended/client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index 5c2b3375..de2a0379 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -33,6 +33,7 @@ function ESX.SpawnPlayer(skin, coords, cb) Wait(0) end FreezeEntityPosition(playerPed, false) + NetworkResurrectLocalPlayer(spawn.x, spawn.y, spawn.z, spawn.heading, true, true, false) cb() end From f35d6dc23a45871732c53ea3336a4a62f04e7534 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:26:24 +0100 Subject: [PATCH 4/7] =?UTF-8?q?fix:(spawn=20to=20coords=20=F0=9F=98=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- [core]/es_extended/client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index de2a0379..67c79e49 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -33,7 +33,7 @@ function ESX.SpawnPlayer(skin, coords, cb) Wait(0) end FreezeEntityPosition(playerPed, false) - NetworkResurrectLocalPlayer(spawn.x, spawn.y, spawn.z, spawn.heading, true, true, false) + NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, true, false) cb() end From 31505854bc06d84f9eb6cc07d265ce7ebe5e42a4 Mon Sep 17 00:00:00 2001 From: Thekuca <63980591+Thekuca@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:55:21 +0100 Subject: [PATCH 5/7] fix(lint) --- [core]/es_extended/client/main.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/[core]/es_extended/client/main.lua b/[core]/es_extended/client/main.lua index 67c79e49..9a9e8b08 100644 --- a/[core]/es_extended/client/main.lua +++ b/[core]/es_extended/client/main.lua @@ -19,26 +19,26 @@ RegisterNetEvent("esx:requestModel", function(model) end) function ESX.SpawnPlayer(skin, coords, cb) - local p = promise.new() + local p = promise.new() TriggerEvent("skinchanger:loadSkin", skin, function() p:resolve() end) - Citizen.Await(p) + Citizen.Await(p) local playerPed = PlayerPedId() FreezeEntityPosition(playerPed, true) - SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false, true) + SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false, true) SetEntityHeading(playerPed, coords.heading) while not HasCollisionLoadedAroundEntity(playerPed) do - Wait(0) + Wait(0) end FreezeEntityPosition(playerPed, false) NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, true, false) cb() -end +end RegisterNetEvent("esx:playerLoaded") -AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) +AddEventHandler("esx:playerLoaded", function(xPlayer, _, skin) ESX.PlayerData = xPlayer if not Config.Multichar then @@ -69,7 +69,7 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) end local timer = GetGameTimer() - while not HaveAllStreamingRequestsCompleted(ESX.PlayerData.ped) and (GetGameTimer() - timer) < 2000 do + while not HaveAllStreamingRequestsCompleted(ESX.PlayerData.ped) and (GetGameTimer() - timer) < 2000 do Wait(0) end @@ -202,9 +202,9 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin) end end - if IsScreenFadedOut() then + if IsScreenFadedOut() then DoScreenFadeIn(500) - end + end SetDefaultVehicleNumberPlateTextPattern(-1, Config.CustomAIPlates) StartServerSyncLoops() From 3ecb303bbd634e7db4337b3f43dc65d6f7f9827a Mon Sep 17 00:00:00 2001 From: Thekuca <63980591+Thekuca@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:55:54 +0100 Subject: [PATCH 6/7] fix(lint) --- [core]/es_extended/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index 3020f0a2..6f899f1d 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -1,7 +1,7 @@ Config = {} Config.Locale = GetConvar("esx:locale", "en") -Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing' +Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing' Config.Accounts = { bank = { From 82affe3e1e6b4c8983e3b076274a4669bafb33b5 Mon Sep 17 00:00:00 2001 From: Manifest Bumper <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 20:08:06 +0000 Subject: [PATCH 7/7] chore: bump manifest version to 1.10.4 --- [core]/cron/fxmanifest.lua | 2 +- [core]/es_extended/fxmanifest.lua | 2 +- [core]/esx_context/fxmanifest.lua | 2 +- [core]/esx_identity/fxmanifest.lua | 2 +- [core]/esx_loadingscreen/fxmanifest.lua | 2 +- [core]/esx_menu_default/fxmanifest.lua | 2 +- [core]/esx_menu_dialog/fxmanifest.lua | 2 +- [core]/esx_menu_list/fxmanifest.lua | 2 +- [core]/esx_multicharacter/fxmanifest.lua | 2 +- [core]/esx_notify/fxmanifest.lua | 2 +- [core]/esx_progressbar/fxmanifest.lua | 2 +- [core]/esx_skin/fxmanifest.lua | 2 +- [core]/esx_textui/fxmanifest.lua | 2 +- [core]/skinchanger/fxmanifest.lua | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/[core]/cron/fxmanifest.lua b/[core]/cron/fxmanifest.lua index d84bb2b3..1d0d5298 100644 --- a/[core]/cron/fxmanifest.lua +++ b/[core]/cron/fxmanifest.lua @@ -4,6 +4,6 @@ game 'gta5' author 'ESX-Framework' description 'cron' lua54 'yes' -version '1.10.3' +version '1.10.4' server_script 'server/main.lua' diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index 54d4e7d5..f251e228 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'cerulean' game 'gta5' description 'ES Extended' lua54 'yes' -version '1.10.3' +version '1.10.4' shared_scripts { 'locale.lua', diff --git a/[core]/esx_context/fxmanifest.lua b/[core]/esx_context/fxmanifest.lua index 3f06383c..9e184655 100644 --- a/[core]/esx_context/fxmanifest.lua +++ b/[core]/esx_context/fxmanifest.lua @@ -4,7 +4,7 @@ game 'gta5' author 'ESX-Framework & Brayden' description 'Offical ESX Legacy Context Menu' lua54 'yes' -version '1.10.3' +version '1.10.4' ui_page 'index.html' diff --git a/[core]/esx_identity/fxmanifest.lua b/[core]/esx_identity/fxmanifest.lua index 8cb786ef..a91e66f4 100644 --- a/[core]/esx_identity/fxmanifest.lua +++ b/[core]/esx_identity/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'ESX Identity' lua54 'yes' -version '1.10.3' +version '1.10.4' shared_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_loadingscreen/fxmanifest.lua b/[core]/esx_loadingscreen/fxmanifest.lua index 4ea87a50..c4ddefb0 100644 --- a/[core]/esx_loadingscreen/fxmanifest.lua +++ b/[core]/esx_loadingscreen/fxmanifest.lua @@ -1,6 +1,6 @@ game 'common' -version '1.10.3' +version '1.10.4' fx_version 'cerulean' author 'ESX-Framework' lua54 'yes' diff --git a/[core]/esx_menu_default/fxmanifest.lua b/[core]/esx_menu_default/fxmanifest.lua index 3b4acbd2..56d8b1b3 100644 --- a/[core]/esx_menu_default/fxmanifest.lua +++ b/[core]/esx_menu_default/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'ESX Menu Default' lua54 'yes' -version '1.10.3' +version '1.10.4' client_scripts { '@es_extended/imports.lua', 'client/main.lua' } diff --git a/[core]/esx_menu_dialog/fxmanifest.lua b/[core]/esx_menu_dialog/fxmanifest.lua index 07d3b0a3..093858a8 100644 --- a/[core]/esx_menu_dialog/fxmanifest.lua +++ b/[core]/esx_menu_dialog/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'ESX Menu Dialog' lua54 'yes' -version '1.10.3' +version '1.10.4' client_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_menu_list/fxmanifest.lua b/[core]/esx_menu_list/fxmanifest.lua index 0b37caab..3e3b930a 100644 --- a/[core]/esx_menu_list/fxmanifest.lua +++ b/[core]/esx_menu_list/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'ESX Menu List' lua54 'yes' -version '1.10.3' +version '1.10.4' client_scripts { diff --git a/[core]/esx_multicharacter/fxmanifest.lua b/[core]/esx_multicharacter/fxmanifest.lua index 8d27a35b..ec7bd817 100644 --- a/[core]/esx_multicharacter/fxmanifest.lua +++ b/[core]/esx_multicharacter/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'cerulean' game 'gta5' author 'ESX-Framework - Linden - KASH' description 'Official Multicharacter System For ESX Legacy' -version '1.10.3' +version '1.10.4' lua54 'yes' dependencies { 'es_extended', 'esx_context', 'esx_identity', 'esx_skin' } diff --git a/[core]/esx_notify/fxmanifest.lua b/[core]/esx_notify/fxmanifest.lua index 981a8060..f3f42802 100644 --- a/[core]/esx_notify/fxmanifest.lua +++ b/[core]/esx_notify/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' lua54 'yes' game 'gta5' -version '1.10.3' +version '1.10.4' author 'ESX-Framework' description 'Official NUI Notification system for ESX' diff --git a/[core]/esx_progressbar/fxmanifest.lua b/[core]/esx_progressbar/fxmanifest.lua index 63b59d8c..11596a63 100644 --- a/[core]/esx_progressbar/fxmanifest.lua +++ b/[core]/esx_progressbar/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' author 'ESX-Framework' lua54 'yes' -version '1.10.3' +version '1.10.4' description 'ESX Progressbar' client_scripts { 'Progress.lua' } diff --git a/[core]/esx_skin/fxmanifest.lua b/[core]/esx_skin/fxmanifest.lua index d111e2b3..69029cf1 100644 --- a/[core]/esx_skin/fxmanifest.lua +++ b/[core]/esx_skin/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' game 'gta5' description 'ESX Skin' -version '1.10.3' +version '1.10.4' lua54 'yes' shared_script '@es_extended/imports.lua' diff --git a/[core]/esx_textui/fxmanifest.lua b/[core]/esx_textui/fxmanifest.lua index 8d99a280..939ecbe1 100644 --- a/[core]/esx_textui/fxmanifest.lua +++ b/[core]/esx_textui/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' game 'gta5' author 'ESX-Framework' -version '1.10.3' +version '1.10.4' description 'ESX TextUI' lua54 'yes' diff --git a/[core]/skinchanger/fxmanifest.lua b/[core]/skinchanger/fxmanifest.lua index 2d9e6949..8b12ec90 100644 --- a/[core]/skinchanger/fxmanifest.lua +++ b/[core]/skinchanger/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' lua54 'yes' description 'Official ESX-Legacy resource for handling the Player`s Skin' -version '1.10.3' +version '1.10.4' client_scripts { '@es_extended/locale.lua',