Skip to content

Commit

Permalink
Added a ClearArea option in Misc Menu
Browse files Browse the repository at this point in the history
This clears the area around you of all visual world damage, props, vehicles, peds, etc. and resets everything. Required permission: `vMenu.MiscSettings.ClearArea`
  • Loading branch information
TomGrobbe committed Apr 6, 2018
1 parent 454703a commit 2a1fdde
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions PERMISSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
|:-|:-|:-|
|`vMenu.MiscSettings.Menu`|Grants access to the Misc Settings Menu.|Allowed|
|`vMenu.MiscSettings.All`|Grants access to **ALL** `Misc Settings Menu` options.|Denied|
|`vMenu.MiscSettings.ClearArea`|Allows you to reset/clear everything 100m around you in the world.|Allowed|
|`vMenu.MiscSettings.TeleportToWp`|Allows you to teleport to the waypoint on your map.|Allowed|
|`vMenu.MiscSettings.ShowCoordinates`|Allows you to show your current coordinates on screen.|Allowed|
|`vMenu.MiscSettings.ShowLocation`|Allows you to show your current location on screen (pretty much just like PLD).|Allowed|
Expand Down
3 changes: 3 additions & 0 deletions vMenu/PermissionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,16 @@ public enum Permission
// Misc Settings
MSMenu,
MSAll,
MSClearArea,
MSTeleportToWp,
MSShowCoordinates,
MSShowLocation,
MSJoinQuitNotifs,
MSDeathNotifs,
MSNightVision,
MSThermalVision,



// Voice Chat
VCMenu,
Expand Down
12 changes: 12 additions & 0 deletions vMenu/menus/MiscSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ private void CreateMenu()
UIMenuCheckboxItem deathNotifs = new UIMenuCheckboxItem("Death Notifications", DeathNotifications, "Receive notifications when someone dies or gets killed.");
UIMenuCheckboxItem nightVision = new UIMenuCheckboxItem("Toggle Night Vision", NightVision, "Enable or disable night vision.");
UIMenuCheckboxItem thermalVision = new UIMenuCheckboxItem("Toggle Thermal Vision", ThermalVision, "Enable or disable thermal vision.");

UIMenuItem clearArea = new UIMenuItem("Clear Area", "Clears the area around your player (100 meters) of everything! Damage, dirt, peds, props, vehicles, etc. Everything gets cleaned up and reset.");

// Add menu items to the menu.
if (cf.IsAllowed(Permission.MSTeleportToWp))
{
Expand Down Expand Up @@ -91,6 +94,10 @@ private void CreateMenu()
{
menu.AddItem(thermalVision);
}
if (cf.IsAllowed(Permission.MSClearArea))
{
menu.AddItem(clearArea);
}

// Always allowed
menu.AddItem(hideRadar);
Expand Down Expand Up @@ -154,6 +161,11 @@ private void CreateMenu()
{
UserDefaults.SaveSettingsAsync();
}
else if (item == clearArea)
{
var pos = Game.PlayerPed.Position;
ClearAreaOfEverything(pos.X, pos.Y, pos.Z, 100f, false, false, false, false);
}
};
}

Expand Down
3 changes: 1 addition & 2 deletions vMenuServer/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public class EventManager : BaseScript
// Misc Settings
"MSMenu",
"MSAll",
"MSClearArea",
"MSTeleportToWp",
"MSShowCoordinates",
"MSShowLocation",
Expand All @@ -201,8 +202,6 @@ public class EventManager : BaseScript
/// </summary>
public EventManager()
{


if (GetCurrentResourceName() != "vMenu")
{
Exception InvalidNameException = new Exception("\r\n\r\n[vMenu] INSTALLATION ERROR!\r\nThe name of the resource is not valid. Please change the folder name from '" + GetCurrentResourceName() + "' to 'vMenu' (case sensitive) instead!\r\n\r\n\r\n");
Expand Down
1 change: 1 addition & 0 deletions vMenuServer/config/permissions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ add_ace builtin.everyone "vMenu.WeaponOptions.All" allow
# Misc Settings
add_ace builtin.everyone "vMenu.MiscSettings.Menu" allow
add_ace builtin.everyone "vMenu.MiscSettings.All" allow
#add_ace builtin.everyone "vMenu.MiscSettings.ClearArea" allow
#add_ace builtin.everyone "vMenu.MiscSettings.TeleportToWp" allow
#add_ace builtin.everyone "vMenu.MiscSettings.ShowCoordinates" allow
#add_ace builtin.everyone "vMenu.MiscSettings.ShowLocation" allow
Expand Down

0 comments on commit 2a1fdde

Please sign in to comment.