Add stealth mode sync

This commit is contained in:
Sardelka 2022-06-20 11:08:46 +08:00
parent 33244b930f
commit e1606889f7
4 changed files with 11 additions and 1 deletions

View File

@ -303,6 +303,7 @@ namespace RageCoop.Client
c.IsOnLadder = flags.HasFlag(PedDataFlags.IsOnLadder);
c.IsVaulting = flags.HasFlag(PedDataFlags.IsVaulting);
c.IsInCover = flags.HasFlag(PedDataFlags.IsInCover);
c.IsInStealthMode = flags.HasFlag(PedDataFlags.IsInStealthMode);
c.Heading=packet.Heading;
c.LastSynced = Main.Ticked;
if (c.IsAiming)

View File

@ -61,6 +61,7 @@ namespace RageCoop.Client
/// </summary>
public Ped MainPed { get; internal set; }
internal int Health { get; set; }
internal bool IsInStealthMode { get; set; }
internal byte WeaponTint { get; set; }
internal bool _lastEnteringVehicle=false;
internal bool _lastSittingInVehicle=false;
@ -467,6 +468,8 @@ namespace RageCoop.Client
}
_lastIsJumping = false;
Function.Call(Hash.SET_PED_STEALTH_MOVEMENT, MainPed, IsInStealthMode, 0);
if (IsRagdoll || Health==0)
{
if (!MainPed.IsRagdoll)

View File

@ -134,6 +134,11 @@ namespace RageCoop.Client
{
flags |=PedDataFlags.IsInCover;
}
if(Function.Call<bool>(Hash.GET_PED_STEALTH_MOVEMENT, ped))
{
flags |= PedDataFlags.IsInStealthMode;
}
return flags;
}

View File

@ -85,7 +85,8 @@ namespace RageCoop.Core
IsParachuteOpen = 1 << 7,
IsOnLadder = 1 << 8,
IsVaulting = 1 << 9,
IsInCover=1<< 10,
IsInCover = 1<< 10,
IsInStealthMode = 1 << 11,
}
#region ===== VEHICLE DATA =====