diff --git a/PERMISSIONS.md b/PERMISSIONS.md index 252f68e8..ab4c3aa7 100644 --- a/PERMISSIONS.md +++ b/PERMISSIONS.md @@ -58,6 +58,7 @@ |`vMenu.VehicleOptions.Menu`|Grants access to the Vehicle Options Menu.|Allowed| |`vMenu.VehicleOptions.All`|Grants access to **ALL** `Vehicle Options Menu` options.|Denied| |`vMenu.VehicleOptions.God`|Allows you to enable vehicle godmode.|Allowed| +|`vMenu.VehicleOptions.SpecialGod`|Allows you to enable a special vehicle godmode which repairs your vehicle instantly when it gets damaged, this is required for vehicles like the Phantom Wedge to keep them from slowly losing health even with regular god mode turned on.|Allowed| |`vMenu.VehicleOptions.Repair`|Allows you to repair your vehicle.|Allowed| |`vMenu.VehicleOptions.Wash`|Allows you to wash/clean your vehicle & set a custom dirt level.|Allowed| |`vMenu.VehicleOptions.Engine`|Allows you to toggle your engine on/off.|Allowed| diff --git a/vMenu/FunctionsController.cs b/vMenu/FunctionsController.cs index 5efabd39..5e2f6793 100644 --- a/vMenu/FunctionsController.cs +++ b/vMenu/FunctionsController.cs @@ -268,6 +268,11 @@ private async Task VehicleOptions() { vd.CanBeBroken = !god; } + bool specialgod = MainMenu.VehicleOptionsMenu.VehicleSpecialGodMode && cf.IsAllowed(Permission.VOSpecialGod); + if (specialgod && vehicle.Health != vehicle.MaxHealth) + { + vehicle.Repair(); // repair vehicle if special god mode is on and the vehicle is not full health. + } // Freeze Vehicle Position (if enabled). if (MainMenu.VehicleOptionsMenu.VehicleFrozen && cf.IsAllowed(Permission.VOFreeze)) diff --git a/vMenu/PermissionsManager.cs b/vMenu/PermissionsManager.cs index 462e3d49..0bc66469 100644 --- a/vMenu/PermissionsManager.cs +++ b/vMenu/PermissionsManager.cs @@ -47,6 +47,7 @@ public enum Permission VOMenu, VOAll, VOGod, + VOSpecialGod, VORepair, VOWash, VOEngine, diff --git a/vMenu/menus/VehicleOptions.cs b/vMenu/menus/VehicleOptions.cs index 2dc1ffe1..a70ca793 100644 --- a/vMenu/menus/VehicleOptions.cs +++ b/vMenu/menus/VehicleOptions.cs @@ -31,6 +31,7 @@ public class VehicleOptions // Public variables (getters only), return the private variables. public bool VehicleGodMode { get; private set; } = UserDefaults.VehicleGodMode; + public bool VehicleSpecialGodMode { get; private set; } = UserDefaults.VehicleSpecialGodMode; public bool VehicleEngineAlwaysOn { get; private set; } = UserDefaults.VehicleEngineAlwaysOn; public bool VehicleNoSiren { get; private set; } = UserDefaults.VehicleNoSiren; public bool VehicleNoBikeHelemet { get; private set; } = UserDefaults.VehicleNoBikeHelmet; @@ -60,6 +61,8 @@ private void CreateMenu() #region menu variables // Create Checkboxes. UIMenuCheckboxItem vehicleGod = new UIMenuCheckboxItem("Vehicle God Mode", VehicleGodMode, "Your vehicle will not be able to take visual or physical damage."); + UIMenuCheckboxItem vehicleSpecialGod = new UIMenuCheckboxItem("Special Vehicle God Mode", VehicleSpecialGodMode, "This option repairs your vehicle immediately when " + + "it gets damaged. This special god mode is needed for vehicles like the Phantom Wedge to keep it from breaking down with regular god mode turned on."); UIMenuCheckboxItem vehicleEngineAO = new UIMenuCheckboxItem("Engine Always On", VehicleEngineAlwaysOn, "Keeps your vehicle engine on when you exit your vehicle."); UIMenuCheckboxItem vehicleNoSiren = new UIMenuCheckboxItem("Disable Siren", VehicleNoSiren, "Disables your vehicle's siren. Only works if your vehicle actually has a siren."); UIMenuCheckboxItem vehicleNoBikeHelmet = new UIMenuCheckboxItem("No Bike Helmet", VehicleNoBikeHelemet, "No longer auto-equip a helmet when getting on a bike or quad."); @@ -198,6 +201,10 @@ private void CreateMenu() { menu.AddItem(vehicleGod); } + if (cf.IsAllowed(Permission.VOSpecialGod)) // special god mode + { + menu.AddItem(vehicleSpecialGod); + } if (cf.IsAllowed(Permission.VORepair)) // REPAIR VEHICLE { menu.AddItem(fixVehicle); @@ -423,6 +430,10 @@ private void CreateMenu() { VehicleGodMode = _checked; } + else if (item == vehicleSpecialGod) // special god mode + { + VehicleSpecialGodMode = _checked; + } else if (item == vehicleFreeze) // Freeze Vehicle Toggled { VehicleFrozen = _checked; diff --git a/vMenuServer/MainServer.cs b/vMenuServer/MainServer.cs index c6fe04bc..a105b14e 100644 --- a/vMenuServer/MainServer.cs +++ b/vMenuServer/MainServer.cs @@ -91,6 +91,7 @@ public class MainServer : BaseScript "VOMenu", "VOAll", "VOGod", + "VOSpecialGod", "VORepair", "VOWash", "VOEngine", diff --git a/vMenuServer/config/permissions.cfg b/vMenuServer/config/permissions.cfg index c50d18e7..fbcb4ca2 100644 --- a/vMenuServer/config/permissions.cfg +++ b/vMenuServer/config/permissions.cfg @@ -70,6 +70,7 @@ add_ace builtin.everyone "vMenu.PlayerOptions.All" allow add_ace builtin.everyone "vMenu.VehicleOptions.Menu" allow add_ace builtin.everyone "vMenu.VehicleOptions.All" allow #add_ace builtin.everyone "vMenu.VehicleOptions.God" allow +#add_ace builtin.everyone "vMenu.VehicleOptions.SpecialGod" allow #add_ace builtin.everyone "vMenu.VehicleOptions.Repair" allow #add_ace builtin.everyone "vMenu.VehicleOptions.Wash" allow #add_ace builtin.everyone "vMenu.VehicleOptions.Engine" allow