From 19ff46ed06042584aa18b0682de8dd182e22ca98 Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Sun, 11 Oct 2026 16:53:07 +0200 Subject: [PATCH] Adde test of second weapon skin which is legacy --- skins/skins.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/skins/skins.cs b/skins/skins.cs index dfd3a37..4cf2b7f 100644 --- a/skins/skins.cs +++ b/skins/skins.cs @@ -75,6 +75,10 @@ class SkinsManager { ApplyAK47Skin1171(weapon, player); } + else if (weapon.DesignerName == "weapon_deagle") + { + ApplyDeagleSkin(weapon, player); + } else if (weapon.DesignerName.Contains("knife") || weapon.DesignerName.Contains("bayonet")) { ApplyButterflyKnifeFade(weapon, player); @@ -114,6 +118,35 @@ class SkinsManager Utilities.SetStateChanged(weapon, "CEconEntity", "m_flFallbackWear"); } + public void ApplyDeagleSkin(CBasePlayerWeapon weapon, CCSPlayerController player) + { + if (weapon.AttributeManager.Item.ItemDefinitionIndex != 1) return; + + weapon.AttributeManager.Item.AttributeList.Attributes.RemoveAll(); + weapon.AttributeManager.Item.NetworkedDynamicAttributes.Attributes.RemoveAll(); + + weapon.AttributeManager.Item.ItemID = SpawnedWeaponId; + weapon.AttributeManager.Item.ItemIDLow = (uint)(SpawnedWeaponId & 0xFFFFFFFF); + weapon.AttributeManager.Item.ItemIDHigh = (uint)(SpawnedWeaponId >> 32); + + weapon.AttributeManager.Item.AccountID = (uint)player.SteamID; + + weapon.FallbackPaintKit = 962; + weapon.FallbackSeed = 0; + weapon.FallbackWear = 0.01f; + + var handle = weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle; + CAttributeListSetOrAddAttributeValueByName.Invoke(handle, "set item texture prefab", 962); + CAttributeListSetOrAddAttributeValueByName.Invoke(handle, "set item texture seed", 0); + CAttributeListSetOrAddAttributeValueByName.Invoke(handle, "set item texture wear", 0.01f); + + weapon.AcceptInput("SetBodygroup", value: "body,1"); + + Utilities.SetStateChanged(weapon, "CEconEntity", "m_nFallbackPaintKit"); + Utilities.SetStateChanged(weapon, "CEconEntity", "m_nFallbackSeed"); + Utilities.SetStateChanged(weapon, "CEconEntity", "m_flFallbackWear"); + } + public void ApplyButterflyKnifeFade(CBasePlayerWeapon weapon, CCSPlayerController player) { // Vérifier si l'arme est un couteau (pour ne pas transformer un pistolet en couteau)