Add weapon tint sync
This commit is contained in:
parent
2a093d1da0
commit
9a9fb2870c
@ -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;
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ namespace RageCoop.Client
|
||||
Clothes=p.GetPedClothes(),
|
||||
ModelHash=p.Model.Hash,
|
||||
WeaponComponents=p.Weapons.Current.GetWeaponComponents(),
|
||||
WeaponTint=(byte)Function.Call<int>(Hash.GET_PED_WEAPON_TINT_INDEX, p, p.Weapons.Current.Hash)
|
||||
};
|
||||
|
||||
Send(packet, ConnectionChannel.PedSync);
|
||||
|
@ -61,6 +61,7 @@ namespace RageCoop.Client
|
||||
/// </summary>
|
||||
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<int>(Hash.GET_PED_WEAPON_TINT_INDEX,MainPed,CurrentWeaponHash)!=WeaponTint)
|
||||
{
|
||||
Function.Call<int>(Hash.SET_PED_WEAPON_TINT_INDEX, MainPed, CurrentWeaponHash, WeaponTint);
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayAiming()
|
||||
|
@ -24,7 +24,7 @@ namespace RageCoop.Core
|
||||
|
||||
public Dictionary<uint, bool> 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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user