Skip to content

Commit b3f4259

Browse files
authored
Merge pull request #455 from daffyyyy/main
17.09.2025 - Update
2 parents a633873 + 2079ef5 commit b3f4259

File tree

96 files changed

+5419
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+5419
-207
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
bin/
33
obj/
44
website/getskins.php
5-
.idea/
5+
.idea/
6+
WeaponPaints.sln.DotSettings.user

Events.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using CounterStrikeSharp.API.Modules.Entities;
55
using CounterStrikeSharp.API.Modules.Memory;
66
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
7+
using Microsoft.Extensions.Logging;
78

89
namespace WeaponPaints
910
{
@@ -222,7 +223,7 @@ private void OnEntityCreated(CEntityInstance entity)
222223

223224
if (designerName.Contains("weapon"))
224225
{
225-
Server.NextFrame(() =>
226+
Server.NextWorldUpdate(() =>
226227
{
227228
var weapon = new CBasePlayerWeapon(entity.Handle);
228229
if (!weapon.IsValid) return;
@@ -251,7 +252,7 @@ private void OnEntityCreated(CEntityInstance entity)
251252

252253
if (string.IsNullOrEmpty(player?.PlayerName)) return;
253254
if (!Utility.IsPlayerValid(player)) return;
254-
255+
255256
GivePlayerWeaponSkin(player, weapon);
256257
}
257258
catch (Exception)
@@ -285,7 +286,7 @@ public HookResult OnItemPickup(EventItemPickup @event, GameEventInfo _)
285286
var player = @event.Userid;
286287
if (player == null || !player.IsValid || player.IsBot) return HookResult.Continue;
287288
if (!@event.Item.Contains("knife")) return HookResult.Continue;
288-
289+
289290
var weaponDefIndex = (int)@event.Defindex;
290291

291292
if (!HasChangedKnife(player, out var _) || !HasChangedPaint(player, weaponDefIndex, out var _))
@@ -295,7 +296,7 @@ public HookResult OnItemPickup(EventItemPickup @event, GameEventInfo _)
295296
{
296297
GiveOnItemPickup(player);
297298
}
298-
299+
299300
return HookResult.Continue;
300301
}
301302

@@ -340,7 +341,7 @@ private void RegisterListeners()
340341
RegisterEventHandler<EventRoundStart>(OnRoundStart);
341342
RegisterEventHandler<EventRoundEnd>(OnRoundEnd);
342343
RegisterEventHandler<EventRoundMvp>(OnRoundMvp);
343-
RegisterListener<Listeners.OnEntityCreated>(OnEntityCreated);
344+
RegisterListener<Listeners.OnEntitySpawned>(OnEntityCreated);
344345
RegisterEventHandler<EventPlayerDeath>(OnPlayerDeath);
345346

346347
if (Config.Additional.ShowSkinImage)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1d
1+
3.2a

WeaponAction.cs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using CounterStrikeSharp.API.Modules.Utils;
77
using Microsoft.Extensions.Logging;
88
using System.Collections.Concurrent;
9-
using System.Runtime.InteropServices;
109
using Newtonsoft.Json.Linq;
1110

1211
namespace WeaponPaints
@@ -17,9 +16,9 @@ private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon
1716
{
1817
if (!Config.Additional.SkinEnabled) return;
1918
if (!GPlayerWeaponsInfo.TryGetValue(player.Slot, out _)) return;
20-
19+
2120
bool isKnife = weapon.DesignerName.Contains("knife") || weapon.DesignerName.Contains("bayonet");
22-
21+
2322
switch (isKnife)
2423
{
2524
case true when !HasChangedKnife(player, out var _):
@@ -64,22 +63,22 @@ private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon
6463
weapon.FallbackPaintKit = GetRandomPaint(weaponDefIndex);
6564
weapon.FallbackSeed = 0;
6665
weapon.FallbackWear = 0.01f;
67-
66+
6867
weapon.AttributeManager.Item.NetworkedDynamicAttributes.Attributes.RemoveAll();
6968
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", GetRandomPaint(weaponDefIndex));
7069
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture seed", 0);
7170
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture wear", 0.01f);
72-
71+
7372
weapon.AttributeManager.Item.AttributeList.Attributes.RemoveAll();
7473
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.AttributeList.Handle, "set item texture prefab", GetRandomPaint(weaponDefIndex));
7574
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.AttributeList.Handle, "set item texture seed", 0);
7675
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.AttributeList.Handle, "set item texture wear", 0.01f);
77-
76+
7877
fallbackPaintKit = weapon.FallbackPaintKit;
79-
78+
8079
if (fallbackPaintKit == 0)
8180
return;
82-
81+
8382
skinInfo = SkinsList
8483
.Where(w =>
8584
w["weapon_defindex"]?.ToObject<int>() == weaponDefIndex &&
@@ -135,7 +134,6 @@ private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon
135134
.ToList();
136135

137136
isLegacyModel = skinInfo.Count <= 0 || skinInfo[0].Value<bool>("legacy_model");
138-
139137
UpdatePlayerWeaponMeshGroupMask(player, weapon, isLegacyModel);
140138
}
141139

@@ -385,7 +383,6 @@ private void GivePlayerGloves(CCSPlayerController player)
385383
item.NetworkedDynamicAttributes.Attributes.RemoveAll();
386384
item.AttributeList.Attributes.RemoveAll();
387385

388-
389386
Instance.AddTimer(0.08f, () =>
390387
{
391388
try
@@ -453,19 +450,17 @@ public static void SetBodygroup(CCSPlayerPawn pawn, string group, int value)
453450
pawn.AcceptInput("SetBodygroup", value:$"{group},{value}");
454451
}
455452

456-
private static void UpdateWeaponMeshGroupMask(CBaseEntity weapon, bool isLegacy = false)
453+
private void UpdateWeaponMeshGroupMask(CBaseEntity weapon, bool isLegacy = false)
457454
{
458-
if (weapon.CBodyComponent?.SceneNode == null) return;
459-
var skeleton = weapon.CBodyComponent.SceneNode.GetSkeletonInstance();
460-
var value = (ulong)(isLegacy ? 2 : 1);
455+
if (!weapon.DesignerName.Contains("ak47")) return;
456+
if (weapon.CBodyComponent?.SceneNode == null) return;
457+
var skeleton = weapon.CBodyComponent.SceneNode.GetSkeletonInstance();
461458

462-
if (skeleton.ModelState.MeshGroupMask != value)
463-
{
464-
skeleton.ModelState.MeshGroupMask = value;
465-
}
459+
weapon.AcceptInput("SetBodygroup", value: $"body,{(isLegacy ? 1 : 0)}");
460+
// skeleton.ModelState.MeshGroupMask = isLegacy ? 2UL : 1UL;
466461
}
467462

468-
private static void UpdatePlayerWeaponMeshGroupMask(CCSPlayerController player, CBasePlayerWeapon weapon, bool isLegacy)
463+
private void UpdatePlayerWeaponMeshGroupMask(CCSPlayerController player, CBasePlayerWeapon weapon, bool isLegacy)
469464
{
470465
UpdateWeaponMeshGroupMask(weapon, isLegacy);
471466
}

WeaponPaints.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
using CounterStrikeSharp.API;
33
using CounterStrikeSharp.API.Core;
44
using CounterStrikeSharp.API.Core.Attributes;
5+
using CounterStrikeSharp.API.Core.Attributes.Registration;
6+
using CounterStrikeSharp.API.Modules.Commands;
7+
using CounterStrikeSharp.API.Modules.Entities.Constants;
58
using Microsoft.Extensions.Logging;
69
using MySqlConnector;
710

811
namespace WeaponPaints;
912

10-
[MinimumApiVersion(276)]
13+
[MinimumApiVersion(380)]
1114
public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
1215
{
1316
internal static WeaponPaints Instance { get; private set; } = new();
@@ -17,7 +20,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
1720
public override string ModuleAuthor => "Nereziel & daffyy";
1821
public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based";
1922
public override string ModuleName => "WeaponPaints";
20-
public override string ModuleVersion => "3.1d";
23+
public override string ModuleVersion => "3.2a";
2124

2225
public override void Load(bool hotReload)
2326
{

WeaponPaints.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.331" />
12+
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.339" />
1313
<PackageReference Include="Dapper" Version="2.1.35" />
1414
<PackageReference Include="MySqlConnector" Version="2.4.0-beta.1" />
1515
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

WeaponPaints.sln.DotSettings.user

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005Cxdaff_005CDocuments_005CGitHub_005Ccs2_002DWeaponPaints_005C3rd_005Fparty_005CMenuManagerApi_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2+
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005Cxdaff_005CDocuments_005CGitHub_005Ccs2_002DWeaponPaints_005C3rd_005Fparty_005CMenuManagerApi_002Edll/@EntryIndexedValue">True</s:Boolean>
3+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACBaseAnimGraph_002Eg_002Ecs_002Fl_003AC_0021_003FUsers_003Fxdaff_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fedce4cda20b83aa28fbed15b81eb0eda1753e497144879a4bd754947d37639_003FCBaseAnimGraph_002Eg_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
4+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACBodyComponent_002Eg_002Ecs_002Fl_003AC_0021_003FUsers_003Fxdaff_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fdb7e149cad83cf211ee55349a3442256ec62acce5ba41474ad124572f767e271_003FCBodyComponent_002Eg_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
5+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACModelState_002Eg_002Ecs_002Fl_003AC_0021_003FUsers_003Fxdaff_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fb03ffa24c03867c84b5d095397bd1578b8ea563ab2c72b30242ffad815d49e_003FCModelState_002Eg_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
6+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANetworkedVector_002Ecs_002Fl_003AC_0021_003FUsers_003Fxdaff_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fd68dbf9c04bc6046e155f1866c3615a47e34017f330c9e351d68979b9281c_003FNetworkedVector_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>

website/data/collectibles_sv.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,12 @@
551551
},
552552
{
553553
"id": "988",
554-
"name": "Champion at IEM Rio 2022",
554+
"name": "Mästare i IEM Rio 2022",
555555
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-988.png"
556556
},
557557
{
558558
"id": "989",
559-
"name": "Finalist at IEM Rio 2022",
559+
"name": "Finalist i IEM Rio 2022",
560560
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-989.png"
561561
},
562562
{
@@ -566,27 +566,27 @@
566566
},
567567
{
568568
"id": "991",
569-
"name": "Quarterfinalist at IEM Rio 2022",
569+
"name": "Kvartsfinalist i IEM Rio 2022",
570570
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-991.png"
571571
},
572572
{
573573
"id": "992",
574-
"name": "Champion at BLAST.tv Paris 2023",
574+
"name": "Mästare vid BLAST.tv Paris 2023",
575575
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-992.png"
576576
},
577577
{
578578
"id": "993",
579-
"name": "Finalist at BLAST.tv Paris 2023",
579+
"name": "Finalist vid BLAST.tv Paris 2023",
580580
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-993.png"
581581
},
582582
{
583583
"id": "994",
584-
"name": "Semifinalist at BLAST.tv Paris 2023",
584+
"name": "Semifinalist vid BLAST.tv Paris 2023",
585585
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-994.png"
586586
},
587587
{
588588
"id": "995",
589-
"name": "Quarterfinalist at BLAST.tv Paris 2023",
589+
"name": "Kvartsfinalist vid BLAST.tv Paris 2023",
590590
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-995.png"
591591
},
592592
{
@@ -1551,7 +1551,7 @@
15511551
},
15521552
{
15531553
"id": "4884",
1554-
"name": "Paris 2023 Coin",
1554+
"name": "Paris 2023-mynt",
15551555
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-4884.png"
15561556
},
15571557
{
@@ -1561,12 +1561,12 @@
15611561
},
15621562
{
15631563
"id": "4886",
1564-
"name": "Paris 2023 Gold Coin",
1564+
"name": "Paris 2023 – guldmynt",
15651565
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-4886.png"
15661566
},
15671567
{
15681568
"id": "4887",
1569-
"name": "Paris 2023 Diamond Coin",
1569+
"name": "Paris 2023 – diamantmynt",
15701570
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/collectible-4887.png"
15711571
},
15721572
{

website/data/keychains_bg.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,12 @@
291291
},
292292
{
293293
"id": "2025910",
294-
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | Deagle Supremacy",
294+
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | Превъзходство с Deagle",
295295
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/highlight-aus2025_910doubledeaglevsfazeonmirage.png"
296296
},
297297
{
298298
"id": "20259102",
299-
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | 2 Pistol Headshots",
299+
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | 2 изстрела в главата с пистолет",
300300
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/highlight-aus2025_9102kpistolvsfazeonmirage.png"
301301
},
302302
{
@@ -306,17 +306,17 @@
306306
},
307307
{
308308
"id": "2025210",
309-
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | The Running MAC-10",
309+
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | Бягащият MAC-10",
310310
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/highlight-aus2025_karrigan2kmac10vsmongolzonanubis.png"
311311
},
312312
{
313313
"id": "20259101",
314-
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | One Kill Is Enough",
314+
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | Едно убийство е достатъчно",
315315
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/highlight-aus2025_9101kvspainonmirage.png"
316316
},
317317
{
318318
"id": "2025132",
319-
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | Fear Him",
319+
"name": "Souvenir Charm | Отличен най-добър момент BLAST.tv Austin 2025 | Страхувайте се от него",
320320
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/highlight-aus2025_mzinhoclose1v3vsvitalityondust2.png"
321321
},
322322
{

0 commit comments

Comments
 (0)