Skip to content

Commit

Permalink
Merge pull request #244 from Dreaming-Codes/master
Browse files Browse the repository at this point in the history
Fixed invisibility
  • Loading branch information
TomGrobbe authored May 25, 2021
2 parents 4cb7a80 + 0488bb5 commit 923c293
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 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
7 changes: 7 additions & 0 deletions 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 @@ -182,6 +183,12 @@ bool IsMpPedCreatorOpen()
{
SetSuperJumpThisFrame(Game.Player.Handle);
}

// Manage PlayerInvisible
if (GetSettingsBool(Setting.vmenu_should_invisibility_tick) && MainMenu.PlayerOptionsMenu.PlayerInvisible && IsAllowed(Permission.POInvisible))
{
SetEntityVisible(Game.PlayerPed.Handle, false, false);
}

// Manage PlayerNoRagdoll
SetPedCanRagdoll(Game.PlayerPed.Handle, (!MainMenu.PlayerOptionsMenu.PlayerNoRagdoll && noRagdollAllowed) ||
Expand Down
11 changes: 7 additions & 4 deletions vMenu/Noclip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,13 @@ 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
2 changes: 1 addition & 1 deletion vMenu/menus/About.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private void CreateMenu()
{
Label = $"~h~{MainMenu.Version}~h~"
};
MenuItem credits = new MenuItem("About vMenu / Credits", "vMenu is made by ~b~Vespura~s~. For more info, checkout ~b~www.vespura.com/vmenu~s~. Thank you to: Deltanic, Brigliar, IllusiveTea, Shayan Doust and zr0iq for your contributions.");
MenuItem credits = new MenuItem("About vMenu / Credits", "vMenu is made by ~b~Vespura~s~. For more info, checkout ~b~www.vespura.com/vmenu~s~. Thank you to: Deltanic, Brigliar, IllusiveTea, Shayan Doust, zr0iq and DreamingCodes for your contributions.");

string serverInfoMessage = vMenuShared.ConfigManager.GetSettingsString(vMenuShared.ConfigManager.Setting.vmenu_server_info_message);
if (!string.IsNullOrEmpty(serverInfoMessage))
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 923c293

Please sign in to comment.