Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9f47e9237 | ||
|
|
e209b12829 | ||
|
|
c55a40ecb1 | ||
|
|
b6cac17197 | ||
|
|
683f9f2a1c | ||
|
|
a70e2f771e | ||
|
|
f4e6a4338d | ||
|
|
edd3733940 | ||
|
|
492b8a7976 | ||
|
|
6db3d00893 | ||
|
|
fc79381e1e | ||
|
|
7b12d29227 | ||
|
|
abff60a1db | ||
|
|
edb848b4f9 | ||
|
|
694cc548c8 | ||
|
|
201f723a3c | ||
|
|
d6384f4ecf | ||
|
|
85fc0bd4bc | ||
|
|
5c7df833cc | ||
|
|
5640919b09 | ||
|
|
0550ef68f4 | ||
|
|
c0d42a3d9c | ||
|
|
5636b401ea | ||
|
|
06cfda21f2 |
@@ -89,6 +89,8 @@ namespace WeaponPaints
|
||||
g_playersMusic.TryRemove(player.Slot, out _);
|
||||
}
|
||||
|
||||
temporaryPlayerWeaponWear.TryRemove(player.Slot, out _);
|
||||
|
||||
commandsCooldown.Remove(player.Slot);
|
||||
|
||||
return HookResult.Continue;
|
||||
|
||||
@@ -25,6 +25,7 @@ Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin
|
||||
- Run server with plugin, **it will generate config if installed correctly!**
|
||||
- Edit `addons/counterstrikesharp/configs/`**`plugins/WeaponPaints/WeaponPaints.json`** include database credentials
|
||||
- In `addons/counterstrikesharp/configs/`**`core.json`** set **FollowCS2ServerGuidelines** to **`false`**
|
||||
- Copy from plugins folder gamedata file **`weaponpaints.json`** to folder **`addons/counterstrikesharp/gamedata/`**
|
||||
|
||||
## Plugin Configuration
|
||||
<details>
|
||||
@@ -71,7 +72,7 @@ Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin
|
||||
</details>
|
||||
|
||||
## Web install
|
||||
- Requires PHP >= 7.4 ***(Tested on php ver **`8.2.3`** and nginx webserver)***
|
||||
- Requires PHP >= 7.4 with curl and pdo_mysql ***(Tested on php ver **`8.2.3`** and nginx webserver)***
|
||||
- **Before using website, make sure the plugin is correctly loaded in cs2 server!** Mysql tables are created by plugin not by website.
|
||||
- Copy website to web server ***(Folder `img` not needed)***
|
||||
- Get [Steam API Key](https://steamcommunity.com/dev/apikey)
|
||||
|
||||
@@ -31,7 +31,14 @@ namespace WeaponPaints
|
||||
`weapon_defindex` int(6) NOT NULL,
|
||||
`weapon_paint_id` int(6) NOT NULL,
|
||||
`weapon_wear` float NOT NULL DEFAULT 0.000001,
|
||||
`weapon_seed` int(16) NOT NULL DEFAULT 0
|
||||
`weapon_seed` int(16) NOT NULL DEFAULT 0,
|
||||
`weapon_nametag` VARCHAR(128) DEFAULT NULL,
|
||||
`weapon_sticker_0` VARCHAR(128) NOT NULL DEFAULT '0;0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
|
||||
`weapon_sticker_1` VARCHAR(128) NOT NULL DEFAULT '0;0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
|
||||
`weapon_sticker_2` VARCHAR(128) NOT NULL DEFAULT '0;0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
|
||||
`weapon_sticker_3` VARCHAR(128) NOT NULL DEFAULT '0;0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
|
||||
`weapon_sticker_4` VARCHAR(128) NOT NULL DEFAULT '0;0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
|
||||
`weapon_keychain`VARCHAR(128) NOT NULL DEFAULT '0;0;0;0;0' COMMENT 'id;x;y;z;seed'
|
||||
) ENGINE=InnoDB
|
||||
""",
|
||||
@"CREATE TABLE IF NOT EXISTS `wp_player_knife` (
|
||||
|
||||
116
WeaponAction.cs
@@ -5,13 +5,15 @@ using CounterStrikeSharp.API.Modules.Memory;
|
||||
using CounterStrikeSharp.API.Modules.Timers;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Linq.Expressions;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WeaponPaints
|
||||
{
|
||||
public partial class WeaponPaints
|
||||
{
|
||||
private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon weapon)
|
||||
private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon weapon)
|
||||
{
|
||||
if (!Config.Additional.SkinEnabled) return;
|
||||
if (!gPlayerWeaponsInfo.TryGetValue(player.Slot, out _)) return;
|
||||
@@ -20,7 +22,7 @@ namespace WeaponPaints
|
||||
|
||||
if (isKnife && !g_playersKnife.ContainsKey(player.Slot) || isKnife && g_playersKnife[player.Slot] == "weapon_knife") return;
|
||||
|
||||
int[] newPaints = { 1171, 1170, 1169, 1164, 1162, 1161, 1159, 1175, 1174, 1167, 1165, 1168, 1163, 1160, 1166, 1173 };
|
||||
int[] newPaints = { 106, 112, 113, 114, 115, 117, 118, 120, 121, 123, 126, 127, 128, 129, 130, 131, 133, 134, 137, 138, 139, 140, 142, 144, 145, 146, 152, 160, 161, 163, 173, 239, 292, 324, 331, 412, 461, 513, 766, 768, 770, 773, 774, 830, 831, 832, 834, 874, 875, 877, 878, 882, 883, 901, 912, 936, 937, 938, 939, 940, 1054, 1062, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1177, 1178, 1179, 1180 };
|
||||
|
||||
if (isKnife)
|
||||
{
|
||||
@@ -52,12 +54,12 @@ namespace WeaponPaints
|
||||
weapon.FallbackWear = 0.01f;
|
||||
|
||||
weapon.AttributeManager.Item.NetworkedDynamicAttributes.Attributes.RemoveAll();
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", GetRandomPaint(weaponDefIndex));
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", GetRandomPaint(weaponDefIndex));
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture seed", 0);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture wear", 0.01f);
|
||||
|
||||
weapon.AttributeManager.Item.AttributeList.Attributes.RemoveAll();
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.AttributeList.Handle, "set item texture prefab", GetRandomPaint(weaponDefIndex));
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.AttributeList.Handle, "set item texture prefab", GetRandomPaint(weaponDefIndex));
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.AttributeList.Handle, "set item texture seed", 0);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.AttributeList.Handle, "set item texture wear", 0.01f);
|
||||
|
||||
@@ -75,9 +77,11 @@ namespace WeaponPaints
|
||||
|
||||
var weaponInfo = value;
|
||||
//Log($"Apply on {weapon.DesignerName}({weapon.AttributeManager.Item.ItemDefinitionIndex}) paint {gPlayerWeaponPaints[steamId.SteamId64][weapon.AttributeManager.Item.ItemDefinitionIndex]} seed {gPlayerWeaponSeed[steamId.SteamId64][weapon.AttributeManager.Item.ItemDefinitionIndex]} wear {gPlayerWeaponWear[steamId.SteamId64][weapon.AttributeManager.Item.ItemDefinitionIndex]}");
|
||||
|
||||
weapon.AttributeManager.Item.ItemID = 16384;
|
||||
weapon.AttributeManager.Item.ItemIDLow = 16384 & 0xFFFFFFFF;
|
||||
weapon.AttributeManager.Item.ItemIDHigh = weapon.AttributeManager.Item.ItemIDLow >> 32;
|
||||
weapon.AttributeManager.Item.CustomName = weaponInfo.Nametag;
|
||||
weapon.FallbackPaintKit = weaponInfo.Paint;
|
||||
weapon.FallbackSeed = weaponInfo.Seed;
|
||||
weapon.FallbackWear = weaponInfo.Wear;
|
||||
@@ -89,9 +93,104 @@ namespace WeaponPaints
|
||||
return;
|
||||
|
||||
if (isKnife) return;
|
||||
|
||||
if (weaponInfo.Stickers.Count > 0) SetStickers(player, weapon);
|
||||
if (weaponInfo.KeyChain != null) SetKeychain(player, weapon);
|
||||
|
||||
UpdatePlayerWeaponMeshGroupMask(player, weapon, !newPaints.Contains(fallbackPaintKit));
|
||||
}
|
||||
|
||||
|
||||
// silly method to update sticker when call RefreshWeapons()
|
||||
private void IncrementWearForWeaponWithStickers(CCSPlayerController player, CBasePlayerWeapon weapon)
|
||||
{
|
||||
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
|
||||
if (gPlayerWeaponsInfo.TryGetValue(player.Slot, out var playerWeapons) &&
|
||||
playerWeapons.TryGetValue(weaponDefIndex, out var weaponInfo) &&
|
||||
weaponInfo.Stickers.Count > 0)
|
||||
{
|
||||
|
||||
float wearIncrement = 0.001f;
|
||||
float currentWear = weaponInfo.Wear;
|
||||
|
||||
var playerWear = temporaryPlayerWeaponWear.GetOrAdd(player.Slot, _ => new ConcurrentDictionary<int, float>());
|
||||
|
||||
float incrementedWear = playerWear.AddOrUpdate(
|
||||
weaponDefIndex,
|
||||
currentWear + wearIncrement,
|
||||
(_, oldWear) => Math.Min(oldWear + wearIncrement, 1.0f)
|
||||
);
|
||||
|
||||
weapon.FallbackWear = incrementedWear;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetStickers(CCSPlayerController? player, CBasePlayerWeapon weapon)
|
||||
{
|
||||
if (player == null || !player.IsValid) return;
|
||||
|
||||
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
|
||||
|
||||
if (!gPlayerWeaponsInfo.TryGetValue(player.Slot, out var playerWeapons) ||
|
||||
playerWeapons == null ||
|
||||
!playerWeapons.TryGetValue(weaponDefIndex, out var weaponInfo) ||
|
||||
weaponInfo == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var sticker in weaponInfo.Stickers)
|
||||
{
|
||||
int stickerSlot = weaponInfo.Stickers.IndexOf(sticker);
|
||||
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} id", ViewAsFloat(sticker.Id));
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} schema", sticker.Schema);
|
||||
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,
|
||||
$"sticker slot {stickerSlot} scale", sticker.Scale);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
$"sticker slot {stickerSlot} rotation", sticker.Rotation);
|
||||
}
|
||||
|
||||
if (temporaryPlayerWeaponWear != null &&
|
||||
temporaryPlayerWeaponWear.TryGetValue(player.Slot, out var playerWear) &&
|
||||
playerWear.TryGetValue(weaponDefIndex, out float storedWear))
|
||||
{
|
||||
weapon.FallbackWear = storedWear;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetKeychain(CCSPlayerController? player, CBasePlayerWeapon weapon)
|
||||
{
|
||||
if (player == null || !player.IsValid) return;
|
||||
|
||||
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
|
||||
|
||||
if (gPlayerWeaponsInfo.TryGetValue(player.Slot, out var playerWeaponsInfo) &&
|
||||
playerWeaponsInfo.TryGetValue(weaponDefIndex, out var value) &&
|
||||
value.KeyChain != null)
|
||||
{
|
||||
var keyChain = value.KeyChain;
|
||||
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
"keychain slot 0 id", ViewAsFloat(keyChain.Id));
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
"keychain slot 0 offset x", keyChain.OffsetX);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
"keychain slot 0 offset y", keyChain.OffsetY);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
"keychain slot 0 offset z", keyChain.OffsetZ);
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle,
|
||||
"keychain slot 0 seed", keyChain.Seed);
|
||||
}
|
||||
}
|
||||
|
||||
private static void GiveKnifeToPlayer(CCSPlayerController? player)
|
||||
{
|
||||
if (!_config.Additional.KnifeEnabled || player == null || !player.IsValid) return;
|
||||
@@ -248,6 +347,8 @@ namespace WeaponPaints
|
||||
{
|
||||
newWeapon.Clip1 = ammo.Item1;
|
||||
newWeapon.ReserveAmmo[0] = ammo.Item2;
|
||||
|
||||
IncrementWearForWeaponWithStickers(player, newWeapon);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -447,5 +548,10 @@ namespace WeaponPaints
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
public float ViewAsFloat(uint value)
|
||||
{
|
||||
return BitConverter.Int32BitsToSingle((int)value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,5 +5,28 @@
|
||||
public int Paint { get; set; }
|
||||
public int Seed { get; set; } = 0;
|
||||
public float Wear { get; set; } = 0f;
|
||||
public string Nametag { get; set; } = "";
|
||||
public KeyChainInfo? KeyChain { get; set; }
|
||||
public List<StickerInfo> Stickers { get; set; } = new List<StickerInfo>();
|
||||
}
|
||||
|
||||
public class StickerInfo
|
||||
{
|
||||
public uint Id { get; set; }
|
||||
public uint Schema { get; set; }
|
||||
public float OffsetX { get; set; }
|
||||
public float OffsetY { get; set; }
|
||||
public float Wear { get; set; }
|
||||
public float Scale { get; set; }
|
||||
public float Rotation { get; set; }
|
||||
}
|
||||
|
||||
public class KeyChainInfo
|
||||
{
|
||||
public uint Id { get; set; }
|
||||
public float OffsetX { get; set; }
|
||||
public float OffsetY { get; set; }
|
||||
public float OffsetZ { get; set; }
|
||||
public uint Seed { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -165,6 +165,8 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
||||
private ulong _nextItemId = MinimumCustomItemId;
|
||||
public static readonly bool IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
|
||||
private ConcurrentDictionary<int, ConcurrentDictionary<int, float>> temporaryPlayerWeaponWear = new ConcurrentDictionary<int, ConcurrentDictionary<int, float>>();
|
||||
|
||||
public WeaponPaintsConfig Config { get; set; } = new();
|
||||
public override string ModuleAuthor => "Nereziel & daffyy";
|
||||
public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based";
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.233" />
|
||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.281" />
|
||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||
<PackageReference Include="MySqlConnector" Version="2.3.7" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using MySqlConnector;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
||||
namespace WeaponPaints
|
||||
{
|
||||
internal class WeaponSynchronization
|
||||
@@ -20,7 +21,7 @@ namespace WeaponPaints
|
||||
try
|
||||
{
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
|
||||
|
||||
if (_config.Additional.KnifeEnabled)
|
||||
GetKnifeFromDatabase(player, connection);
|
||||
if (_config.Additional.GloveEnabled)
|
||||
@@ -127,14 +128,85 @@ namespace WeaponPaints
|
||||
int weaponPaintId = row?.weapon_paint_id ?? 0;
|
||||
float weaponWear = row?.weapon_wear ?? 0f;
|
||||
int weaponSeed = row?.weapon_seed ?? 0;
|
||||
string weaponNameTag = row?.weapon_nametag ?? "";
|
||||
|
||||
string[]? keyChainParts = row?.weapon_keychain?.ToString().Split(';');
|
||||
|
||||
KeyChainInfo keyChainInfo = new KeyChainInfo();
|
||||
|
||||
if (keyChainParts!.Length == 5 &&
|
||||
uint.TryParse(keyChainParts[0], out uint keyChainId) &&
|
||||
float.TryParse(keyChainParts[1], out float keyChainOffsetX) &&
|
||||
float.TryParse(keyChainParts[2], out float keyChainOffsetY) &&
|
||||
float.TryParse(keyChainParts[3], out float keyChainOffsetZ) &&
|
||||
uint.TryParse(keyChainParts[4], out uint keyChainSeed))
|
||||
{
|
||||
// Successfully parsed the values
|
||||
keyChainInfo.Id = keyChainId;
|
||||
keyChainInfo.OffsetX = keyChainOffsetX;
|
||||
keyChainInfo.OffsetY = keyChainOffsetY;
|
||||
keyChainInfo.OffsetZ = keyChainOffsetZ;
|
||||
keyChainInfo.Seed = keyChainSeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Failed to parse the values, default to 0
|
||||
keyChainInfo.Id = 0;
|
||||
keyChainInfo.OffsetX = 0f;
|
||||
keyChainInfo.OffsetY = 0f;
|
||||
keyChainInfo.OffsetZ = 0f;
|
||||
keyChainInfo.Seed = 0;
|
||||
}
|
||||
|
||||
// Create the WeaponInfo object
|
||||
WeaponInfo weaponInfo = new WeaponInfo
|
||||
{
|
||||
Paint = weaponPaintId,
|
||||
Seed = weaponSeed,
|
||||
Wear = weaponWear
|
||||
Wear = weaponWear,
|
||||
Nametag = weaponNameTag,
|
||||
KeyChain = keyChainInfo
|
||||
};
|
||||
|
||||
// Retrieve and parse sticker data (up to 5 slots)
|
||||
for (int i = 0; i <= 4; i++)
|
||||
{
|
||||
// Access the sticker data dynamically using reflection
|
||||
string stickerColumn = $"weapon_sticker_{i}";
|
||||
var stickerData = ((IDictionary<string, object>)row!)[stickerColumn]; // Safely cast row to a dictionary
|
||||
|
||||
if (stickerData != null && !string.IsNullOrEmpty(stickerData.ToString()))
|
||||
{
|
||||
var parts = stickerData.ToString()!.Split(';');
|
||||
|
||||
//"id;schema;x;y;wear;scale;rotation"
|
||||
if (parts.Length == 7 &&
|
||||
uint.TryParse(parts[0], out uint stickerId) &&
|
||||
uint.TryParse(parts[1], out uint stickerSchema) &&
|
||||
float.TryParse(parts[2], out float stickerOffsetX) &&
|
||||
float.TryParse(parts[3], out float stickerOffsetY) &&
|
||||
float.TryParse(parts[4], out float stickerWear) &&
|
||||
float.TryParse(parts[5], out float stickerScale) &&
|
||||
float.TryParse(parts[6], out float stickerRotation))
|
||||
{
|
||||
StickerInfo stickerInfo = new StickerInfo
|
||||
{
|
||||
Id = stickerId,
|
||||
Schema = stickerSchema,
|
||||
OffsetX = stickerOffsetX,
|
||||
OffsetY = stickerOffsetY,
|
||||
Wear = stickerWear,
|
||||
Scale = stickerScale,
|
||||
Rotation = stickerRotation
|
||||
};
|
||||
|
||||
weaponInfo.Stickers.Add(stickerInfo);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
weaponInfos[weaponDefIndex] = weaponInfo;
|
||||
}
|
||||
|
||||
@@ -167,14 +239,12 @@ namespace WeaponPaints
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
internal async Task SyncKnifeToDatabase(PlayerInfo player, string knife)
|
||||
{
|
||||
if (!_config.Additional.KnifeEnabled || string.IsNullOrEmpty(player.SteamId) || string.IsNullOrEmpty(knife)) return;
|
||||
|
||||
const string query = "INSERT INTO `wp_player_knife` (`steamid`, `knife`) VALUES(@steamid, @newKnife) ON DUPLICATE KEY UPDATE `knife` = @newKnife";
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"ChangeSubclass": {
|
||||
"signatures": {
|
||||
"library": "server",
|
||||
"windows": "40 57 48 83 EC 20 48 8B F9 41 B0 01",
|
||||
"linux": "55 48 89 E5 41 57 41 56 49 89 FE 41 55 41 54 45 31 E4 53 48 81 EC 98 00 00 00 48 85 F6 74 ? 80 3E 00 49 89 F5 75 ? 48 81 C4 98 00 00 00 44 89 E6 4C 89 F7 5B 41 5C 41 5D 41 5E 41 5F 5D E9 ? ? ? ? 0F 1F 44 00 00 4C 8D BD 40 FF FF FF 48 89 F7 E8 ? ? ? ? 45 31 C0 4C 89 EA 31 F6 49 89 C4 4C 89 FF 89 C3 48 C7 85 48 FF FF FF 00 00 00 00 48 B8 00 00 00 00 80 00 00 C0 44 89 E1 48 89 85 40 FF FF FF E8 ? ? ? ? 31 F6 4C 89 FF E8 ? ? ? ? 48 8D 8D 48 FF FF FF F6 85 47 FF FF FF 40 75 ? F7 85 44 FF FF FF FF FF FF 3F 48 8D 0D F3 D1 C7 00"
|
||||
}
|
||||
},
|
||||
"CAttributeList_SetOrAddAttributeValueByName": {
|
||||
"signatures": {
|
||||
"library": "server",
|
||||
"windows": "\\x40\\x53\\x41\\x56\\x41\\x57\\x48\\x81\\xEC\\x90\\x00\\x00\\x00\\x0F\\x29\\x74\\x24\\x70",
|
||||
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x49\\x89\\xFE\\x41\\x55\\x41\\x54\\x49\\x89\\xF4\\x53\\x48\\x83\\xEC\\x78"
|
||||
}
|
||||
},
|
||||
"CBaseModelEntity_SetBodygroup": {
|
||||
"signatures": {
|
||||
"library": "server",
|
||||
"windows": "\\x48\\x89\\x5C\\x24\\x08\\x48\\x89\\x74\\x24\\x10\\x57\\x48\\x83\\xEC\\x20\\x41\\x8B\\xF8\\x48\\x8B\\xF2\\x48\\x8B\\xD9\\xE8\\x2A\\x2A\\x2A\\x2A",
|
||||
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x56\\x49\\x89\\xF6\\x41\\x55\\x41\\x89\\xD5\\x41\\x54\\x49\\x89\\xFC\\x48\\x83\\xEC\\x08"
|
||||
}
|
||||
}
|
||||
"ChangeSubclass": {
|
||||
"signatures": {
|
||||
"library": "server",
|
||||
"windows": "48 89 6C 24 ? 56 48 83 EC ? 48 8B EA 48 8B F1 E8 ? ? ? ? 84 C0 0F 84",
|
||||
"linux": "55 48 89 E5 41 57 41 56 41 55 49 89 F5 41 54 49 89 FC 53 48 81 EC A8 00 00 00"
|
||||
}
|
||||
},
|
||||
"CAttributeList_SetOrAddAttributeValueByName": {
|
||||
"signatures": {
|
||||
"library": "server",
|
||||
"windows": "40 53 41 56 41 57 48 81 EC 90 00 00 00 0F 29 74 24 70",
|
||||
"linux": "55 48 89 E5 41 57 41 56 49 89 FE 41 55 41 54 49 89 F4 53 48 83 EC 78"
|
||||
}
|
||||
},
|
||||
"CBaseModelEntity_SetBodygroup": {
|
||||
"signatures": {
|
||||
"library": "server",
|
||||
"windows": "48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 41 8B F8 48 8B F2 48 8B D9 E8 ? ? ? ?",
|
||||
"linux": "55 48 89 E5 41 56 49 89 F6 41 55 41 89 D5 41 54 49 89 FC 48 83 EC 08"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,12 @@
|
||||
"model": "tm_professional/tm_professional_varf4",
|
||||
"agent_name": "Sir Bloody Loudmouth Darryl | The Professionals"
|
||||
},
|
||||
{
|
||||
"team": 2,
|
||||
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4613.png",
|
||||
"model": "tm_professional/tm_professional_varf5",
|
||||
"agent_name": "Bloody Darryl The Strapped | The Professionals"
|
||||
},
|
||||
{
|
||||
"team": 3,
|
||||
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4749.png",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"weapon_defindex": 0,
|
||||
"paint": "0",
|
||||
"image": "",
|
||||
"image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/default_gloves.png",
|
||||
"paint_name": "Gloves | Default"
|
||||
},
|
||||
{
|
||||
|
||||
12078
website/data/skins.json
1
website/data/skins_bg.json
Normal file
1
website/data/skins_cs.json
Normal file
1
website/data/skins_da.json
Normal file
1
website/data/skins_de.json
Normal file
1
website/data/skins_el.json
Normal file
1
website/data/skins_es-ES.json
Normal file
1
website/data/skins_es-MX.json
Normal file
1
website/data/skins_fi.json
Normal file
1
website/data/skins_fr.json
Normal file
1
website/data/skins_hu.json
Normal file
1
website/data/skins_it.json
Normal file
1
website/data/skins_ja.json
Normal file
1
website/data/skins_ko.json
Normal file
1
website/data/skins_nl.json
Normal file
1
website/data/skins_no.json
Normal file
1
website/data/skins_pl.json
Normal file
1
website/data/skins_pt-BR.json
Normal file
1
website/data/skins_pt-PT.json
Normal file
1
website/data/skins_ro.json
Normal file
1
website/data/skins_ru.json
Normal file
1
website/data/skins_sv.json
Normal file
1
website/data/skins_th.json
Normal file
1
website/data/skins_tr.json
Normal file
1
website/data/skins_uk.json
Normal file
1
website/data/skins_vi.json
Normal file
1
website/data/skins_zh-CN.json
Normal file
1
website/data/skins_zh-TW.json
Normal file
BIN
website/img/skins/default_gloves.png
Normal file
|
After Width: | Height: | Size: 244 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 37 KiB |
BIN
website/img/skins/weapon_cz75a-12.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
website/img/skins/weapon_cz75a-32.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 63 KiB |
BIN
website/img/skins/weapon_knife_gypsy_jackknife-43.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
website/img/skins/weapon_knife_gypsy_jackknife-44.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 50 KiB |
BIN
website/img/skins/weapon_knife_ursus-419.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 35 KiB |
BIN
website/img/skins/weapon_m4a1_silencer-235.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
website/img/skins/weapon_m4a1_silencer-254.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 22 KiB |
BIN
website/img/skins/weapon_p2000.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 38 KiB |
BIN
website/img/skins/weapon_sg556-1084.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
website/img/skins/weapon_sg556-1151.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
website/img/skins/weapon_sg556-1234.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 32 KiB |
BIN
website/img/skins/weapon_ssg08-26.png
Normal file
|
After Width: | Height: | Size: 86 KiB |