From 068144757cda3715bd420de040e7f93a2784c1fe Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:38:47 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20bpt=5Fteleport=20=F0=9F=8E=A8=20Run=20?= =?UTF-8?q?formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[bpt_addons]/bpt_teleport/fxmanifest.lua | 16 +- .../[bpt_addons]/bpt_teleport/locales/en.lua | 4 +- .../[bpt_addons]/bpt_teleport/locales/it.lua | 4 +- .../[bpt_addons]/bpt_teleport/warehouses.lua | 137 +++++++++++------- 4 files changed, 97 insertions(+), 64 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_teleport/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_teleport/fxmanifest.lua index 81751c032..e197489db 100644 --- a/server-data/resources/[bpt_addons]/bpt_teleport/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_teleport/fxmanifest.lua @@ -2,19 +2,19 @@ fx_version("cerulean") game("gta5") author("bitpredator") description("bpt_teleport") -version("1.0.0") +version("1.0.1") shared_script("@es_extended/imports.lua") client_scripts({ - "@es_extended/locale.lua", - "locales/*.lua", - "config.lua", - "warehouses.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "warehouses.lua", }) server_scripts({ - "@es_extended/locale.lua", - "locales/*.lua", - "config.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", }) diff --git a/server-data/resources/[bpt_addons]/bpt_teleport/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_teleport/locales/en.lua index f1f8e663d..6b610dbff 100644 --- a/server-data/resources/[bpt_addons]/bpt_teleport/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_teleport/locales/en.lua @@ -1,4 +1,4 @@ Locales["en"] = { - ["press_to_enter"] = "press ~INPUT_CONTEXT~ to enter the building.", - ["press_to_exit"] = "press ~INPUT_CONTEXT~ to exit the building.", + ["press_to_enter"] = "press ~INPUT_CONTEXT~ to enter the building.", + ["press_to_exit"] = "press ~INPUT_CONTEXT~ to exit the building.", } diff --git a/server-data/resources/[bpt_addons]/bpt_teleport/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_teleport/locales/it.lua index a90be62f8..093eef79c 100644 --- a/server-data/resources/[bpt_addons]/bpt_teleport/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_teleport/locales/it.lua @@ -1,4 +1,4 @@ Locales["it"] = { - ["press_to_enter"] = "Premi ~INPUT_CONTEXT~ per entrare nell edificio.", - ["press_to_exit"] = "Premi ~INPUT_CONTEXT~ per uscire dall edificio.", + ["press_to_enter"] = "Premi ~INPUT_CONTEXT~ per entrare nell edificio.", + ["press_to_exit"] = "Premi ~INPUT_CONTEXT~ per uscire dall edificio.", } diff --git a/server-data/resources/[bpt_addons]/bpt_teleport/warehouses.lua b/server-data/resources/[bpt_addons]/bpt_teleport/warehouses.lua index 8630fa1c3..3b49f8e63 100644 --- a/server-data/resources/[bpt_addons]/bpt_teleport/warehouses.lua +++ b/server-data/resources/[bpt_addons]/bpt_teleport/warehouses.lua @@ -1,60 +1,93 @@ ESX = exports["es_extended"]:getSharedObject() CreateThread(function() - while true do - Wait(0) - local playerCoords = GetEntityCoords(PlayerPedId(), true) - -- import enter check - if GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, 1025.393433, -2398.905518, 29.903320, true) <= 3.0 then - ESX.ShowHelpNotification(_U('press_to_enter')) - if IsControlPressed(0, 51) then - DoScreenFadeOut(1000) - Wait(1500) - SetEntityCoords(PlayerPedId(), 1022.123108, -2398.377930, 30.122314) - Wait(1000) - DoScreenFadeIn(1000) - end - end + while true do + Wait(0) + local playerCoords = GetEntityCoords(PlayerPedId(), true) + -- import enter check + if + GetDistanceBetweenCoords( + playerCoords.x, + playerCoords.y, + playerCoords.z, + 1025.393433, + -2398.905518, + 29.903320, + true + ) <= 3.0 + then + ESX.ShowHelpNotification(_U("press_to_enter")) + if IsControlPressed(0, 51) then + DoScreenFadeOut(1000) + Wait(1500) + SetEntityCoords(PlayerPedId(), 1022.123108, -2398.377930, 30.122314) + Wait(1000) + DoScreenFadeIn(1000) + end + end - -- import exit - if GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, 1022.123108, -2398.377930, 30.122314, true) <= 3.0 then - ESX.ShowHelpNotification(_U('press_to_exit')) - if IsControlPressed(0, 51) then - DoScreenFadeOut(1000) - Wait(1500) - SetEntityCoords(PlayerPedId(), 1025.459351, -2398.865967, 29.903320, 239.736) - Wait(1000) - DoScreenFadeIn(1000) - end - end - end + -- import exit + if + GetDistanceBetweenCoords( + playerCoords.x, + playerCoords.y, + playerCoords.z, + 1022.123108, + -2398.377930, + 30.122314, + true + ) <= 3.0 + then + ESX.ShowHelpNotification(_U("press_to_exit")) + if IsControlPressed(0, 51) then + DoScreenFadeOut(1000) + Wait(1500) + SetEntityCoords(PlayerPedId(), 1025.459351, -2398.865967, 29.903320, 239.736) + Wait(1000) + DoScreenFadeIn(1000) + end + end + end end) -- Unicorn CreateThread(function() - while true do - Wait(0) - local playerCoords = GetEntityCoords(PlayerPedId(), true) - if GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, 132.608, -1293.978, 28.269, true) <= 3.0 then - ESX.ShowHelpNotification(_U('press_to_enter')) - if IsControlPressed(0, 51) then - DoScreenFadeOut(1000) - Wait(1500) - SetEntityCoords(PlayerPedId(), 126.742, -1278.386, 28.569) - Wait(1000) - DoScreenFadeIn(1000) - end - end - -- import exit - if GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, 132.540665, -1290.329712, 29.263062, true) <= 3.0 then - ESX.ShowHelpNotification(_U('press_to_exit')) - if IsControlPressed(0, 51) then - DoScreenFadeOut(1000) - Wait(1500) - SetEntityCoords(PlayerPedId(), 132.527481, -1294.153809, 29.263062) - Wait(1000) - DoScreenFadeIn(1000) - end - end - end -end) \ No newline at end of file + while true do + Wait(0) + local playerCoords = GetEntityCoords(PlayerPedId(), true) + if + GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, 132.608, -1293.978, 28.269, true) + <= 3.0 + then + ESX.ShowHelpNotification(_U("press_to_enter")) + if IsControlPressed(0, 51) then + DoScreenFadeOut(1000) + Wait(1500) + SetEntityCoords(PlayerPedId(), 126.742, -1278.386, 28.569) + Wait(1000) + DoScreenFadeIn(1000) + end + end + -- import exit + if + GetDistanceBetweenCoords( + playerCoords.x, + playerCoords.y, + playerCoords.z, + 132.540665, + -1290.329712, + 29.263062, + true + ) <= 3.0 + then + ESX.ShowHelpNotification(_U("press_to_exit")) + if IsControlPressed(0, 51) then + DoScreenFadeOut(1000) + Wait(1500) + SetEntityCoords(PlayerPedId(), 132.527481, -1294.153809, 29.263062) + Wait(1000) + DoScreenFadeIn(1000) + end + end + end +end)