missing data added

This commit is contained in:
EntenKoeniq
2021-07-08 21:57:21 +02:00
parent 56d3207065
commit 64e6f35363
3 changed files with 23 additions and 4 deletions

View File

@ -234,13 +234,11 @@ namespace CoopClient
if (IsShooting)
{
Function.Call(Hash.SET_PED_INFINITE_AMMO_CLIP, Character, true);
if (!Character.IsInRange(Position, 0.5f))
{
Function.Call(Hash.TASK_GO_TO_COORD_WHILE_AIMING_AT_COORD, Character, Position.X, Position.Y,
Position.Z, AimCoords.X, AimCoords.Y, AimCoords.Z, 3f, true, 2f, 2f, false, 0, false,
unchecked((int)FiringPattern.FullAuto));
(uint)FiringPattern.FullAuto);
}
else
{
@ -253,7 +251,7 @@ namespace CoopClient
{
Function.Call(Hash.TASK_GO_TO_COORD_WHILE_AIMING_AT_COORD, Character, Position.X, Position.Y,
Position.Z, AimCoords.X, AimCoords.Y, AimCoords.Z, 3f, false, 2f, 2f, false, 512, false,
unchecked((int)FiringPattern.FullAuto));
(uint)FiringPattern.FullAuto);
}
else
{
@ -278,6 +276,8 @@ namespace CoopClient
Character.CanRagdoll = false;
Character.IsInvincible = true;
Character.Health = Health;
Character.CanBeTargetted = true;
Character.IsEnemy = false;
if (username != null)
{
@ -292,6 +292,10 @@ namespace CoopClient
{
Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Character.Handle, prop.Key, prop.Value, 0, 0);
}
Function.Call(Hash.SET_PED_CAN_BE_TARGETTED_BY_PLAYER, Character, Game.Player, true);
Function.Call(Hash.SET_PED_GET_OUT_UPSIDE_DOWN_VEHICLE, Character, false);
Function.Call(Hash.SET_CAN_ATTACK_FRIENDLY, Character, true, true);
}
private bool LastMoving;

View File

@ -244,6 +244,13 @@ namespace CoopClient
{
if (Main.Players.ContainsKey(packet.Player))
{
EntitiesPlayer player = Main.Players[packet.Player];
if (player.Character != null && player.Character.Exists())
{
player.Character.Kill();
player.Character.Delete();
}
Main.Players.Remove(packet.Player);
Main.MainPlayerList.Update(Main.Players, Main.MainSettings.Username);
@ -262,6 +269,7 @@ namespace CoopClient
player.Rotation = packet.Rotation.ToVector();
player.Velocity = packet.Velocity.ToVector();
player.Speed = packet.Speed;
player.CurrentWeaponHash = packet.CurrentWeaponHash;
player.AimCoords = packet.AimCoords.ToVector();
player.LastSyncWasFull = (packet.Flag.Value & (byte)PedDataFlags.LastSyncWasFull) > 0;
player.IsAiming = (packet.Flag.Value & (byte)PedDataFlags.IsAiming) > 0;
@ -286,6 +294,7 @@ namespace CoopClient
npc.Rotation = packet.Rotation.ToVector();
npc.Velocity = packet.Velocity.ToVector();
npc.Speed = packet.Speed;
npc.CurrentWeaponHash = packet.CurrentWeaponHash;
npc.AimCoords = packet.AimCoords.ToVector();
npc.LastSyncWasFull = (packet.Flag.Value & (byte)PedDataFlags.LastSyncWasFull) > 0;
npc.IsAiming = (packet.Flag.Value & (byte)PedDataFlags.IsAiming) > 0;
@ -307,6 +316,7 @@ namespace CoopClient
Rotation = packet.Rotation.ToVector(),
Velocity = packet.Velocity.ToVector(),
Speed = packet.Speed,
CurrentWeaponHash = packet.CurrentWeaponHash,
AimCoords = packet.AimCoords.ToVector(),
LastSyncWasFull = (packet.Flag.Value & (byte)PedDataFlags.LastSyncWasFull) > 0,
IsAiming = (packet.Flag.Value & (byte)PedDataFlags.IsAiming) > 0,
@ -329,6 +339,8 @@ namespace CoopClient
player.Rotation = packet.Rotation.ToVector();
player.Velocity = packet.Velocity.ToVector();
player.Speed = packet.Speed;
player.CurrentWeaponHash = packet.CurrentWeaponHash;
player.AimCoords = packet.AimCoords.ToVector();
player.LastSyncWasFull = (packet.Flag.Value & (byte)PedDataFlags.LastSyncWasFull) > 0;
player.IsAiming = (packet.Flag.Value & (byte)PedDataFlags.IsAiming) > 0;
player.IsShooting = (packet.Flag.Value & (byte)PedDataFlags.IsShooting) > 0;

View File

@ -21,6 +21,9 @@ namespace CoopClient
}
Function.Call((Hash)0xB96B00E976BE977F, 0.0f); // _SET_WAVES_INTENSITY
Game.Player.Character.CanBeTargetted = true;
Function.Call(Hash.SET_CAN_ATTACK_FRIENDLY, Game.Player.Character, true, true);
}
}
}