From faace18968018a6e3d81bdc3755bd82b8b46fa93 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:52:32 +0200 Subject: [PATCH 1/5] fix(es_extended): xPlayer.getCoords backwards compatibility --- [core]/es_extended/server/classes/player.lua | 22 ++++++++++++++------ [core]/es_extended/server/functions.lua | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua index 8d389d7f..e284f96e 100644 --- a/[core]/es_extended/server/classes/player.lua +++ b/[core]/es_extended/server/classes/player.lua @@ -77,13 +77,23 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end ---@param vector boolean - ---@return vector3 | table - function self.getCoords(vector) - local ped = _GetPlayerPed(self.source) - local coordinates = _GetEntityCoords(ped) - local heading = _GetEntityHeading(ped) + --- @param heading boolean + ---@return vector3 | vector4 | table + function self.getCoords(vector, heading) + local ped = _GetPlayerPed(self.source) + local coords = _GetEntityCoords(ped) - return vector and vector4(coordinates.xyz, heading) or { x = coordinates.x, y = coordinates.y, z = coordinates.z, heading = heading } + local coordinates + if vector then + coordinates = (heading and vector4(coords.xyz, _GetEntityHeading(ped)) or coords) + else + coordinates = { x = coords.x, y = coords.y, z = coords.z } + if heading then + coordinates.heading = _GetEntityHeading(ped) + end + end + + return coordinates end ---@param reason string diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index dcf313d3..4ed4b39a 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -199,7 +199,7 @@ function Core.SavePlayer(xPlayer, cb) xPlayer.job.name, xPlayer.job.grade, xPlayer.group, - json.encode(xPlayer.getCoords()), + json.encode(xPlayer.getCoords(false, true)), json.encode(xPlayer.getInventory(true)), json.encode(xPlayer.getLoadout(true)), json.encode(xPlayer.getMeta()), From 2804607a19eb9355a8246dcb0436b2c4951c8558 Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:54:18 +0200 Subject: [PATCH 2/5] adjusting param --- [core]/es_extended/server/classes/player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua index e284f96e..921db13b 100644 --- a/[core]/es_extended/server/classes/player.lua +++ b/[core]/es_extended/server/classes/player.lua @@ -77,7 +77,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end ---@param vector boolean - --- @param heading boolean + ---@param heading boolean ---@return vector3 | vector4 | table function self.getCoords(vector, heading) local ped = _GetPlayerPed(self.source) From b6795a2bf7be3c9372126c44fc4c4b4ad4a638a4 Mon Sep 17 00:00:00 2001 From: Gellipapa Date: Wed, 19 Jun 2024 00:06:33 +0200 Subject: [PATCH 3/5] :ambulance: Remove duplicated common/functions.lua in fxmanifest --- [core]/es_extended/fxmanifest.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index 03113e1d..45cf791f 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -44,8 +44,7 @@ client_scripts { 'common/modules/*.lua', 'common/functions.lua', - - 'common/functions.lua', + 'client/modules/actions.lua', 'client/modules/death.lua', 'client/modules/npwd.lua', From fde64e507ab86d84ff306a549051e2b2985c4ad9 Mon Sep 17 00:00:00 2001 From: Gellipapa Date: Wed, 19 Jun 2024 00:08:05 +0200 Subject: [PATCH 4/5] :package: Bump version to 1.10.7 --- [core]/cron/fxmanifest.lua | 2 +- [core]/es_extended/fxmanifest.lua | 4 ++-- [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, 15 insertions(+), 15 deletions(-) diff --git a/[core]/cron/fxmanifest.lua b/[core]/cron/fxmanifest.lua index 6da2c691..9e6882e7 100644 --- a/[core]/cron/fxmanifest.lua +++ b/[core]/cron/fxmanifest.lua @@ -4,6 +4,6 @@ game 'gta5' author 'ESX-Framework' description 'Allows resources to Run tasks at specific intervals.' lua54 'yes' -version '1.10.6' +version '1.10.7' server_script 'server/main.lua' diff --git a/[core]/es_extended/fxmanifest.lua b/[core]/es_extended/fxmanifest.lua index 45cf791f..7f8055f4 100644 --- a/[core]/es_extended/fxmanifest.lua +++ b/[core]/es_extended/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'cerulean' game 'gta5' description 'The Core resource that provides the functionalities for all other resources.' lua54 'yes' -version '1.10.6' +version '1.10.7' shared_scripts { 'locale.lua', @@ -44,7 +44,7 @@ client_scripts { 'common/modules/*.lua', 'common/functions.lua', - + 'client/modules/actions.lua', 'client/modules/death.lua', 'client/modules/npwd.lua', diff --git a/[core]/esx_context/fxmanifest.lua b/[core]/esx_context/fxmanifest.lua index f48997b3..4f0c8daf 100644 --- a/[core]/esx_context/fxmanifest.lua +++ b/[core]/esx_context/fxmanifest.lua @@ -4,7 +4,7 @@ game 'gta5' author 'ESX-Framework & Brayden' description 'A simplistic context menu for ESX.' lua54 'yes' -version '1.10.6' +version '1.10.7' ui_page 'index.html' diff --git a/[core]/esx_identity/fxmanifest.lua b/[core]/esx_identity/fxmanifest.lua index d189ca7d..22b6edd4 100644 --- a/[core]/esx_identity/fxmanifest.lua +++ b/[core]/esx_identity/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' description 'Allows the player to Pick their characters: Name, Gender, Height and Date-of-birth.' lua54 'yes' -version '1.10.6' +version '1.10.7' shared_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_loadingscreen/fxmanifest.lua b/[core]/esx_loadingscreen/fxmanifest.lua index e51dde92..c85e37d0 100644 --- a/[core]/esx_loadingscreen/fxmanifest.lua +++ b/[core]/esx_loadingscreen/fxmanifest.lua @@ -3,7 +3,7 @@ game 'common' fx_version 'cerulean' author 'ESX-Framework' description 'Allows resources to Run tasks at specific intervals.' -version '1.10.6' +version '1.10.7' lua54 'yes' loadscreen 'index.html' diff --git a/[core]/esx_menu_default/fxmanifest.lua b/[core]/esx_menu_default/fxmanifest.lua index 18796e26..824d5991 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 'A basic menu system for ESX Legacy.' lua54 'yes' -version '1.10.6' +version '1.10.7' 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 cb589cfa..36c33a7d 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 'A basic input dialog for ESX Legacy.' lua54 'yes' -version '1.10.6' +version '1.10.7' client_scripts { '@es_extended/imports.lua', diff --git a/[core]/esx_menu_list/fxmanifest.lua b/[core]/esx_menu_list/fxmanifest.lua index c08dfec3..fbca7c74 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 'A basic table-based menu system for ESX Legacy.' lua54 'yes' -version '1.10.6' +version '1.10.7' client_scripts { diff --git a/[core]/esx_multicharacter/fxmanifest.lua b/[core]/esx_multicharacter/fxmanifest.lua index 70deccc0..a516a27f 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 'Allows players to have multiple characters on the same account.' -version '1.10.6' +version '1.10.7' 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 55c29e10..c42bbe99 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.6' +version '1.10.7' author 'ESX-Framework' description 'A beautiful and simple NUI notification system for ESX' diff --git a/[core]/esx_progressbar/fxmanifest.lua b/[core]/esx_progressbar/fxmanifest.lua index cc0a667d..82bfd289 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' description 'A beautiful and simple NUI progress bar for ESX' -version '1.10.6' +version '1.10.7' lua54 'yes' client_scripts { 'Progress.lua' } diff --git a/[core]/esx_skin/fxmanifest.lua b/[core]/esx_skin/fxmanifest.lua index be7e575e..319cab13 100644 --- a/[core]/esx_skin/fxmanifest.lua +++ b/[core]/esx_skin/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' game 'gta5' description 'Allows players to customise their character\'s appearance' -version '1.10.6' +version '1.10.7' lua54 'yes' shared_script '@es_extended/imports.lua' diff --git a/[core]/esx_textui/fxmanifest.lua b/[core]/esx_textui/fxmanifest.lua index 4b9db8a3..a0bb66fb 100644 --- a/[core]/esx_textui/fxmanifest.lua +++ b/[core]/esx_textui/fxmanifest.lua @@ -3,7 +3,7 @@ fx_version 'adamant' game 'gta5' author 'ESX-Framework' description 'A beautiful and simple Persistent Notification system for ESX.' -version '1.10.6' +version '1.10.7' lua54 'yes' client_scripts { 'TextUI.lua' } diff --git a/[core]/skinchanger/fxmanifest.lua b/[core]/skinchanger/fxmanifest.lua index de4c2101..60b7c79e 100644 --- a/[core]/skinchanger/fxmanifest.lua +++ b/[core]/skinchanger/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version 'adamant' game 'gta5' description 'Saves/loads character appearances for ESX Legacy.' -version '1.10.6' +version '1.10.7' lua54 'yes' client_scripts { From e7bae0531492256ff7777b9a11ce77edf2561ef2 Mon Sep 17 00:00:00 2001 From: Gellipapa Date: Wed, 19 Jun 2024 00:15:44 +0200 Subject: [PATCH 5/5] :recycle: refactor getCoords, and fix lint issues --- [core]/es_extended/server/classes/player.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua index 921db13b..5b36912b 100644 --- a/[core]/es_extended/server/classes/player.lua +++ b/[core]/es_extended/server/classes/player.lua @@ -80,20 +80,21 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, ---@param heading boolean ---@return vector3 | vector4 | table function self.getCoords(vector, heading) - local ped = _GetPlayerPed(self.source) - local coords = _GetEntityCoords(ped) + local ped = _GetPlayerPed(self.source) + local entityCoords = _GetEntityCoords(ped) + local entityHeading = _GetEntityHeading(ped) + + local coordinates = { x = entityCoords.x, y = entityCoords.y, z = entityCoords.z } - local coordinates if vector then - coordinates = (heading and vector4(coords.xyz, _GetEntityHeading(ped)) or coords) - else - coordinates = { x = coords.x, y = coords.y, z = coords.z } - if heading then - coordinates.heading = _GetEntityHeading(ped) + coordinates = (heading and vector4(entityCoords.xyz, entityHeading) or entityCoords) + else + if heading then + coordinates.heading = entityHeading end end - return coordinates + return coordinates end ---@param reason string