Skip to content

Commit

Permalink
Noclip no longer bug invisibility; Created config for the invisibilit…
Browse files Browse the repository at this point in the history
…y tick
  • Loading branch information
Dreaming-Codes committed Mar 12, 2021
1 parent a058870 commit ec40118
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions SharedClasses/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum Setting
vmenu_noclip_toggle_key,
vmenu_keep_spawned_vehicles_persistent,
vmenu_use_els_compatibility_mode,
vmenu_should_invisibility_tick,
vmenu_quit_session_in_rockstar_editor,
vmenu_server_info_message,
vmenu_server_info_website_url,
Expand Down
3 changes: 2 additions & 1 deletion vMenu/FunctionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Newtonsoft.Json;
using CitizenFX.Core;
using CitizenFX.Core.UI;
using vMenuShared;
using static CitizenFX.Core.UI.Screen;
using static CitizenFX.Core.Native.API;
using static vMenuClient.CommonFunctions;
Expand Down Expand Up @@ -184,7 +185,7 @@ bool IsMpPedCreatorOpen()
}

// Manage PlayerInvisible
if (MainMenu.PlayerOptionsMenu.PlayerInvisible && IsAllowed(Permission.POInvisible))
if (GetSettingsBool(Setting.vmenu_should_invisibility_tick) && MainMenu.PlayerOptionsMenu.PlayerInvisible && IsAllowed(Permission.POInvisible))
{
SetEntityVisible(Game.PlayerPed.Handle, false, false);
}
Expand Down
11 changes: 8 additions & 3 deletions vMenu/Noclip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,14 @@ private async Task NoClipHandler()
SetEntityInvincible(noclipEntity, false);
SetEntityCollision(noclipEntity, true, true);

SetEntityVisible(noclipEntity, true, false);
SetLocalPlayerVisibleLocally(true);
ResetEntityAlpha(noclipEntity);
// If the player is set as invisible by PlayerOptions do not remove the invisibility
if (!MainMenu.PlayerOptionsMenu.PlayerInvisible) {
SetEntityVisible(noclipEntity, true, false);
SetLocalPlayerVisibleLocally(true);
ResetEntityAlpha(noclipEntity);
}



SetEveryoneIgnorePlayer(Game.PlayerPed.Handle, false);
SetPoliceIgnorePlayer(Game.PlayerPed.Handle, false);
Expand Down
4 changes: 4 additions & 0 deletions vMenuServer/config/permissions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ setr vmenu_log_kick_actions true
# disabling vMenu's control over vehicle sirens completely.
setr vmenu_use_els_compatibility_mode false

# This option will make the player invisible on tick if the option in player options is active making
#impossible for other scripts to alter invisible state
setr vmenu_should_invisibility_tick true

# When you set this to true, it will leave the current game session if a player uses the
# rockstar editor button in the recording options menu. (false by default).
setr vmenu_quit_session_in_rockstar_editor false
Expand Down

0 comments on commit ec40118

Please sign in to comment.