- Probably not needed `SkinsVisibilityFix` anymore
This commit is contained in:
Dawid Bepierszcz
2024-01-20 18:04:50 +01:00
parent d04bc0879a
commit 620b067991
5 changed files with 24 additions and 7 deletions

View File

@@ -95,8 +95,10 @@ namespace WeaponPaints
if (player == null || !player.IsValid) return HookResult.Continue;
/*
if (Config.Additional.SkinVisibilityFix)
AddTimer(0.2f, () => RefreshSkins(player));
*/
return HookResult.Continue;
}
@@ -243,13 +245,16 @@ namespace WeaponPaints
if (Config.Additional.KnifeEnabled && !PlayerHasKnife(player))
{
g_knifePickupCount[(int)player.Index] = 0;
AddTimer(0.1f, () => GiveKnifeToPlayer(player));
GiveKnifeToPlayer(player);
//AddTimer(0.1f, () => GiveKnifeToPlayer(player));
}
/*
if (Config.Additional.SkinVisibilityFix)
{
AddTimer(0.3f, () => RefreshSkins(player));
}
*/
return HookResult.Continue;
}

View File

@@ -1 +1 @@
1.3i
1.4a

View File

@@ -23,6 +23,11 @@ namespace WeaponPaints
if (isKnife)
{
weapon.AttributeManager.Item.EntityQuality = 3;
if (weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
skeleton.ForceParentToBeNetworked = true;
}
}
if (_config.Additional.GiveRandomSkin &&
@@ -38,7 +43,8 @@ namespace WeaponPaints
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
skeleton.ModelState.MeshGroupMask = 2;
//skeleton.ModelState.MeshGroupMask = 2;
skeleton.ForceParentToBeNetworked = true;
}
return;
}
@@ -52,10 +58,12 @@ namespace WeaponPaints
weapon.FallbackPaintKit = weaponInfo.Paint;
weapon.FallbackSeed = weaponInfo.Seed;
weapon.FallbackWear = weaponInfo.Wear;
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
skeleton.ModelState.MeshGroupMask = 2;
skeleton.ForceParentToBeNetworked = true;
//skeleton.ModelState.MeshGroupMask = 2;
}
}
@@ -171,6 +179,7 @@ namespace WeaponPaints
internal void RefreshSkins(CCSPlayerController? player)
{
return;
if (!Utility.IsPlayerValid(player) || !player!.PawnIsAlive) return;
AddTimer(0.18f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3"));
@@ -234,8 +243,11 @@ namespace WeaponPaints
}
}
}
/*
if (Config.Additional.SkinVisibilityFix)
RefreshSkins(player);
*/
}
}

View File

@@ -9,7 +9,7 @@ using System.Collections.Concurrent;
namespace WeaponPaints;
[MinimumApiVersion(142)]
[MinimumApiVersion(144)]
public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
{
internal static readonly Dictionary<string, string> weaponList = new()
@@ -145,7 +145,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
public override string ModuleAuthor => "Nereziel & daffyy";
public override string ModuleDescription => "Skin and knife selector, standalone and web-based";
public override string ModuleName => "WeaponPaints";
public override string ModuleVersion => "1.3i";
public override string ModuleVersion => "1.4a";
public static WeaponPaintsConfig GetWeaponPaintsConfig()
{

View File

@@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.147" />
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.148" />
<PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="MySqlConnector" Version="2.3.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />