diff --git a/RageCoop.Client/Networking/Receive.cs b/RageCoop.Client/Networking/Receive.cs index b0ac4b1..e8fb84b 100644 --- a/RageCoop.Client/Networking/Receive.cs +++ b/RageCoop.Client/Networking/Receive.cs @@ -322,6 +322,7 @@ namespace RageCoop.Client c.OwnerID=packet.OwnerID; c.Clothes=packet.Clothes; c.WeaponComponents=packet.WeaponComponents; + c.WeaponTint=packet.WeaponTint; c.ModelHash=packet.ModelHash; c.LastStateSynced = Main.Ticked; } diff --git a/RageCoop.Client/Networking/Send.cs b/RageCoop.Client/Networking/Send.cs index ff0d62e..d832352 100644 --- a/RageCoop.Client/Networking/Send.cs +++ b/RageCoop.Client/Networking/Send.cs @@ -65,6 +65,7 @@ namespace RageCoop.Client Clothes=p.GetPedClothes(), ModelHash=p.Model.Hash, WeaponComponents=p.Weapons.Current.GetWeaponComponents(), + WeaponTint=(byte)Function.Call(Hash.GET_PED_WEAPON_TINT_INDEX, p, p.Weapons.Current.Hash) }; Send(packet, ConnectionChannel.PedSync); diff --git a/RageCoop.Client/Sync/Entities/SyncedPed.cs b/RageCoop.Client/Sync/Entities/SyncedPed.cs index a665f47..b672531 100644 --- a/RageCoop.Client/Sync/Entities/SyncedPed.cs +++ b/RageCoop.Client/Sync/Entities/SyncedPed.cs @@ -61,6 +61,7 @@ namespace RageCoop.Client /// public Ped MainPed { get; internal set; } internal int Health { get; set; } + internal byte WeaponTint { get; set; } internal bool _lastEnteringVehicle=false; internal bool _lastSittingInVehicle=false; private bool _lastRagdoll=false; @@ -600,6 +601,10 @@ namespace RageCoop.Client _lastWeaponComponents = WeaponComponents; } + if (Function.Call(Hash.GET_PED_WEAPON_TINT_INDEX,MainPed,CurrentWeaponHash)!=WeaponTint) + { + Function.Call(Hash.SET_PED_WEAPON_TINT_INDEX, MainPed, CurrentWeaponHash, WeaponTint); + } } private void DisplayAiming() diff --git a/RageCoop.Core/Packets/PedPackets.cs b/RageCoop.Core/Packets/PedPackets.cs index d41d64d..d7a551f 100644 --- a/RageCoop.Core/Packets/PedPackets.cs +++ b/RageCoop.Core/Packets/PedPackets.cs @@ -24,7 +24,7 @@ namespace RageCoop.Core public Dictionary WeaponComponents { get; set; } - + public byte WeaponTint { get;set; } public override void Pack(NetOutgoingMessage message) @@ -62,6 +62,7 @@ namespace RageCoop.Core byteArray.Add(0x00); } + byteArray.Add(WeaponTint); byte[] result = byteArray.ToArray(); message.Write(result.Length); @@ -96,7 +97,7 @@ namespace RageCoop.Core WeaponComponents.Add(reader.ReadUInt(), reader.ReadBool()); } } - + WeaponTint=reader.ReadByte(); #endregion } }