From 9f14b9e7d02d4e1724dc17838979c7782c31da6e Mon Sep 17 00:00:00 2001 From: James Cole <61920219+coleminer0112@users.noreply.github.com> Date: Sun, 26 Dec 2021 18:07:30 +0100 Subject: [PATCH 1/3] Add Event Trigger for Infinite Fuel Toggle Allows custom fuel resources to watch for infinite fuel in vMenu --- vMenu/menus/VehicleOptions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/vMenu/menus/VehicleOptions.cs b/vMenu/menus/VehicleOptions.cs index 54f17b4f..094a5cbc 100644 --- a/vMenu/menus/VehicleOptions.cs +++ b/vMenu/menus/VehicleOptions.cs @@ -644,6 +644,7 @@ private void CreateMenu() else if (item == infiniteFuel) { VehicleInfiniteFuel = _checked; + TriggerEvent("vMenu:InfiniteFuelToggled", _checked); } }; #endregion From e28975f991cf7944597fcc7ec4d466d2767f74f0 Mon Sep 17 00:00:00 2001 From: IS4 Date: Sat, 1 Jan 2022 20:24:36 +0100 Subject: [PATCH 2/3] Change InfiniteAmmo only if WPUnlimitedAmmo is allowed --- vMenu/FunctionsController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vMenu/FunctionsController.cs b/vMenu/FunctionsController.cs index 83692e81..bd40cca2 100644 --- a/vMenu/FunctionsController.cs +++ b/vMenu/FunctionsController.cs @@ -1368,7 +1368,7 @@ private async Task WeaponOptions() } // Enable/disable infinite ammo. - if (IsAllowed(Permission.WPUnlimitedAmmo) && Game.PlayerPed.Weapons.Current != null && Game.PlayerPed.Weapons.Current.Hash != WeaponHash.Unarmed) + if (Game.PlayerPed.Weapons.Current != null && Game.PlayerPed.Weapons.Current.Hash != WeaponHash.Unarmed && IsAllowed(Permission.WPUnlimitedAmmo)) { Game.PlayerPed.Weapons.Current.InfiniteAmmo = MainMenu.WeaponOptionsMenu.UnlimitedAmmo; } From 867be1febdfc8bb6b69bc726688ca131b397f620 Mon Sep 17 00:00:00 2001 From: IS4 Date: Thu, 10 Feb 2022 02:17:01 +0100 Subject: [PATCH 3/3] Update vMenu/FunctionsController.cs Co-authored-by: Christopher M. <10535902+cm8263@users.noreply.github.com> --- vMenu/FunctionsController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vMenu/FunctionsController.cs b/vMenu/FunctionsController.cs index bd40cca2..83692e81 100644 --- a/vMenu/FunctionsController.cs +++ b/vMenu/FunctionsController.cs @@ -1368,7 +1368,7 @@ private async Task WeaponOptions() } // Enable/disable infinite ammo. - if (Game.PlayerPed.Weapons.Current != null && Game.PlayerPed.Weapons.Current.Hash != WeaponHash.Unarmed && IsAllowed(Permission.WPUnlimitedAmmo)) + if (IsAllowed(Permission.WPUnlimitedAmmo) && Game.PlayerPed.Weapons.Current != null && Game.PlayerPed.Weapons.Current.Hash != WeaponHash.Unarmed) { Game.PlayerPed.Weapons.Current.InfiniteAmmo = MainMenu.WeaponOptionsMenu.UnlimitedAmmo; }