From 1d2ed0a0520ad34b7f638aba6b5ec34781841a48 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 4 Jan 2025 23:40:23 -0800 Subject: [PATCH 1/2] slowed loops if you dont have a weapon I put a wait(1500) if unarmed and a 1000 if there isnt CurrentWeaponData this slows down the loops running while not using a weapon and gave less of a wait than a typical weapondraw animation so this should have minimal blowbacks for the 1.5 seconds it may miss on my personal computer it took client side resmon down from 0.04 to 0.00 on idle --- client/main.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 813ee33..ac270ac 100644 --- a/client/main.lua +++ b/client/main.lua @@ -183,6 +183,7 @@ CreateThread(function() SetWeaponsNoAutoswap(true) end) + CreateThread(function() while true do local ped = PlayerPedId() @@ -194,8 +195,10 @@ CreateThread(function() TriggerServerEvent('qb-weapons:server:UpdateWeaponQuality', CurrentWeaponData, MultiplierAmount) MultiplierAmount = 0 end + Wait(0) + else + Wait(1500) end - Wait(0) end end) @@ -222,9 +225,11 @@ CreateThread(function() end end end + Wait(0) + else + Wait(1000) end end - Wait(0) end end) From b2d494e6adc0f761b5b4a118cdd1cc658d3fd771 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sun, 5 Jan 2025 23:41:40 -0800 Subject: [PATCH 2/2] fix for qwerty pogaroo should be good, checks now if you have a weapon then runs the loop if true --- client/main.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index ac270ac..0831f63 100644 --- a/client/main.lua +++ b/client/main.lua @@ -187,17 +187,19 @@ end) CreateThread(function() while true do local ped = PlayerPedId() - if IsPedArmed(ped, 7) == 1 and (IsControlJustReleased(0, 24) or IsDisabledControlJustReleased(0, 24)) then - local weapon = GetSelectedPedWeapon(ped) - local ammo = GetAmmoInPedWeapon(ped, weapon) - TriggerServerEvent('qb-weapons:server:UpdateWeaponAmmo', CurrentWeaponData, tonumber(ammo)) - if MultiplierAmount > 0 then - TriggerServerEvent('qb-weapons:server:UpdateWeaponQuality', CurrentWeaponData, MultiplierAmount) - MultiplierAmount = 0 + if GetSelectedPedWeapon(ped) ~= `WEAPON_UNARMED` then + if IsPedArmed(ped, 7) == 1 and (IsControlJustReleased(0, 24) or IsDisabledControlJustReleased(0, 24)) then + local weapon = GetSelectedPedWeapon(ped) + local ammo = GetAmmoInPedWeapon(ped, weapon) + TriggerServerEvent('qb-weapons:server:UpdateWeaponAmmo', CurrentWeaponData, tonumber(ammo)) + if MultiplierAmount > 0 then + TriggerServerEvent('qb-weapons:server:UpdateWeaponQuality', CurrentWeaponData, MultiplierAmount) + MultiplierAmount = 0 + end end Wait(0) else - Wait(1500) + Wait(1000) end end end) @@ -230,6 +232,7 @@ CreateThread(function() Wait(1000) end end + Wait(1) end end)