From 45166c9f03f7642f57fb580daf1cdc35d3aeaaad Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:04:12 +0100 Subject: [PATCH] feat(es_extended/client/modules/adjustments): add adjustment DisableRadio --- .../es_extended/client/modules/adjustments.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua b/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua index dc8b4f31..0097215e 100644 --- a/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua +++ b/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua @@ -4,13 +4,14 @@ function Adjustments:RemoveHudComponents() for i = 1, #Config.RemoveHudComponents do if Config.RemoveHudComponents[i] then SetHudComponentSize(i, 0.0, 0.0) + SetHudComponentPosition(i, 900, 900) end end end function Adjustments:DisableAimAssist() if Config.DisableAimAssist then - SetPlayerLockon(ESX.playerId, false) + SetPlayerTargetingMode(3) end end @@ -215,6 +216,15 @@ function Adjustments:WantedLevel() end end +function Adjustments:DisableRadio() + if Config.RemoveHudComponents[16] then + AddEventHandler("esx:enteredVehicle", function(vehicle, plate, seat, displayName, netId) + SetVehRadioStation(vehicle,"OFF") + SetUserRadioControlEnabled(false) + end) + end +end + function Adjustments:Load() self:RemoveHudComponents() self:DisableAimAssist() @@ -228,4 +238,5 @@ function Adjustments:Load() self:LicensePlates() self:DiscordPresence() self:WantedLevel() + self:DisableRadio() end