From 8b466eb2b27a766401b3bf869c89f21b51dc07bc Mon Sep 17 00:00:00 2001 From: Amir_Lynx <60301485+AmirLynx@users.noreply.github.com> Date: Wed, 14 Dec 2022 17:40:03 +0330 Subject: [PATCH 01/10] refactor(esx_lscustom\server):fix nil table values --- [esx_addons]/esx_lscustom/server/main.lua | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/[esx_addons]/esx_lscustom/server/main.lua b/[esx_addons]/esx_lscustom/server/main.lua index a2f41376..9c0912ac 100644 --- a/[esx_addons]/esx_lscustom/server/main.lua +++ b/[esx_addons]/esx_lscustom/server/main.lua @@ -4,10 +4,10 @@ local Customs = {} RegisterNetEvent('esx_lscustom:startModing', function(props, netId) local src = tostring(source) if Customs[src] then - Customs[src][props.plate] = {props = props, netId = netId} + Customs[src][tostring(props.plate)] = {props = props, netId = netId} else Customs[src] = {} - Customs[src][props.plate] = {props = props, netId = netId} + Customs[src][tostring(props.plate)] = {props = props, netId = netId} end end) @@ -25,7 +25,7 @@ AddEventHandler('esx:playerDropped', function(src) for k,v in pairs(Customs[src]) do local entity = NetworkGetEntityFromNetworkId(v.netId) if DoesEntityExist(entity) then - if players > 0 then + if playersCount > 0 then TriggerClientEvent('esx_lscustom:restoreMods', -1, v.netId, v.props) else DeleteEntity(entity) @@ -70,16 +70,25 @@ AddEventHandler('esx_lscustom:buyMod', function(price) end) RegisterServerEvent('esx_lscustom:refreshOwnedVehicle') -AddEventHandler('esx_lscustom:refreshOwnedVehicle', function(vehicleProps) +AddEventHandler('esx_lscustom:refreshOwnedVehicle', function(vehicleProps, netId) + local src = tostring(source) local xPlayer = ESX.GetPlayerFromId(source) - MySQL.single('SELECT vehicle FROM owned_vehicles WHERE plate = ?', {vehicleProps.plate}, function(result) if result then local vehicle = json.decode(result.vehicle) if vehicleProps.model == vehicle.model then MySQL.update('UPDATE owned_vehicles SET vehicle = ? WHERE plate = ?', {json.encode(vehicleProps), vehicleProps.plate}) - Customs[tostring(source)][tostring(vehicleProps.plate)].props = props + if Customs[src] then + if Customs[src][tostring(vehicleProps.plate)] then + Customs[src][tostring(vehicleProps.plate)].props = vehicleProps + else + Customs[src][tostring(vehicleProps.plate)] = {props = vehicleProps, netId = netId} + end + else + Customs[src] = {} + Customs[src][tostring(vehicleProps.plate)] = {props = vehicleProps, netId = netId} + end else print(('[^3WARNING^7] Player ^5%s^7 Attempted To upgrade with mismatching vehicle model'):format(xPlayer.source)) end From 27462c40449acee9680e0b8c83927ceac07b170c Mon Sep 17 00:00:00 2001 From: Amir_Lynx <60301485+AmirLynx@users.noreply.github.com> Date: Wed, 14 Dec 2022 17:41:30 +0330 Subject: [PATCH 02/10] refactor(esx_lscustom\config):Missed vehicle price --- [esx_addons]/esx_lscustom/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx_addons]/esx_lscustom/config.lua b/[esx_addons]/esx_lscustom/config.lua index 3ed2514d..c8983ed5 100644 --- a/[esx_addons]/esx_lscustom/config.lua +++ b/[esx_addons]/esx_lscustom/config.lua @@ -472,7 +472,7 @@ Config.Menus = { label = TranslateCap('transmission'), parent = 'upgrades', modType = 13, - price = {13.95, 20.93, 46.51} + price = {13.95, 20.93, 46.51, 63.55} }, modSuspension = { label = TranslateCap('suspension'), From 45f4db04ab4573a2bfbf4a8e2f36bd5b711f1e67 Mon Sep 17 00:00:00 2001 From: Amir_Lynx <60301485+AmirLynx@users.noreply.github.com> Date: Wed, 14 Dec 2022 17:42:01 +0330 Subject: [PATCH 03/10] refactor(esx_lscustom\client):Fixed netid --- [esx_addons]/esx_lscustom/client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/[esx_addons]/esx_lscustom/client/main.lua b/[esx_addons]/esx_lscustom/client/main.lua index c5c79fd6..fefc6934 100644 --- a/[esx_addons]/esx_lscustom/client/main.lua +++ b/[esx_addons]/esx_lscustom/client/main.lua @@ -14,7 +14,7 @@ RegisterNetEvent('esx_lscustom:installMod') AddEventHandler('esx_lscustom:installMod', function() local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) myCar = ESX.Game.GetVehicleProperties(vehicle) - TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar) + TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar, NetworkGetNetworkIdFromEntity(vehicle)) end) RegisterNetEvent('esx_lscustom:restoreMods', function(netId, props) @@ -79,8 +79,8 @@ function OpenLSMenu(elems, menuName, menuTitle, parent) if data.current.label == TranslateCap('by_default') or string.match(data.current.label, TranslateCap('installed')) then ESX.ShowNotification(TranslateCap('already_own', data.current.label)) - myCar = ESX.Game.GetVehicleProperties(vehicle) - TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar) + myCar = ESX.Game.GetVehicleProperties(vehicle) + TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar, NetworkGetNetworkIdFromEntity(vehicle)) else local vehiclePrice = 50000 From d9ad6d9d53ec199acbfc71e26fddac18ea089a30 Mon Sep 17 00:00:00 2001 From: MoskalykA <100430077+MoskalykA@users.noreply.github.com> Date: Thu, 22 Dec 2022 16:10:08 +0100 Subject: [PATCH 04/10] refactor: jquery removal and formatting --- [esx]/esx_loadingscreen/css/index.css | 132 +++++++++++++------------- [esx]/esx_loadingscreen/index.html | 39 ++++---- [esx]/esx_loadingscreen/js/index.js | 18 ++-- 3 files changed, 95 insertions(+), 94 deletions(-) diff --git a/[esx]/esx_loadingscreen/css/index.css b/[esx]/esx_loadingscreen/css/index.css index 9520df8e..6cb39671 100644 --- a/[esx]/esx_loadingscreen/css/index.css +++ b/[esx]/esx_loadingscreen/css/index.css @@ -12,102 +12,106 @@ * This copyright should appear in every part of the project code */ -html,body { - - margin: 0; - padding: 0; - font-family: 'Quicksand', sans-serif; - overflow: hidden; - +html, +body { + margin: 0; + padding: 0; + font-family: "Quicksand", sans-serif; + overflow: hidden; } #esx_intro { - - z-index: 2; - + z-index: 2; } #esx_loop { - - z-index: 1; - + z-index: 1; } #loading_txt { + bottom: 5%; + left: 50%; + margin-left: -80px; + position: absolute; + z-index: 999; - bottom: 5%; - left: 50%; - margin-left: -80px; - position: absolute; - z-index: 999; - - -webkit-animation: fadein 5s; - -moz-animation: fadein 5s; - -ms-animation: fadein 5s; - -o-animation: fadein 5s; - animation: fadein 5s; - + -webkit-animation: fadein 5s; + -moz-animation: fadein 5s; + -ms-animation: fadein 5s; + -o-animation: fadein 5s; + animation: fadein 5s; } p { - - color: white; - font-size: 32px; - + color: white; + font-size: 32px; } .text_thing:after { - content: ' .'; - animation: dots 2s steps(5, end) infinite; + content: " ."; + animation: dots 2s steps(5, end) infinite; } @keyframes dots { - 0%, 20% { - color: rgba(0,0,0,0); - text-shadow: - .25em 0 0 rgba(0,0,0,0), - .5em 0 0 rgba(0,0,0,0); - } - 40% { - color: white; - text-shadow: - .25em 0 0 rgba(0,0,0,0), - .5em 0 0 rgba(0,0,0,0); - } - 60% { - text-shadow: - .25em 0 0 white, - .5em 0 0 rgba(0,0,0,0); - } - 80%, 100% { - text-shadow: - .25em 0 0 white, - .5em 0 0 white; - } + 0%, + 20% { + color: rgba(0, 0, 0, 0); + text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0); + } + 40% { + color: white; + text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0); + } + 60% { + text-shadow: 0.25em 0 0 white, 0.5em 0 0 rgba(0, 0, 0, 0); + } + 80%, + 100% { + text-shadow: 0.25em 0 0 white, 0.5em 0 0 white; + } } - @keyframes fadein { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } @-moz-keyframes fadein { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } @-webkit-keyframes fadein { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } @-ms-keyframes fadein { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } @-o-keyframes fadein { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } diff --git a/[esx]/esx_loadingscreen/index.html b/[esx]/esx_loadingscreen/index.html index ced82440..212b9e7e 100644 --- a/[esx]/esx_loadingscreen/index.html +++ b/[esx]/esx_loadingscreen/index.html @@ -1,28 +1,25 @@ - - - + - - + - - - + +
-
-

Loading

-
+
+

Loading

+
- - + +
- - - - \ No newline at end of file + + diff --git a/[esx]/esx_loadingscreen/js/index.js b/[esx]/esx_loadingscreen/js/index.js index 955be242..e2312b4a 100644 --- a/[esx]/esx_loadingscreen/js/index.js +++ b/[esx]/esx_loadingscreen/js/index.js @@ -10,13 +10,13 @@ // If you redistribute this software, you must link to ORIGINAL repository at https://github.com/esx-framework/esx-reborn // This copyright should appear in every part of the project code -$(document).ready(function(){ - const introTag = document.getElementById('esx_intro'); - const loopTag = document.getElementById('esx_loop'); +document.addEventListener("DOMContentLoaded", () => { + const introTag = document.getElementById("esx_intro"); + const loopTag = document.getElementById("esx_loop"); - introTag.onended = (event) => { - introTag.style.display = "none"; - loopTag.loop = true; // true - loopTag.play() - }; -}) + introTag.onended = () => { + introTag.style.display = "none"; + loopTag.loop = true; // true + loopTag.play(); + }; +}); From f71dcae72a8d8c92a1aa8d8a6e080d68157630b9 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Fri, 23 Dec 2022 13:18:58 +0100 Subject: [PATCH 05/10] fix:(boat license missing) --- [SQL]/legacy.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/[SQL]/legacy.sql b/[SQL]/legacy.sql index 4fb035d1..95924e9e 100644 --- a/[SQL]/legacy.sql +++ b/[SQL]/legacy.sql @@ -329,7 +329,8 @@ INSERT INTO `licenses` (`type`, `label`) VALUES ('drive', 'Drivers License'), ('drive_bike', 'Motorcycle License'), ('drive_truck', 'Commercial Drivers License'), -('weed_processing', 'Weed Processing License'); +('weed_processing', 'Weed Processing License'), +('boat', 'Boat License'); -- -------------------------------------------------------- From 471e19fb538add0b99dbac446a17f3ee941b58fb Mon Sep 17 00:00:00 2001 From: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Mon, 26 Dec 2022 16:14:37 +0530 Subject: [PATCH 06/10] refactor: Pass character data to client --- [esx]/es_extended/server/main.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/[esx]/es_extended/server/main.lua b/[esx]/es_extended/server/main.lua index 87ffeb71..715680ac 100644 --- a/[esx]/es_extended/server/main.lua +++ b/[esx]/es_extended/server/main.lua @@ -308,6 +308,10 @@ function loadESXPlayer(identifier, playerId, isNew) maxWeight = xPlayer.getMaxWeight(), money = xPlayer.getMoney(), sex = xPlayer.get("sex") or "m", + firstName = xPlayer.get("firstName") or "John", + lastName = xPlayer.get("lastName") or "Doe, + dateofbirth = xPlayer.get("dateofbirth") or "01/01/2000", + height = xPlayer.get("height") or 120, dead = false }, isNew, userData.skin) From a92e8456fe8e21e567358db90a29218f99353d28 Mon Sep 17 00:00:00 2001 From: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Mon, 26 Dec 2022 17:15:55 +0530 Subject: [PATCH 07/10] Update main.lua --- [esx]/es_extended/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[esx]/es_extended/server/main.lua b/[esx]/es_extended/server/main.lua index 715680ac..c5a61e85 100644 --- a/[esx]/es_extended/server/main.lua +++ b/[esx]/es_extended/server/main.lua @@ -309,7 +309,7 @@ function loadESXPlayer(identifier, playerId, isNew) money = xPlayer.getMoney(), sex = xPlayer.get("sex") or "m", firstName = xPlayer.get("firstName") or "John", - lastName = xPlayer.get("lastName") or "Doe, + lastName = xPlayer.get("lastName") or "Doe", dateofbirth = xPlayer.get("dateofbirth") or "01/01/2000", height = xPlayer.get("height") or 120, dead = false From 46de4fcb2ca12ef914228de48a3cff1a607ecedd Mon Sep 17 00:00:00 2001 From: TheFarFantomas Date: Tue, 27 Dec 2022 17:10:15 +0100 Subject: [PATCH 08/10] refactor(es_extended/client/main.lua): Remove unused variables and some comments --- [esx]/es_extended/client/main.lua | 102 +++++++++++++++--------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/[esx]/es_extended/client/main.lua b/[esx]/es_extended/client/main.lua index b613f741..570ec5a1 100644 --- a/[esx]/es_extended/client/main.lua +++ b/[esx]/es_extended/client/main.lua @@ -1,5 +1,5 @@ local pickups = {} -local PlayerBank, PlayerMoney = 0,0 + CreateThread(function() while not Config.Multichar do Wait(0) @@ -52,71 +52,71 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin) while ESX.PlayerData.ped == nil do Wait(20) end - -- enable PVP if Config.EnablePVP then SetCanAttackFriendly(ESX.PlayerData.ped, true, false) NetworkSetFriendlyFireOption(true) end - CreateThread(function() - local SetPlayerHealthRechargeMultiplier = SetPlayerHealthRechargeMultiplier - local BlockWeaponWheelThisFrame = BlockWeaponWheelThisFrame - local DisableControlAction = DisableControlAction - local IsPedArmed = IsPedArmed - local SetPlayerLockonRangeOverride = SetPlayerLockonRangeOverride - local DisablePlayerVehicleRewards = DisablePlayerVehicleRewards - local RemoveAllPickupsOfType = RemoveAllPickupsOfType - local HideHudComponentThisFrame = HideHudComponentThisFrame - local PlayerId = PlayerId() - local DisabledComps = {} - for i=1, #(Config.RemoveHudCommonents) do - if Config.RemoveHudCommonents[i] then - DisabledComps[#DisabledComps + 1] = i - end - end - while true do - local Sleep = true + CreateThread(function() + local SetPlayerHealthRechargeMultiplier = SetPlayerHealthRechargeMultiplier + local BlockWeaponWheelThisFrame = BlockWeaponWheelThisFrame + local DisableControlAction = DisableControlAction + local IsPedArmed = IsPedArmed + local SetPlayerLockonRangeOverride = SetPlayerLockonRangeOverride + local DisablePlayerVehicleRewards = DisablePlayerVehicleRewards + local RemoveAllPickupsOfType = RemoveAllPickupsOfType + local HideHudComponentThisFrame = HideHudComponentThisFrame + local PlayerId = PlayerId() + local DisabledComps = {} + for i=1, #(Config.RemoveHudCommonents) do + if Config.RemoveHudCommonents[i] then + DisabledComps[#DisabledComps + 1] = i + end + end - if Config.DisableHealthRegeneration then - Sleep = false - SetPlayerHealthRechargeMultiplier(PlayerId, 0.0) - end + while true do + local Sleep = true - if Config.DisableWeaponWheel then - Sleep = false - BlockWeaponWheelThisFrame() - DisableControlAction(0, 37,true) - end + if Config.DisableHealthRegeneration then + Sleep = false + SetPlayerHealthRechargeMultiplier(PlayerId, 0.0) + end - if Config.DisableAimAssist then - Sleep = false - if IsPedArmed(ESX.PlayerData.ped, 4) then - SetPlayerLockonRangeOverride(PlayerId, 2.0) - end - end + if Config.DisableWeaponWheel then + Sleep = false + BlockWeaponWheelThisFrame() + DisableControlAction(0, 37,true) + end - if Config.DisableVehicleRewards then - Sleep = false - DisablePlayerVehicleRewards(PlayerId) + if Config.DisableAimAssist then + Sleep = false + if IsPedArmed(ESX.PlayerData.ped, 4) then + SetPlayerLockonRangeOverride(PlayerId, 2.0) end + end + + if Config.DisableVehicleRewards then + Sleep = false + DisablePlayerVehicleRewards(PlayerId) + end - if Config.DisableNPCDrops then - Sleep = false - RemoveAllPickupsOfType(0xDF711959) -- carbine rifle - RemoveAllPickupsOfType(0xF9AFB48F) -- pistol - RemoveAllPickupsOfType(0xA9355DCD) -- pumpshotgun - end + if Config.DisableNPCDrops then + Sleep = false + RemoveAllPickupsOfType(0xDF711959) + RemoveAllPickupsOfType(0xF9AFB48F) + RemoveAllPickupsOfType(0xA9355DCD) + end - if #DisabledComps > 0 then - Sleep = false - for i=1, #(DisabledComps) do - HideHudComponentThisFrame(DisabledComps[i]) - end + if #DisabledComps > 0 then + Sleep = false + for i=1, #(DisabledComps) do + HideHudComponentThisFrame(DisabledComps[i]) end + end Wait(Sleep and 1500 or 0) - end - end) + end + end) if Config.EnableHud then for i=1, #(ESX.PlayerData.accounts) do From d214b902e5ab21150a1484b0c8576dfbd312317b Mon Sep 17 00:00:00 2001 From: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Wed, 28 Dec 2022 11:18:50 +0530 Subject: [PATCH 09/10] fix: Backwards compatibility for closing context menu --- [esx]/esx_context/main.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/[esx]/esx_context/main.lua b/[esx]/esx_context/main.lua index 8a2769c9..0a0567d7 100644 --- a/[esx]/esx_context/main.lua +++ b/[esx]/esx_context/main.lua @@ -13,6 +13,9 @@ function Post(fn,...) end function Open(position,eles,onSelect,onClose,canClose) + if canClose == nil then + canClose = true + end activeMenu = { position = position, eles = eles, From 19f0365b57230e1346dfc144c985940a82282653 Mon Sep 17 00:00:00 2001 From: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Wed, 28 Dec 2022 11:32:33 +0530 Subject: [PATCH 10/10] fix: Changed it to the same as the main so now issues in merge --- [esx]/esx_context/main.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/[esx]/esx_context/main.lua b/[esx]/esx_context/main.lua index 0a0567d7..6c16fc7d 100644 --- a/[esx]/esx_context/main.lua +++ b/[esx]/esx_context/main.lua @@ -13,9 +13,7 @@ function Post(fn,...) end function Open(position,eles,onSelect,onClose,canClose) - if canClose == nil then - canClose = true - end + local canClose = canClose == nil and true or canClose activeMenu = { position = position, eles = eles,