From f055e1e8f5c95b873bd9a4ad8657c95910c5abc5 Mon Sep 17 00:00:00 2001 From: Lenix <149199196+LenixDev@users.noreply.github.com> Date: Thu, 8 Jan 2026 08:17:44 -0800 Subject: [PATCH 1/4] fix(qbx_afk): add disabled option to config and skip execution if disabled - Added "disabled" flag to config.json to enable/disable AFK functionality - Updated server.lua to return early if AFK feature is disabled in config - Prevents further execution when disabled to disable AFK checks and tracking --- qbx_afk/config.json | 3 ++- qbx_afk/server.lua | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qbx_afk/config.json b/qbx_afk/config.json index f53956d..e9cc627 100644 --- a/qbx_afk/config.json +++ b/qbx_afk/config.json @@ -3,5 +3,6 @@ "ignoreGroupsForAFK": { "mod": true, "admin": true - } + }, + "disabled": false } diff --git a/qbx_afk/server.lua b/qbx_afk/server.lua index 7ee4b15..9a7e726 100644 --- a/qbx_afk/server.lua +++ b/qbx_afk/server.lua @@ -1,4 +1,5 @@ local config = lib.loadJson('qbx_afk.config') +if config.disabled then return end local loggedInPlayers = {} local checkUser = {} From 988b96aaa5b797b9a4f2b84518ba41fe418aca9c Mon Sep 17 00:00:00 2001 From: Lenix <149199196+LenixDev@users.noreply.github.com> Date: Thu, 8 Jan 2026 08:21:54 -0800 Subject: [PATCH 2/4] feat(hud): add radio station disable option and refactor HUD handling - Introduce config option to disable GTA radio station display in vehicles - Cache the function to set radio station to optimize loop execution - Override radio station function when the disable option is enabled - Call setRadioStation and hide HUD components every frame in the main loop - Disable specified controls and optionally display ammo in each frame - Refactor client.lua for better readability and performance improvements --- qbx_hudcomponents/client.lua | 21 ++++++++++++++++++--- qbx_hudcomponents/config.lua | 6 ++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/qbx_hudcomponents/client.lua b/qbx_hudcomponents/client.lua index 3afbd69..0693054 100644 --- a/qbx_hudcomponents/client.lua +++ b/qbx_hudcomponents/client.lua @@ -2,16 +2,31 @@ local config = require 'qbx_hudcomponents.config' local disableHudComponents = config.disable.hudComponents local disableControls = config.disable.controls local displayAmmo = config.disable.displayAmmo +local radioStation = config.disable.radioStation + +-- caching the function instead of checking it later in a loop +local setRadioStation = function() end CreateThread(function() - for i = 1, #disableHudComponents do - SetHudComponentSize(disableHudComponents[i],0.0,0.0) + if radioStation then + -- overriding the default function if the state of radioStation is truthy + setRadioStation = function() + SetVehRadioStation(GetVehiclePedIsIn(PlayerPedId(), false), '') + DisableControlAction(2, 85, true) end - + end while true do + setRadioStation() + -- dropping the native in a loop since it should be called every frame + for i = 1, #disableHudComponents do + HideHudComponentThisFrame(disableHudComponents[i]) + end + for i = 1, #disableControls do DisableControlAction(2, disableControls[i], true) end + + DisplayAmmoThisFrame(displayAmmo) Wait(0) end end) diff --git a/qbx_hudcomponents/config.lua b/qbx_hudcomponents/config.lua index 47e68ac..ca49992 100644 --- a/qbx_hudcomponents/config.lua +++ b/qbx_hudcomponents/config.lua @@ -8,5 +8,11 @@ return { -- the small white dot in the middle of the screen when aiming with a weapon. recticle = true, + + -- whether or not to display ammo in the top right corner of the screen. + displayAmmo = true, + + -- whether or not to display the gta radio station script inside the vehicle + radioStation = true } } From d8ede0a6aeecc78feb5f971b640bd84e438ee167 Mon Sep 17 00:00:00 2001 From: Lenix <149199196+LenixDev@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:21:39 -0800 Subject: [PATCH 3/4] feat(ignore): disable melee attacks with weapons when configured - Add configuration option to disable melee attacks with weapons - Implement a continuous check to disable melee attack controls if player holds a weapon that is not melee or unarmed - Prevent weapon melee attacks by disabling related control actions - Ensure this feature runs on a dedicated thread for responsiveness --- qbx_ignore/client.lua | 21 +++++++++++++++++++++ qbx_ignore/config.lua | 2 ++ 2 files changed, 23 insertions(+) diff --git a/qbx_ignore/client.lua b/qbx_ignore/client.lua index 847ad22..4df47a1 100644 --- a/qbx_ignore/client.lua +++ b/qbx_ignore/client.lua @@ -16,6 +16,27 @@ CreateThread(function() end end) +CreateThread(function() + if config.disable.meleeWithWeapon then + -- Disable weapon melee attacks + while true do + local ped = cache.ped + local weapon = GetSelectedPedWeapon(ped) + local weaponGroup = GetWeapontypeGroup(weapon) + + if weaponGroup ~= `GROUP_MELEE` and weaponGroup ~= `GROUP_UNARMED` then + DisableControlAction(0, 140, true) -- Melee Attack Light + DisableControlAction(0, 141, true) -- Melee Attack Heavy + DisableControlAction(0, 142, true) -- Melee Attack Alternate + DisableControlAction(0, 263, true) -- Melee Attack 1 + DisableControlAction(0, 264, true) -- Melee Attack 2 + end + + Wait(0) + end + end +end) + AddEventHandler('populationPedCreating', function(x, y, z) Wait(500) -- Give the entity some time to be created local _, handle = GetClosestPed(x, y, z, 1.0) -- Get the entity handle diff --git a/qbx_ignore/config.lua b/qbx_ignore/config.lua index d796828..e37df86 100644 --- a/qbx_ignore/config.lua +++ b/qbx_ignore/config.lua @@ -9,6 +9,8 @@ return { -- Disables headshots instantly killing players headshots = false, + -- Disables melee attacks with weapons (e.g. using a gun to hit someone close to) + meleeWithWeapon = true, }, blacklisted = { From 5165dc21948acd3088edbd1f385319af44b674b5 Mon Sep 17 00:00:00 2001 From: Lenix <149199196+LenixDev@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:31:25 -0800 Subject: [PATCH 4/4] chore(fxmanifest): bump version to 0.3.0 - Updated version in fxmanifest.lua from 0.2.0 to 0.3.0 --- fxmanifest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index 9a3d0db..8265b32 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -4,7 +4,7 @@ game 'gta5' name 'qbx_smallresources' description 'Collection of small scripts' repository 'https://github.com/Qbox-project/qbx_smallresources' -version '0.2.0' +version '0.3.0' ox_lib 'locale'