Compare commits
3 Commits
build-353
...
bc3d569a9c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc3d569a9c | ||
|
|
9d96b75ca4 | ||
|
|
3621c1d3ad |
@@ -20,10 +20,8 @@ namespace WeaponPaints
|
||||
|
||||
bool isKnife = weapon.DesignerName.Contains("knife") || weapon.DesignerName.Contains("bayonet");
|
||||
|
||||
if (isKnife && (!GPlayersKnife.ContainsKey(player.Slot) ||
|
||||
!GPlayersKnife[player.Slot].ContainsKey(player.Team) ||
|
||||
GPlayersKnife[player.Slot][player.Team] == "weapon_knife"))
|
||||
return;
|
||||
if (isKnife && !GPlayersKnife.ContainsKey(player.Slot) ||
|
||||
isKnife && GPlayersKnife[player.Slot][player.Team] == "weapon_knife") return;
|
||||
|
||||
if (isKnife)
|
||||
{
|
||||
@@ -54,9 +52,7 @@ namespace WeaponPaints
|
||||
bool isLegacyModel;
|
||||
|
||||
if (_config.Additional.GiveRandomSkin &&
|
||||
GPlayerWeaponsInfo.ContainsKey(player.Slot) &&
|
||||
(!GPlayerWeaponsInfo[player.Slot].ContainsKey(player.Team) ||
|
||||
!GPlayerWeaponsInfo[player.Slot][player.Team].ContainsKey(weaponDefIndex)))
|
||||
!GPlayerWeaponsInfo[player.Slot][player.Team].ContainsKey(weaponDefIndex))
|
||||
{
|
||||
// Random skins
|
||||
weapon.FallbackPaintKit = GetRandomPaint(weaponDefIndex);
|
||||
@@ -107,7 +103,14 @@ namespace WeaponPaints
|
||||
weapon.AttributeManager.Item.CustomName = weaponInfo.Nametag;
|
||||
weapon.FallbackPaintKit = weaponInfo.Paint;
|
||||
|
||||
weapon.FallbackSeed = weaponInfo is { Paint: 38, Seed: 0 } ? _fadeSeed++ : weaponInfo.Seed;
|
||||
if (weaponInfo is { Paint: 38, Seed: 0 })
|
||||
{
|
||||
weapon.FallbackSeed = _fadeSeed++;
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon.FallbackSeed = weaponInfo.Seed;
|
||||
}
|
||||
|
||||
weapon.FallbackWear = weaponInfo.Wear;
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", weapon.FallbackPaintKit);
|
||||
@@ -183,13 +186,15 @@ namespace WeaponPaints
|
||||
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} id", ViewAsFloat(sticker.Id));
|
||||
if (sticker.OffsetX != 0 || sticker.OffsetY != 0)
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} schema", 0);
|
||||
// CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
// $"sticker slot {stickerSlot} schema", stickerSlot);
|
||||
// if (stickerSlot == 5)
|
||||
// {
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} offset x", sticker.OffsetX);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} offset y", sticker.OffsetY);
|
||||
// }
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} wear", sticker.Wear);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
@@ -212,11 +217,8 @@ namespace WeaponPaints
|
||||
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
|
||||
|
||||
if (!GPlayerWeaponsInfo.TryGetValue(player.Slot, out var playerWeaponsInfo) ||
|
||||
!playerWeaponsInfo.TryGetValue(player.Team, out var teamWeaponsInfo) ||
|
||||
!teamWeaponsInfo.TryGetValue(weaponDefIndex, out var value) ||
|
||||
value.KeyChain == null)
|
||||
return;
|
||||
|
||||
!playerWeaponsInfo[player.Team].TryGetValue(weaponDefIndex, out var value) ||
|
||||
value.KeyChain == null) return;
|
||||
var keyChain = value.KeyChain;
|
||||
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
@@ -404,12 +406,9 @@ namespace WeaponPaints
|
||||
return;
|
||||
|
||||
if (!GPlayersGlove.TryGetValue(player.Slot, out var gloveInfo) ||
|
||||
!gloveInfo.TryGetValue(player.Team, out var gloveId) ||
|
||||
gloveId == 0 ||
|
||||
!GPlayerWeaponsInfo.TryGetValue(player.Slot, out var playerWeaponsInfo) ||
|
||||
!playerWeaponsInfo.TryGetValue(player.Team, out var teamWeaponsInfo) ||
|
||||
!teamWeaponsInfo.TryGetValue(gloveId, out var weaponInfo))
|
||||
return;
|
||||
!gloveInfo.TryGetValue(player.Team, out var gloveId) || gloveId == 0) return;
|
||||
|
||||
WeaponInfo weaponInfo = GPlayerWeaponsInfo[player.Slot][player.Team][gloveId];
|
||||
|
||||
item.ItemDefinitionIndex = gloveId;
|
||||
item.ItemIDLow = 16384 & 0xFFFFFFFF;
|
||||
|
||||
@@ -17,7 +17,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
||||
public override string ModuleAuthor => "Nereziel & daffyy";
|
||||
public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based";
|
||||
public override string ModuleName => "WeaponPaints";
|
||||
public override string ModuleVersion => "3.1b";
|
||||
public override string ModuleVersion => "3.1a";
|
||||
|
||||
public override void Load(bool hotReload)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ internal class WeaponSynchronization
|
||||
if (!_config.Additional.KnifeEnabled || string.IsNullOrEmpty(player?.SteamId))
|
||||
return;
|
||||
|
||||
const string query = "SELECT `knife`, `weapon_team` FROM `wp_player_knife` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
|
||||
const string query = "SELECT `knife`, `weapon_team` FROM `wp_player_knife` WHERE `steamid` = @steamid";
|
||||
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
|
||||
|
||||
foreach (var row in rows)
|
||||
@@ -60,9 +60,9 @@ internal class WeaponSynchronization
|
||||
// Determine the weapon team based on the query result
|
||||
CsTeam weaponTeam = (int)row.weapon_team switch
|
||||
{
|
||||
0 => CsTeam.None,
|
||||
2 => CsTeam.Terrorist,
|
||||
3 => CsTeam.CounterTerrorist,
|
||||
_ => CsTeam.None,
|
||||
_ => CsTeam.CounterTerrorist
|
||||
};
|
||||
|
||||
// Get or create entries for the player’s slot
|
||||
@@ -94,7 +94,7 @@ internal class WeaponSynchronization
|
||||
if (!_config.Additional.GloveEnabled || string.IsNullOrEmpty(player?.SteamId))
|
||||
return;
|
||||
|
||||
const string query = "SELECT `weapon_defindex`, `weapon_team` FROM `wp_player_gloves` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
|
||||
const string query = "SELECT `weapon_defindex`, `weapon_team` FROM `wp_player_gloves` WHERE `steamid` = @steamid";
|
||||
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
|
||||
|
||||
foreach (var row in rows)
|
||||
@@ -105,9 +105,9 @@ internal class WeaponSynchronization
|
||||
var playerGloves = WeaponPaints.GPlayersGlove.GetOrAdd(player.Slot, _ => new ConcurrentDictionary<CsTeam, ushort>());
|
||||
CsTeam weaponTeam = (int)row.weapon_team switch
|
||||
{
|
||||
0 => CsTeam.None,
|
||||
2 => CsTeam.Terrorist,
|
||||
3 => CsTeam.CounterTerrorist,
|
||||
_ => CsTeam.None,
|
||||
_ => CsTeam.CounterTerrorist
|
||||
};
|
||||
|
||||
// Get or create entries for the player’s slot
|
||||
@@ -171,27 +171,28 @@ internal class WeaponSynchronization
|
||||
|
||||
// var weaponInfos = new ConcurrentDictionary<int, WeaponInfo>();
|
||||
|
||||
const string query = "SELECT * FROM `wp_player_skins` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
|
||||
const string query = "SELECT * FROM `wp_player_skins` WHERE `steamid` = @steamid";
|
||||
var playerSkins = connection.Query<dynamic>(query, new { steamid = player.SteamId });
|
||||
|
||||
foreach (var row in playerSkins)
|
||||
{
|
||||
int weaponDefIndex = row.weapon_defindex ?? 0;
|
||||
int weaponPaintId = row.weapon_paint_id ?? 0;
|
||||
float weaponWear = row.weapon_wear ?? 0f;
|
||||
int weaponSeed = row.weapon_seed ?? 0;
|
||||
string weaponNameTag = row.weapon_nametag ?? "";
|
||||
bool weaponStatTrak = row.weapon_stattrak ?? false;
|
||||
int weaponStatTrakCount = row.weapon_stattrak_count ?? 0;
|
||||
int weaponDefIndex = row?.weapon_defindex ?? 0;
|
||||
int weaponPaintId = row?.weapon_paint_id ?? 0;
|
||||
float weaponWear = row?.weapon_wear ?? 0f;
|
||||
int weaponSeed = row?.weapon_seed ?? 0;
|
||||
string weaponNameTag = row?.weapon_nametag ?? "";
|
||||
bool weaponStatTrak = row?.weapon_stattrak ?? false;
|
||||
int weaponStatTrakCount = row?.weapon_stattrak_count ?? 0;
|
||||
|
||||
CsTeam weaponTeam = row.weapon_team switch
|
||||
CsTeam weaponTeam = row?.weapon_team switch
|
||||
{
|
||||
null => CsTeam.None,
|
||||
0 => CsTeam.None,
|
||||
2 => CsTeam.Terrorist,
|
||||
3 => CsTeam.CounterTerrorist,
|
||||
_ => CsTeam.None,
|
||||
_ => CsTeam.CounterTerrorist
|
||||
};
|
||||
|
||||
string[]? keyChainParts = row.weapon_keychain?.ToString().Split(';');
|
||||
string[]? keyChainParts = row?.weapon_keychain?.ToString().Split(';');
|
||||
|
||||
KeyChainInfo keyChainInfo = new KeyChainInfo();
|
||||
|
||||
@@ -301,7 +302,7 @@ internal class WeaponSynchronization
|
||||
if (!_config.Additional.MusicEnabled || string.IsNullOrEmpty(player?.SteamId))
|
||||
return;
|
||||
|
||||
const string query = "SELECT `music_id`, `weapon_team` FROM `wp_player_music` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
|
||||
const string query = "SELECT `music_id`, `weapon_team` FROM `wp_player_music` WHERE `steamid` = @steamid";
|
||||
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
|
||||
|
||||
foreach (var row in rows)
|
||||
@@ -312,9 +313,9 @@ internal class WeaponSynchronization
|
||||
// Determine the weapon team based on the query result
|
||||
CsTeam weaponTeam = (int)row.weapon_team switch
|
||||
{
|
||||
0 => CsTeam.None,
|
||||
2 => CsTeam.Terrorist,
|
||||
3 => CsTeam.CounterTerrorist,
|
||||
_ => CsTeam.None,
|
||||
_ => CsTeam.CounterTerrorist
|
||||
};
|
||||
|
||||
// Get or create entries for the player’s slot
|
||||
@@ -346,7 +347,7 @@ internal class WeaponSynchronization
|
||||
if (string.IsNullOrEmpty(player?.SteamId))
|
||||
return;
|
||||
|
||||
const string query = "SELECT `id`, `weapon_team` FROM `wp_player_pins` WHERE `steamid` = @steamid ORDER BY `weapon_team` ASC";
|
||||
const string query = "SELECT `id`, `weapon_team` FROM `wp_player_pins` WHERE `steamid` = @steamid";
|
||||
var rows = connection.Query<dynamic>(query, new { steamid = player.SteamId }); // Retrieve all records for the player
|
||||
|
||||
foreach (var row in rows)
|
||||
@@ -357,9 +358,9 @@ internal class WeaponSynchronization
|
||||
// Determine the weapon team based on the query result
|
||||
CsTeam weaponTeam = (int)row.weapon_team switch
|
||||
{
|
||||
0 => CsTeam.None,
|
||||
2 => CsTeam.Terrorist,
|
||||
3 => CsTeam.CounterTerrorist,
|
||||
_ => CsTeam.None,
|
||||
_ => CsTeam.CounterTerrorist
|
||||
};
|
||||
|
||||
// Get or create entries for the player’s slot
|
||||
|
||||
12539
website/data/skins.json
Normal file
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 119 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 71 KiB |