Compare commits

...

78 Commits

Author SHA1 Message Date
Dawid Bepierszcz
8cb9563994 Merge pull request #211 from daffyyyy/main
2.2e
2024-03-11 11:19:41 +01:00
Dawid Bepierszcz
e45714cb9a Merge branch 'Nereziel:main' into main 2024-03-11 11:16:45 +01:00
Dawid Bepierszcz
97e73bfd53 2.2e 2024-03-11 11:16:18 +01:00
Dawid Bepierszcz
6dc047477c Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-03-11 11:10:28 +01:00
Dawid Bepierszcz
ced010645d 2.2e
- Changed data loading to non-block main thread
- Additional check for empty agent
2024-03-11 11:10:25 +01:00
Dawid Bepierszcz
b030d5c7e1 Merge pull request #206 from daffyyyy/main
2.2d
2024-03-09 18:47:02 +01:00
Dawid Bepierszcz
90771f76c7 Merge branch 'Nereziel:main' into main 2024-03-09 18:46:39 +01:00
Dawid Bepierszcz
ad8e51a403 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-03-09 18:46:23 +01:00
Dawid Bepierszcz
8c1edddd1e 2.2d
- Fixed skins
2024-03-09 18:46:12 +01:00
Dawid Bepierszcz
6f86cddd13 Merge pull request #204 from daffyyyy/main
2.2c
2024-03-09 12:03:20 +01:00
Dawid Bepierszcz
24801e814b Merge branch 'Nereziel:main' into main 2024-03-09 12:02:55 +01:00
Dawid Bepierszcz
77def8a305 2.2c
- Minor changes
- Updated translations
- Updated css
2024-03-09 12:01:25 +01:00
Dawid Bepierszcz
651fae4d23 Merge pull request #191 from daffyyyy/main
2.2b
2024-03-05 12:28:48 +01:00
Dawid Bepierszcz
692c22f7d1 Merge branch 'Nereziel:main' into main 2024-03-05 12:27:46 +01:00
Dawid Bepierszcz
cf07106641 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-03-05 12:27:21 +01:00
Dawid Bepierszcz
44177f18fe 2.2b
- Small fixes 🍕
2024-03-05 12:27:19 +01:00
Dawid Bepierszcz
88274d78d8 Merge pull request #188 from daffyyyy/main
2.2a

- Updated languages
- Added agents
- Minor changes
- Updated readme
- Gloves small fix
- Fixed showimage
2024-03-05 02:24:48 +01:00
Dawid Bepierszcz
5cef723674 Merge branch 'Nereziel:main' into main 2024-03-05 02:23:07 +01:00
Dawid Bepierszcz
5f83645867 2.2a
- Added agents images
2024-03-05 02:22:02 +01:00
Dawid Bepierszcz
89005fdd4b Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-03-05 02:20:42 +01:00
Dawid Bepierszcz
4f432cddf5 2.2a
- Updated languages
- Added agents
- Minor changes
- Updated readme
- Gloves small fix
- Fixed showimage
2024-03-05 02:20:33 +01:00
Dawid Bepierszcz
ee1259846d Merge pull request #187 from daffyyyy/main
2.1a
2024-03-04 23:52:42 +01:00
Dawid Bepierszcz
485dd1e9dd Merge branch 'Nereziel:main' into main 2024-03-04 23:51:32 +01:00
Dawid Bepierszcz
666de9e2d2 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-03-04 23:51:10 +01:00
Dawid Bepierszcz
77409269d0 2.1a
- FINALLY WINDOWS SUPPORT
- Fixed visual bug (no skin)
2024-03-04 23:51:08 +01:00
Dawid Bepierszcz
09d9de2a2a Merge pull request #186 from daffyyyy/main
2.0a
2024-03-04 21:50:42 +01:00
Dawid Bepierszcz
362084c503 Merge branch 'Nereziel:main' into main 2024-03-04 21:49:41 +01:00
Dawid Bepierszcz
8cf175d336 2.0a
- New knife method
- Minor commands changes
- Remove OnTick event
- Changed save place
- New skins saving method
- New gamedata file

**IMPORTANT UPDATE**
2024-03-04 21:47:54 +01:00
Nereziel
84adfa8085 Update FUNDING.yml 2024-03-01 15:16:54 +01:00
Nereziel
286d97d125 Create FUNDING.yml 2024-03-01 15:14:07 +01:00
Dawid Bepierszcz
4d3db5b34f Merge pull request #174 from daffyyyy/main
1.9c
2024-02-25 13:20:57 +01:00
Dawid Bepierszcz
85d4e11f26 Merge branch 'Nereziel:main' into main 2024-02-25 13:19:55 +01:00
Dawid Bepierszcz
34b086a140 1.9c
- Some changes
2024-02-25 12:55:44 +01:00
Dawid Bepierszcz
ad73e0a85d Merge pull request #171 from daffyyyy/main
Some fixes
2024-02-23 02:58:01 +01:00
Dawid Bepierszcz
25c205e53d Merge branch 'Nereziel:main' into main 2024-02-23 02:56:42 +01:00
Dawid Bepierszcz
1366e141a7 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-02-23 02:46:00 +01:00
Dawid Bepierszcz
5465b982b7 Some fixes 2024-02-23 02:45:58 +01:00
Dawid Bepierszcz
ead5ae23a3 Merge pull request #170 from daffyyyy/main
1.9b
2024-02-22 22:46:31 +01:00
Dawid Bepierszcz
ff2e7ffd6b Merge branch 'Nereziel:main' into main 2024-02-22 22:43:46 +01:00
Dawid Bepierszcz
c9a1fad496 1.9b 2024-02-22 22:43:25 +01:00
Dawid Bepierszcz
0d4d01800d Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-02-22 22:41:34 +01:00
Dawid Bepierszcz
19d004c21d 1.9b
- Fixed weapons on retake
- FIxed saving
2024-02-22 22:41:32 +01:00
Dawid Bepierszcz
391efd5cac Merge pull request #169 from daffyyyy/main
1.9a
2024-02-22 21:12:33 +01:00
Dawid Bepierszcz
3cf9a67ee2 Merge branch 'Nereziel:main' into main 2024-02-22 21:10:26 +01:00
Dawid Bepierszcz
ddb4fb7cba Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-02-22 21:09:00 +01:00
Dawid Bepierszcz
e75d48bd0d 1.9a
- Removed GlobalShare
- More stability
2024-02-22 21:07:52 +01:00
Dawid Bepierszcz
959123344f Merge pull request #165 from daffyyyy/main
1.8d
2024-02-21 12:06:08 +01:00
Dawid Bepierszcz
14b0b8153f Merge branch 'Nereziel:main' into main 2024-02-21 12:04:41 +01:00
Dawid Bepierszcz
fa48245b34 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-02-21 12:03:52 +01:00
Dawid Bepierszcz
5d5e0f2bd1 1.8d
- Small changes
- Fixed gloves command
2024-02-21 12:03:48 +01:00
Dawid Bepierszcz
726e67865c Merge pull request #163 from daffyyyy/main
1.8c
2024-02-20 12:54:31 +01:00
Dawid Bepierszcz
868e6c8746 Merge branch 'Nereziel:main' into main 2024-02-20 12:52:33 +01:00
Dawid Bepierszcz
a1285bef26 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-02-20 12:51:15 +01:00
Dawid Bepierszcz
b1920f312c 1.8c
- Better gloves operations
- Changed gloves table
2024-02-20 12:51:14 +01:00
Dawid Bepierszcz
5e9850bece Merge pull request #162 from daffyyyy/main
1.8b
2024-02-20 01:57:01 +01:00
Dawid Bepierszcz
e1802fd0f0 Merge branch 'Nereziel:main' into main 2024-02-20 01:55:45 +01:00
Dawid Bepierszcz
267de3c4de 1.8b
- Fixed gloves changing?
2024-02-20 01:54:54 +01:00
Dawid Bepierszcz
9f24fbf3ef test 2024-02-20 01:51:25 +01:00
Dawid Bepierszcz
9c23545173 test 2024-02-20 01:48:41 +01:00
Dawid Bepierszcz
40d1088ee6 test 2024-02-20 01:46:41 +01:00
Dawid Bepierszcz
e7f546ed58 test 2024-02-20 01:43:27 +01:00
Dawid Bepierszcz
beab940ebb test 2024-02-20 01:38:22 +01:00
Dawid Bepierszcz
7dc78e7706 test 2024-02-20 01:30:09 +01:00
Dawid Bepierszcz
02208095f0 test 2024-02-20 01:28:25 +01:00
Dawid Bepierszcz
63f4b4c43d Merge pull request #161 from daffyyyy/main
1.8a
2024-02-19 14:02:02 +01:00
Dawid Bepierszcz
a6821b85b4 Merge branch 'Nereziel:main' into main 2024-02-19 14:00:14 +01:00
Dawid Bepierszcz
a37f4e9e58 1.8a
- Gloves?

Currently only in plugin, website update soon
2024-02-19 13:59:26 +01:00
Dawid Bepierszcz
fb4340cc1d Merge pull request #157 from daffyyyy/main
1.7a
2024-02-16 15:58:14 +01:00
Dawid Bepierszcz
bbbf27a751 Merge branch 'Nereziel:main' into main 2024-02-16 14:05:29 +01:00
Dawid Bepierszcz
c9d8bb9b5f 1.7a
- Fixed hotreloading
- Minor changes
2024-02-16 14:04:36 +01:00
Dawid Bepierszcz
1109c0cf56 Merge pull request #148 from daffyyyy/main
1.6c
2024-02-11 04:00:07 +01:00
Dawid Bepierszcz
63869f4c94 Merge branch 'Nereziel:main' into main 2024-02-11 03:58:49 +01:00
Dawid Bepierszcz
fa284678e8 1.6c
- Fix for invalid players
2024-02-11 03:58:32 +01:00
Dawid Bepierszcz
558f3178f2 Update WeaponAction.cs 2024-02-10 15:34:34 +01:00
Dawid Bepierszcz
c5f9cc6429 Merge pull request #145 from daffyyyy/main
1.6b
2024-02-10 13:00:48 +01:00
Dawid Bepierszcz
4087d3d016 Merge branch 'Nereziel:main' into main 2024-02-10 13:00:04 +01:00
Dawid Bepierszcz
e7919bb468 Merge branch 'main' of https://github.com/daffyyyy/cs2-WeaponPaints 2024-02-10 12:59:45 +01:00
Dawid Bepierszcz
33bd83d0a1 1.6b
- Closing menu
2024-02-10 12:59:41 +01:00
164 changed files with 14221 additions and 1014 deletions

14
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: nereziel # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
custom: ['https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -60,12 +60,12 @@ jobs:
${{ env.OUTPUT_PATH }}/Microsoft.Extensions.DependencyModel.dll \
- name: Copy skins.json
run: cp website/data/skins.json ${{ env.OUTPUT_PATH }}/skins.json
- name: Copy gloves.json
run: cp website/data/gloves.json ${{ env.OUTPUT_PATH }}/gloves.json
- name: Copy agents.json
run: cp website/data/agents.json ${{ env.OUTPUT_PATH }}/agents.json
- name: Zip
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '${{ env.PROJECT_NAME }}.zip'
path: ${{ env.OUTPUT_PATH }}
run: zip -r "${{ env.PROJECT_NAME }}.zip" "${{ env.OUTPUT_PATH }}" gamedata/
- name: Clean files Website
run: |
rm -rf website/img/

View File

@@ -1,6 +1,7 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Commands;
using CounterStrikeSharp.API.Modules.Menu;
using Newtonsoft.Json.Linq;
namespace WeaponPaints
{
@@ -13,34 +14,46 @@ namespace WeaponPaints
if (player == null || !player.IsValid || player.UserId == null || player.IsBot) return;
int playerIndex = (int)player!.Index;
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Slot = player.Slot,
Index = (int)player.Index,
SteamId = player?.SteamID.ToString(),
Name = player?.PlayerName,
IpAddress = player?.IpAddress?.Split(":")[0]
};
if (player == null || !player.IsValid || player.UserId == null || player.IsBot) return;
try
{
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
if (player != null && !commandsCooldown.TryGetValue(player.Slot, out DateTime cooldownEndTime) ||
player != null && DateTime.UtcNow >= (commandsCooldown.TryGetValue(player.Slot, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
if (weaponSync != null)
Task.Run(async () => await weaponSync.GetWeaponPaintsFromDatabase(playerInfo));
if (Config.Additional.KnifeEnabled)
{
if (weaponSync != null)
Task.Run(async () => await weaponSync.GetKnifeFromDatabase(playerInfo));
commandsCooldown[player.Slot] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
if (weaponSync != null)
{
if (Config.Additional.SkinEnabled)
{
_ = Task.Run(async () => await weaponSync.GetWeaponPaintsFromDatabase(playerInfo));
}
if (Config.Additional.KnifeEnabled)
{
_ = Task.Run(async () => await weaponSync.GetKnifeFromDatabase(playerInfo));
}
if (Config.Additional.GloveEnabled)
{
_ = Task.Run(async () => await weaponSync.GetGloveFromDatabase(playerInfo));
}
if (Config.Additional.AgentEnabled)
{
_ = Task.Run(async () => await weaponSync.GetAgentFromDatabase(playerInfo));
}
RefreshGloves(player);
RefreshWeapons(player);
}
if (!string.IsNullOrEmpty(Localizer["wp_command_refresh_done"]))
{
player!.Print(Localizer["wp_command_refresh_done"]);
@@ -68,11 +81,24 @@ namespace WeaponPaints
{
player!.Print(Localizer["wp_info_refresh"]);
}
if (!Config.Additional.KnifeEnabled) return;
if (!string.IsNullOrEmpty(Localizer["wp_info_knife"]))
{
player!.Print(Localizer["wp_info_knife"]);
}
if (Config.Additional.GloveEnabled)
if (!string.IsNullOrEmpty(Localizer["wp_info_glove"]))
{
player!.Print(Localizer["wp_info_glove"]);
}
if (Config.Additional.AgentEnabled)
if (!string.IsNullOrEmpty(Localizer["wp_info_agent"]))
{
player!.Print(Localizer["wp_info_agent"]);
}
if (Config.Additional.KnifeEnabled)
if (!string.IsNullOrEmpty(Localizer["wp_info_knife"]))
{
player!.Print(Localizer["wp_info_knife"]);
}
}
private void RegisterCommands()
@@ -84,7 +110,7 @@ namespace WeaponPaints
});
AddCommand($"css_{Config.Additional.CommandRefresh}", "Skins refresh", (player, info) =>
{
if (!Utility.IsPlayerValid(player) || !g_bCommandsAllowed) return;
if (!Utility.IsPlayerValid(player)) return;
OnCommandRefresh(player, info);
});
if (Config.Additional.CommandKillEnabled)
@@ -128,18 +154,20 @@ namespace WeaponPaints
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Slot = player.Slot,
Index = (int)player.Index,
SteamId = player.SteamID.ToString(),
Name = player.PlayerName,
IpAddress = player.IpAddress?.Split(":")[0]
};
g_playersKnife[(int)player!.Index] = knifeKey;
g_playersKnife[player.Slot] = knifeKey;
if (g_bCommandsAllowed && (LifeState_t)player.LifeState == LifeState_t.LIFE_ALIVE)
RefreshKnife(player);
RefreshWeapons(player);
_ = weaponSync?.SyncKnifeToDatabase(playerInfo, knifeKey) ?? Task.CompletedTask;
if (weaponSync != null)
_ = Task.Run(async () => await weaponSync.SyncKnifeToDatabase(playerInfo, knifeKey));
}
};
foreach (var knifePair in knivesOnly)
@@ -152,10 +180,11 @@ namespace WeaponPaints
if (player == null || player.UserId == null) return;
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
if (player != null && !commandsCooldown.TryGetValue(player.Slot, out DateTime cooldownEndTime) ||
player != null && DateTime.UtcNow >= (commandsCooldown.TryGetValue(player.Slot, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
commandsCooldown[player.Slot] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
giveItemMenu.PostSelectAction = PostSelectAction.Close;
MenuManager.OpenChatMenu(player, giveItemMenu);
return;
}
@@ -176,7 +205,6 @@ namespace WeaponPaints
{
if (!Utility.IsPlayerValid(player)) return;
int playerIndex = (int)player!.Index;
string selectedWeapon = option.Text;
if (classNamesByWeapon.TryGetValue(selectedWeapon, out string? selectedWeaponClassname))
{
@@ -194,8 +222,6 @@ namespace WeaponPaints
{
if (!Utility.IsPlayerValid(p)) return;
playerIndex = (int)p.Index;
string steamId = p.SteamID.ToString();
var firstSkin = skinsList?.FirstOrDefault(skin =>
{
@@ -205,8 +231,9 @@ namespace WeaponPaints
}
return false;
});
string selectedSkin = opt.Text;
string selectedPaintID = selectedSkin.Split('(')[1].Trim(')').Trim();
string selectedPaintID = selectedSkin.Substring(selectedSkin.LastIndexOf('(') + 1).Trim(')');
if (firstSkin != null &&
firstSkin.TryGetValue("weapon_defindex", out var weaponDefIndexObj) &&
@@ -214,34 +241,51 @@ namespace WeaponPaints
int.TryParse(weaponDefIndexObj.ToString(), out var weaponDefIndex) &&
int.TryParse(selectedPaintID, out var paintID))
{
p!.Print(Localizer["wp_skin_menu_select", selectedSkin]);
if (!gPlayerWeaponsInfo[playerIndex].ContainsKey(weaponDefIndex))
if (Config.Additional.ShowSkinImage && skinsList != null)
{
gPlayerWeaponsInfo[playerIndex][weaponDefIndex] = new WeaponInfo();
var foundSkin = skinsList.FirstOrDefault(skin =>
((int?)skin?["weapon_defindex"] ?? 0) == weaponDefIndex &&
((int?)skin?["paint"] ?? 0) == paintID &&
skin?["image"] != null
);
string image = foundSkin?["image"]?.ToString() ?? "";
PlayerWeaponImage[p.Slot] = image;
AddTimer(2.0f, () => PlayerWeaponImage.Remove(p.Slot), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
}
gPlayerWeaponsInfo[playerIndex][weaponDefIndex].Paint = paintID;
gPlayerWeaponsInfo[playerIndex][weaponDefIndex].Wear = 0.01f;
gPlayerWeaponsInfo[playerIndex][weaponDefIndex].Seed = 0;
p.Print(Localizer["wp_skin_menu_select", selectedSkin]);
if (!gPlayerWeaponsInfo[p.Slot].ContainsKey(weaponDefIndex))
{
gPlayerWeaponsInfo[p.Slot][weaponDefIndex] = new WeaponInfo();
}
gPlayerWeaponsInfo[p.Slot][weaponDefIndex].Paint = paintID;
gPlayerWeaponsInfo[p.Slot][weaponDefIndex].Wear = 0.01f;
gPlayerWeaponsInfo[p.Slot][weaponDefIndex].Seed = 0;
PlayerInfo playerInfo = new PlayerInfo
{
UserId = p.UserId,
Slot = p.Slot,
Index = (int)p.Index,
SteamId = p.SteamID.ToString(),
Name = p.PlayerName,
IpAddress = p.IpAddress?.Split(":")[0]
};
if (g_bCommandsAllowed && (LifeState_t)p.LifeState == LifeState_t.LIFE_ALIVE)
RefreshWeapons(p);
if (!Config.GlobalShare)
if (g_bCommandsAllowed && (LifeState_t)p.LifeState == LifeState_t.LIFE_ALIVE && weaponSync != null)
{
if (weaponSync != null)
Task.Run(async () => await weaponSync.SyncWeaponPaintsToDatabase(playerInfo));
RefreshWeapons(player);
try
{
_ = Task.Run(async () => await weaponSync.SyncWeaponPaintsToDatabase(playerInfo));
}
catch (Exception ex)
{
Utility.Log($"Error syncing weapon paints: {ex.Message}");
}
}
}
};
@@ -263,9 +307,8 @@ namespace WeaponPaints
}
}
}
// Open the submenu for skin selection of the chosen weapon
MenuManager.OpenChatMenu(player, skinSubMenu);
if (player != null && Utility.IsPlayerValid(player))
MenuManager.OpenChatMenu(player, skinSubMenu);
}
};
@@ -277,16 +320,240 @@ namespace WeaponPaints
}
// Command to open the weapon selection menu for players
AddCommand($"css_{Config.Additional.CommandSkinSelection}", "Skins selection menu", (player, info) =>
{
if (!Utility.IsPlayerValid(player)) return;
if (player == null || player.UserId == null) return;
if (player != null && !commandsCooldown.TryGetValue(player.Slot, out DateTime cooldownEndTime) ||
player != null && DateTime.UtcNow >= (commandsCooldown.TryGetValue(player.Slot, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{
commandsCooldown[player.Slot] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
MenuManager.OpenChatMenu(player, weaponSelectionMenu);
return;
}
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
{
player!.Print(Localizer["wp_command_cooldown"]);
}
});
}
private void SetupGlovesMenu()
{
var glovesSelectionMenu = new ChatMenu(Localizer["wp_glove_menu_title"]);
glovesSelectionMenu.PostSelectAction = PostSelectAction.Close;
var handleGloveSelection = (CCSPlayerController? player, ChatMenuOption option) =>
{
if (!Utility.IsPlayerValid(player)) return;
if (!Utility.IsPlayerValid(player) || player is null) return;
string selectedPaintName = option.Text;
var selectedGlove = glovesList.FirstOrDefault(g => g.ContainsKey("paint_name") && g["paint_name"]?.ToString() == selectedPaintName);
if (selectedGlove != null)
{
if (
selectedGlove != null &&
selectedGlove.ContainsKey("weapon_defindex") &&
selectedGlove.ContainsKey("paint") &&
int.TryParse(selectedGlove["weapon_defindex"]?.ToString(), out int weaponDefindex) &&
int.TryParse(selectedGlove["paint"]?.ToString(), out int paint)
)
{
if (Config.Additional.ShowSkinImage)
{
string image = selectedGlove["image"]?.ToString() ?? "";
PlayerWeaponImage[player.Slot] = image;
AddTimer(2.0f, () => PlayerWeaponImage.Remove(player.Slot), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
}
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Slot = player.Slot,
Index = (int)player.Index,
SteamId = player.SteamID.ToString(),
Name = player.PlayerName,
IpAddress = player.IpAddress?.Split(":")[0]
};
if (paint != 0)
{
g_playersGlove[player.Slot] = (ushort)weaponDefindex;
if (!gPlayerWeaponsInfo[player.Slot].ContainsKey(weaponDefindex))
{
WeaponInfo weaponInfo = new();
weaponInfo.Paint = paint;
gPlayerWeaponsInfo[player.Slot][weaponDefindex] = weaponInfo;
}
}
else
{
g_playersGlove.TryRemove(player.Slot, out _);
}
if (!string.IsNullOrEmpty(Localizer["wp_glove_menu_select"]))
{
player!.Print(Localizer["wp_glove_menu_select", selectedPaintName]);
}
if (weaponSync != null)
{
_ = Task.Run(async () =>
{
await weaponSync.SyncGloveToDatabase(playerInfo, weaponDefindex);
if (!gPlayerWeaponsInfo[playerInfo.Slot].TryGetValue(weaponDefindex, out WeaponInfo? value))
{
value = new WeaponInfo();
gPlayerWeaponsInfo[playerInfo.Slot][weaponDefindex] = value;
}
value.Paint = paint;
value.Wear = 0.00f;
value.Seed = 0;
await weaponSync.SyncWeaponPaintsToDatabase(playerInfo);
});
}
RefreshGloves(player);
}
};
};
// Add weapon options to the weapon selection menu
foreach (var gloveObject in glovesList)
{
string paintName = gloveObject["paint_name"]?.ToString() ?? "";
if (paintName.Length > 0)
glovesSelectionMenu.AddMenuOption(paintName, handleGloveSelection);
}
// Command to open the weapon selection menu for players
AddCommand($"css_{Config.Additional.CommandGlove}", "Gloves selection menu", (player, info) =>
{
if (!Utility.IsPlayerValid(player) || !g_bCommandsAllowed) return;
if (player == null || player.UserId == null) return;
if (player != null && !commandsCooldown.TryGetValue(player.Slot, out DateTime cooldownEndTime) ||
player != null && DateTime.UtcNow >= (commandsCooldown.TryGetValue(player.Slot, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{
commandsCooldown[player.Slot] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
MenuManager.OpenChatMenu(player, glovesSelectionMenu);
return;
}
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
{
player!.Print(Localizer["wp_command_cooldown"]);
}
});
}
private void SetupAgentsMenu()
{
var handleAgentSelection = (CCSPlayerController? player, ChatMenuOption option) =>
{
if (!Utility.IsPlayerValid(player) || player is null) return;
string selectedPaintName = option.Text;
var selectedAgent = agentsList.FirstOrDefault(g => g.ContainsKey("agent_name") && g["agent_name"]?.ToString() == selectedPaintName);
if (selectedAgent != null)
{
if (
selectedAgent != null &&
selectedAgent.ContainsKey("model")
)
{
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Slot = player.Slot,
Index = (int)player.Index,
SteamId = player.SteamID.ToString(),
Name = player.PlayerName,
IpAddress = player.IpAddress?.Split(":")[0]
};
if (Config.Additional.ShowSkinImage)
{
string image = selectedAgent["image"]?.ToString() ?? "";
PlayerWeaponImage[player.Slot] = image;
AddTimer(2.0f, () => PlayerWeaponImage.Remove(player.Slot), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
}
if (!string.IsNullOrEmpty(Localizer["wp_agent_menu_select"]))
{
player!.Print(Localizer["wp_agent_menu_select", selectedPaintName]);
}
if (player.TeamNum == 3)
{
g_playersAgent.AddOrUpdate(player.Slot,
key => (selectedAgent["model"]!.ToString().Equals("null") ? null : selectedAgent["model"]!.ToString(), null),
(key, oldValue) => (selectedAgent["model"]!.ToString().Equals("null") ? null : selectedAgent["model"]!.ToString(), oldValue.T));
}
else
{
g_playersAgent.AddOrUpdate(player.Slot,
key => (null, selectedAgent["model"]!.ToString().Equals("null") ? null : selectedAgent["model"]!.ToString()),
(key, oldValue) => (oldValue.CT, selectedAgent["model"]!.ToString().Equals("null") ? null : selectedAgent["model"]!.ToString())
);
}
if (weaponSync != null)
{
_ = Task.Run(async () =>
{
await weaponSync.SyncAgentToDatabase(playerInfo);
});
}
};
}
};
// Command to open the weapon selection menu for players
AddCommand($"css_{Config.Additional.CommandAgent}", "Agents selection menu", (player, info) =>
{
if (!Utility.IsPlayerValid(player) || !g_bCommandsAllowed) return;
if (player == null || player.UserId == null) return;
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
if (player != null && !commandsCooldown.TryGetValue(player.Slot, out DateTime cooldownEndTime) ||
player != null && DateTime.UtcNow >= (commandsCooldown.TryGetValue(player.Slot, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
{
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
MenuManager.OpenChatMenu(player, weaponSelectionMenu);
var agentsSelectionMenu = new ChatMenu(Localizer["wp_agent_menu_title"]);
agentsSelectionMenu.PostSelectAction = PostSelectAction.Close;
var filteredAgents = agentsList.Where(agentObject =>
{
if (agentObject["team"]?.Value<int>() is int teamNum)
{
return teamNum == player.TeamNum;
}
else
{
return false;
}
});
// Add weapon options to the weapon selection menu
foreach (var agentObject in filteredAgents)
{
string paintName = agentObject["agent_name"]?.ToString() ?? "";
if (paintName.Length > 0)
agentsSelectionMenu.AddMenuOption(paintName, handleAgentSelection);
}
commandsCooldown[player.Slot] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
MenuManager.OpenChatMenu(player, agentsSelectionMenu);
return;
}
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))

View File

@@ -5,12 +5,15 @@ namespace WeaponPaints
{
public class Additional
{
[JsonPropertyName("SkinVisibilityFix")]
public bool SkinVisibilityFix { get; set; } = true;
[JsonPropertyName("KnifeEnabled")]
public bool KnifeEnabled { get; set; } = true;
[JsonPropertyName("GloveEnabled")]
public bool GloveEnabled { get; set; } = true;
[JsonPropertyName("AgentEnabled")]
public bool AgentEnabled { get; set; } = true;
[JsonPropertyName("SkinEnabled")]
public bool SkinEnabled { get; set; } = true;
@@ -23,6 +26,12 @@ namespace WeaponPaints
[JsonPropertyName("CommandKnife")]
public string CommandKnife { get; set; } = "knife";
[JsonPropertyName("CommandGlove")]
public string CommandGlove { get; set; } = "gloves";
[JsonPropertyName("CommandAgent")]
public string CommandAgent { get; set; } = "agents";
[JsonPropertyName("CommandSkin")]
public string CommandSkin { get; set; } = "ws";
@@ -41,13 +50,13 @@ namespace WeaponPaints
[JsonPropertyName("GiveRandomSkin")]
public bool GiveRandomSkin { get; set; } = false;
[JsonPropertyName("GiveKnifeAfterRemove")]
public bool GiveKnifeAfterRemove { get; set; } = false;
[JsonPropertyName("ShowSkinImage")]
public bool ShowSkinImage { get; set; } = true;
}
public class WeaponPaintsConfig : BasePluginConfig
{
public override int Version { get; set; } = 4;
public override int Version { get; set; } = 6;
[JsonPropertyName("DatabaseHost")]
public string DatabaseHost { get; set; } = "";
@@ -64,9 +73,6 @@ namespace WeaponPaints
[JsonPropertyName("DatabaseName")]
public string DatabaseName { get; set; } = "";
[JsonPropertyName("GlobalShare")]
public bool GlobalShare { get; set; } = false;
[JsonPropertyName("CmdRefreshCooldownSeconds")]
public int CmdRefreshCooldownSeconds { get; set; } = 60;

516
Events.cs
View File

@@ -1,258 +1,214 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Attributes.Registration;
using CounterStrikeSharp.API.Modules.Entities;
namespace WeaponPaints
{
public partial class WeaponPaints
{
private void OnClientPutInServer(int playerSlot)
[GameEventHandler]
public HookResult OnClientFullConnect(EventPlayerConnectFull @event, GameEventInfo info)
{
CCSPlayerController? player = Utilities.GetPlayerFromSlot(playerSlot);
CCSPlayerController? player = @event.Userid;
if (player == null || !player.IsValid || player.IsBot || player.IsHLTV || weaponSync == null || player.Connected == PlayerConnectedState.PlayerDisconnecting) return;
if (player is null || !player.IsValid || player.IsBot || player.IsHLTV || player.SteamID.ToString().Length != 17 ||
weaponSync == null || _database == null) return HookResult.Continue;
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Slot = player.Slot,
Index = (int)player.Index,
SteamId = player.SteamID.ToString(),
Name = player.PlayerName,
IpAddress = player.IpAddress?.Split(":")[0]
};
if (!gPlayerWeaponsInfo.ContainsKey((int)player.Index))
try
{
_ = Task.Run(async () =>
if (Config.Additional.SkinEnabled)
{
if (Config.Additional.SkinEnabled)
await weaponSync.GetWeaponPaintsFromDatabase(playerInfo);
if (Config.Additional.KnifeEnabled)
await weaponSync.GetKnifeFromDatabase(playerInfo);
});
}
}
private void OnClientDisconnect(int playerSlot)
{
CCSPlayerController player = Utilities.GetPlayerFromSlot(playerSlot);
if (player == null || !player.IsValid || player.IsBot || player.IsHLTV || player.UserId == null)
return;
if (Config.Additional.KnifeEnabled)
g_playersKnife.TryRemove((int)player.Index, out _);
if (Config.Additional.SkinEnabled && gPlayerWeaponsInfo.TryGetValue((int)player.Index, out var innerDictionary))
{
innerDictionary.Clear();
gPlayerWeaponsInfo.TryRemove((int)player.Index, out _);
}
commandsCooldown.Remove((int)player.UserId);
}
private void OnEntityCreated(CEntityInstance entity)
{
if (!Config.Additional.SkinEnabled) return;
if (entity == null || !entity.IsValid || string.IsNullOrEmpty(entity.DesignerName)) return;
string designerName = entity.DesignerName;
if (!weaponList.ContainsKey(designerName)) return;
bool isKnife = false;
var weapon = new CBasePlayerWeapon(entity.Handle);
if (designerName.Contains("knife") || designerName.Contains("bayonet"))
{
isKnife = true;
}
Server.NextFrame(() =>
{
try
{
if (!weapon.IsValid) return;
if (weapon.OwnerEntity.Value == null) return;
if (weapon.OwnerEntity.Index <= 0) return;
int weaponOwner = (int)weapon.OwnerEntity.Index;
CBasePlayerPawn? pawn = Utilities.GetEntityFromIndex<CCSPlayerPawn>((int)weaponOwner);
//var pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex(weaponOwner));
if (!pawn.IsValid) return;
var playerIndex = (int)pawn.Controller.Index;
var player = Utilities.GetPlayerFromIndex(playerIndex);
if (!Utility.IsPlayerValid(player)) return;
ChangeWeaponAttributes(weapon, player, isKnife);
_ = Task.Run(async () => await weaponSync.GetWeaponPaintsFromDatabase(playerInfo));
}
catch (Exception) { }
});
}
private HookResult OnEventItemPurchasePost(EventItemPurchase @event, GameEventInfo info)
{
CCSPlayerController? player = @event.Userid;
if (player == null || !player.IsValid) return HookResult.Continue;
/*
if (Config.Additional.SkinVisibilityFix)
AddTimer(0.2f, () => RefreshSkins(player));
*/
return HookResult.Continue;
}
/*
private HookResult OnItemPickup(EventItemPickup @event, GameEventInfo info)
{
if (@event.Defindex == 42 || @event.Defindex == 59)
{
CCSPlayerController? player = @event.Userid;
if (player == null || !player.IsValid || !g_knifePickupCount.ContainsKey((int)player.Index) || player.IsBot || !g_playersKnife.ContainsKey((int)player.Index))
return HookResult.Continue;
if (g_knifePickupCount[(int)player.Index] >= 2) return HookResult.Continue;
if (g_playersKnife.ContainsKey((int)player.Index)
&&
g_playersKnife[(int)player.Index] != "weapon_knife")
if (Config.Additional.KnifeEnabled)
{
g_knifePickupCount[(int)player.Index]++;
RemovePlayerKnife(player, true);
if (!PlayerHasKnife(player) && Config.Additional.GiveKnifeAfterRemove)
AddTimer(0.3f, () => GiveKnifeToPlayer(player));
_ = Task.Run(async () => await weaponSync.GetKnifeFromDatabase(playerInfo));
}
if (Config.Additional.GloveEnabled)
{
_ = Task.Run(async () => await weaponSync.GetGloveFromDatabase(playerInfo));
}
if (Config.Additional.AgentEnabled)
{
_ = Task.Run(async () => await weaponSync.GetAgentFromDatabase(playerInfo));
}
}
return HookResult.Continue;
}
*/
public HookResult OnPickup(CEntityIOOutput output, string name, CEntityInstance activator, CEntityInstance caller, CVariant value, float delay)
{
CCSPlayerController? player = Utilities.GetEntityFromIndex<CCSPlayerPawn>((int)activator.Index).OriginalController.Value;
if (player == null || player.IsBot || player.IsHLTV ||
player.SteamID.ToString() == "" || !g_knifePickupCount.TryGetValue((int)player.Index, out var pickupCount) ||
!g_playersKnife.ContainsKey((int)player.Index))
catch (Exception)
{
return HookResult.Continue;
}
CBasePlayerWeapon weapon = new(caller.Handle);
if (weapon.AttributeManager.Item.ItemDefinitionIndex != 42 && weapon.AttributeManager.Item.ItemDefinitionIndex != 59)
{
return HookResult.Continue;
}
if (pickupCount >= 2)
{
return HookResult.Continue;
}
if (g_playersKnife[(int)player.Index] != "weapon_knife")
{
pickupCount++;
g_knifePickupCount[(int)player.Index] = pickupCount;
player.RemoveItemByDesignerName(weapon.DesignerName);
if (Config.Additional.GiveKnifeAfterRemove)
{
AddTimer(0.2f, () => GiveKnifeToPlayer(player));
}
}
return HookResult.Continue;
}
private void OnMapStart(string mapName)
[GameEventHandler]
public HookResult OnPlayerDisconnect(EventPlayerDisconnect @event, GameEventInfo info)
{
if (!Config.Additional.KnifeEnabled && !Config.Additional.SkinEnabled) return;
CCSPlayerController player = @event.Userid;
if (_database != null)
weaponSync = new WeaponSynchronization(_database, Config, GlobalShareApi, GlobalShareServerId);
// TODO
// needed for now
AddTimer(2.0f, () =>
{
NativeAPI.IssueServerCommand("mp_t_default_melee \"\"");
NativeAPI.IssueServerCommand("mp_ct_default_melee \"\"");
NativeAPI.IssueServerCommand("mp_equipment_reset_rounds 0");
if (Config.GlobalShare)
GlobalShareConnect();
});
/*
g_hTimerCheckSkinsData = AddTimer(10.0f, () =>
{
List<CCSPlayerController> players = Utilities.GetPlayers();
foreach (CCSPlayerController player in players)
{
if (player.IsBot || player.IsHLTV || player.SteamID.ToString() == "") continue;
if (gPlayerWeaponsInfo.ContainsKey((int)player.Index)) continue;
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Index = (int)player.Index,
SteamId = player?.SteamID.ToString(),
Name = player?.PlayerName,
IpAddress = player?.IpAddress?.Split(":")[0]
};
if (Config.Additional.SkinEnabled && weaponSync != null)
_ = weaponSync.GetWeaponPaintsFromDatabase(playerInfo);
if (Config.Additional.KnifeEnabled && weaponSync != null)
_ = weaponSync.GetKnifeFromDatabase(playerInfo);
}
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE | CounterStrikeSharp.API.Modules.Timers.TimerFlags.REPEAT);
*/
}
private HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventInfo info)
{
CCSPlayerController? player = @event.Userid;
if (player == null || !player.IsValid || player.IsBot || player.IsHLTV || weaponSync == null) return HookResult.Continue;
if (player is null || !player.IsValid || player.IsBot ||
player.IsHLTV || player.SteamID.ToString().Length != 17) return HookResult.Continue;
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Slot = player.Slot,
Index = (int)player.Index,
SteamId = player?.SteamID.ToString(),
Name = player?.PlayerName,
IpAddress = player?.IpAddress?.Split(":")[0]
SteamId = player.SteamID.ToString(),
Name = player.PlayerName,
IpAddress = player.IpAddress?.Split(":")[0]
};
if (!gPlayerWeaponsInfo.ContainsKey((int)player!.Index))
if (Config.Additional.SkinEnabled)
{
Console.WriteLine($"[WeaponPaints] Retrying to retrieve player {player.PlayerName} skins");
Task.Run(async () =>
{
if (Config.Additional.SkinEnabled)
await weaponSync.GetWeaponPaintsFromDatabase(playerInfo);
if (Config.Additional.KnifeEnabled)
await weaponSync.GetKnifeFromDatabase(playerInfo);
});
gPlayerWeaponsInfo.TryRemove(player.Slot, out _);
}
if (Config.Additional.KnifeEnabled)
{
g_playersKnife.TryRemove(player.Slot, out _);
}
if (Config.Additional.GloveEnabled)
{
g_playersGlove.TryRemove(player.Slot, out _);
}
if (Config.Additional.AgentEnabled)
{
g_playersAgent.TryRemove(player.Slot, out _);
}
commandsCooldown.Remove(player.Slot);
return HookResult.Continue;
}
private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon weapon)
{
if (!Config.Additional.SkinEnabled) return;
if (player is null || weapon is null || !weapon.IsValid || !Utility.IsPlayerValid(player)) return;
if (!gPlayerWeaponsInfo.ContainsKey(player.Slot)) return;
bool isKnife = weapon.DesignerName.Contains("knife") || weapon.DesignerName.Contains("bayonet");
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 };
if (isKnife)
{
var newDefIndex = WeaponDefindex.FirstOrDefault(x => x.Value == g_playersKnife[player.Slot]);
if (newDefIndex.Key == 0) return;
if (weapon.AttributeManager.Item.ItemDefinitionIndex != newDefIndex.Key)
{
SubclassChange(weapon, (ushort)newDefIndex.Key);
}
weapon.AttributeManager.Item.ItemDefinitionIndex = (ushort)newDefIndex.Key;
weapon.AttributeManager.Item.EntityQuality = 3;
}
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
int fallbackPaintKit = 0;
if (_config.Additional.GiveRandomSkin &&
!gPlayerWeaponsInfo[player.Slot].ContainsKey(weaponDefIndex))
{
// Random skins
weapon.AttributeManager.Item.ItemID = 16384;
weapon.AttributeManager.Item.ItemIDLow = 16384 & 0xFFFFFFFF;
weapon.AttributeManager.Item.ItemIDHigh = weapon.AttributeManager.Item.ItemIDLow >> 32;
weapon.FallbackPaintKit = GetRandomPaint(weaponDefIndex);
weapon.FallbackSeed = 0;
weapon.FallbackWear = 0.000001f;
CAttributeList_SetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", weapon.FallbackPaintKit);
fallbackPaintKit = weapon.FallbackPaintKit;
if (fallbackPaintKit == 0)
return;
if (!isKnife)
{
if (newPaints.Contains(fallbackPaintKit))
{
UpdatePlayerWeaponMeshGroupMask(player, weapon, false);
}
else
{
UpdatePlayerWeaponMeshGroupMask(player, weapon, true);
}
}
return;
}
if (!gPlayerWeaponsInfo[player.Slot].ContainsKey(weaponDefIndex) || gPlayerWeaponsInfo[player.Slot][weaponDefIndex].Paint == 0) return;
WeaponInfo weaponInfo = gPlayerWeaponsInfo[player.Slot][weaponDefIndex];
//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.FallbackPaintKit = weaponInfo.Paint;
weapon.FallbackSeed = weaponInfo.Seed;
weapon.FallbackWear = weaponInfo.Wear;
CAttributeList_SetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", weapon.FallbackPaintKit);
fallbackPaintKit = weapon.FallbackPaintKit;
if (fallbackPaintKit == 0)
return;
if (!isKnife)
{
if (newPaints.Contains(fallbackPaintKit))
{
UpdatePlayerWeaponMeshGroupMask(player, weapon, false);
}
else
{
UpdatePlayerWeaponMeshGroupMask(player, weapon, true);
}
}
}
private void OnMapStart(string mapName)
{
if (!Config.Additional.KnifeEnabled && !Config.Additional.SkinEnabled && !Config.Additional.GloveEnabled) return;
if (_database != null)
weaponSync = new WeaponSynchronization(_database, Config);
}
private HookResult OnPlayerSpawn(EventPlayerSpawn @event, GameEventInfo info)
{
CCSPlayerController? player = @event.Userid;
if (player == null || !player.IsValid || !Config.Additional.KnifeEnabled || PlayerHasKnife(player))
{
return HookResult.Continue;
}
g_knifePickupCount[(int)player.Index] = 0;
GiveKnifeToPlayer(player);
if (player is null || !player.IsValid || !Config.Additional.KnifeEnabled && !Config.Additional.GloveEnabled)
return HookResult.Continue;
CCSPlayerPawn? pawn = player.PlayerPawn.Value;
if (pawn == null || !pawn.IsValid)
return HookResult.Continue;
g_knifePickupCount[player.Slot] = 0;
GivePlayerAgent(player);
Server.NextFrame(() =>
{
RefreshGloves(player);
});
return HookResult.Continue;
}
@@ -260,112 +216,106 @@ namespace WeaponPaints
private HookResult OnRoundEnd(EventRoundEnd @event, GameEventInfo info)
{
g_bCommandsAllowed = false;
return HookResult.Continue;
}
private HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info)
{
/*
NativeAPI.IssueServerCommand("mp_t_default_melee \"\"");
NativeAPI.IssueServerCommand("mp_ct_default_melee \"\"");
NativeAPI.IssueServerCommand("mp_equipment_reset_rounds 0");
*/
g_bCommandsAllowed = true;
return HookResult.Continue;
}
/*
public HookResult OnGiveNamedItemPost(DynamicHook hook)
{
var itemServices = hook.GetParam<CCSPlayer_ItemServices>(0);
var weapon = hook.GetReturn<CBasePlayerWeapon>(0);
if (!weapon.DesignerName.Contains("weapon"))
return HookResult.Continue;
var player = GetPlayerFromItemServices(itemServices);
if (player != null)
GivePlayerWeaponSkin(player, weapon);
return HookResult.Continue;
}
*/
public void OnEntityCreated(CEntityInstance entity)
{
var designerName = entity.DesignerName;
if (designerName.Contains("weapon"))
{
Server.NextFrame(() =>
{
var weapon = new CBasePlayerWeapon(entity.Handle);
if (weapon == null || !weapon.IsValid || weapon.OwnerEntity.Value == null) return;
SteamID? _steamid = (SteamID)weapon.OriginalOwnerXuidLow;
CCSWeaponBaseGun gun = weapon.As<CCSWeaponBaseGun>();
CCSPlayerController? player = null;
try
{
if (_steamid != null && _steamid.IsValid())
{
player = Utilities.GetPlayers().Where(p => p is not null && p.IsValid && p.SteamID == _steamid.SteamId64).FirstOrDefault();
if (player == null)
player = Utilities.GetPlayerFromSteamId(weapon.OriginalOwnerXuidLow);
}
else
player = Utilities.GetPlayerFromIndex((int)weapon.OwnerEntity.Index) ?? Utilities.GetPlayerFromIndex((int)gun.OwnerEntity.Value!.Index);
if (player == null || string.IsNullOrEmpty(player?.PlayerName)) return;
}
catch (Exception)
{
return;
}
if (player is null || !player.IsValid || !Utility.IsPlayerValid(player)) return;
GivePlayerWeaponSkin(player, weapon);
});
}
}
private void OnTick()
{
foreach (var player in Utilities.GetPlayers())
foreach (var player in Utilities.GetPlayers().Where(p =>
p is not null && p.IsValid && p.PlayerPawn != null && p.PlayerPawn.IsValid &&
(LifeState_t)p.LifeState == LifeState_t.LIFE_ALIVE && p.SteamID.ToString().Length == 17
&& !p.IsBot && !p.IsHLTV && p.Connected == PlayerConnectedState.PlayerConnected
)
)
{
try
if (Config.Additional.ShowSkinImage && PlayerWeaponImage.TryGetValue(player.Slot, out string? value) && !string.IsNullOrEmpty(value))
{
if (player is null || !player.IsValid || !player.PawnIsAlive || player.IsBot || player.IsHLTV || player.Connected != PlayerConnectedState.PlayerConnected)
continue;
var viewModels = GetPlayerViewModels(player);
if (viewModels == null || viewModels.Length == 0)
continue;
var viewModel = viewModels[0];
if (viewModel == null || viewModel.Value == null || viewModel.Value.Weapon == null || viewModel.Value.Weapon.Value == null)
continue;
var weapon = viewModel.Value.Weapon.Value;
if (weapon == null || !weapon.IsValid)
continue;
if (viewModel.Value.VMName.Contains("knife"))
continue;
var sceneNode = viewModel.Value.CBodyComponent?.SceneNode;
if (sceneNode == null)
continue;
var skeleton = GetSkeletonInstance(sceneNode);
if (skeleton == null)
continue;
int[] knifePaintKits = { 1171, 1170, 1169, 1164, 1162, 1161, 1159, 1175, 1174, 1167, 1165, 1168, 1163, 1160, 1166, 1173 };
if (knifePaintKits.Contains(weapon.FallbackPaintKit))
{
skeleton.ModelState.MeshGroupMask = 1;
}
else
{
if (skeleton.ModelState.MeshGroupMask != 2)
{
skeleton.ModelState.MeshGroupMask = 2;
}
}
Utilities.SetStateChanged(viewModel.Value, "CBaseEntity", "m_CBodyComponent");
}
catch (Exception)
{
// Handle exceptions silently
player.PrintToCenterHtml("<img src='{PATH}'</img>".Replace("{PATH}", value));
}
}
}
private void RegisterListeners()
{
RegisterListener<Listeners.OnEntityCreated>(OnEntityCreated);
RegisterListener<Listeners.OnClientPutInServer>(OnClientPutInServer);
RegisterListener<Listeners.OnClientDisconnect>(OnClientDisconnect);
RegisterListener<Listeners.OnMapStart>(OnMapStart);
RegisterListener<Listeners.OnTick>(OnTick);
//RegisterEventHandler<EventPlayerConnectFull>(OnPlayerConnectFull);
RegisterEventHandler<EventPlayerSpawn>(OnPlayerSpawn);
RegisterEventHandler<EventRoundStart>(OnRoundStart, HookMode.Pre);
RegisterEventHandler<EventRoundEnd>(OnRoundEnd);
//RegisterEventHandler<EventItemPurchase>(OnEventItemPurchasePost);
//RegisterEventHandler<EventItemPickup>(OnItemPickup);
HookEntityOutput("weapon_knife", "OnPlayerPickup", OnPickup, HookMode.Pre);
RegisterListener<Listeners.OnEntityCreated>(OnEntityCreated);
RegisterListener<Listeners.OnTick>(OnTick);
//VirtualFunctions.GiveNamedItemFunc.Hook(OnGiveNamedItemPost, HookMode.Post);
}
/* WORKAROUND FOR CLIENTS WITHOUT STEAMID ON AUTHORIZATION */
/*private HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventInfo info)
{
CCSPlayerController? player = @event.Userid;
if (player == null || !player.IsValid || !player.EntityIndex.HasValue || player.IsHLTV) return HookResult.Continue;
int playerIndex = (int)player.EntityIndex.Value.Value;
if (Config.Additional.SkinEnabled && weaponSync != null)
_ = weaponSync.GetWeaponPaintsFromDatabase(playerIndex);
if (Config.Additional.KnifeEnabled && weaponSync != null)
_ = weaponSync.GetKnifeFromDatabase(playerIndex);
Task.Run(async () =>
{
if (Config.Additional.SkinEnabled && weaponSync != null)
if (Config.Additional.KnifeEnabled && weaponSync != null)
});
return HookResult.Continue;
}
*/
}
}

View File

@@ -3,6 +3,7 @@
public class PlayerInfo
{
public int Index { get; set; }
public int Slot { get; set; }
public int? UserId { get; set; }
public string? SteamId { get; set; }
public string? Name { get; set; }

View File

@@ -9,22 +9,21 @@ Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E2G0P2O) or [![Donate on Steam](https://github.com/Nereziel/cs2-WeaponPaints/assets/32937653/a0d53822-4ca7-4caf-83b4-e1a9b5f8c94e)](https://steamcommunity.com/tradeoffer/new/?partner=41515647&token=gW2W-nXE)
## Features
- Changes only paint, seed and wear on weapons and knives
- MySQL based or global website, so you dont need MySQL/Website
- Changes only paint, seed and wear on weapons, knives, gloves and agents
- MySQL based
- Data syncs on player connect
- Added command **`!wp`** to refresh skins ***(with cooldown in seconds can be configured)***
- Added command **`!ws`** to show website
- Added command **`!knife`** to show menu with knives
- Knife change is now limited to have these cvars empty **`mp_t_default_melee ""`** and **`mp_ct_default_melee ""`**
- Added command **`!gloves`** to show menu with gloves
- Added command **`!agents`** to show menu with agents
- Translations support, submit a PR if you want to share your translation
**GlobalShare** - global website accessible at [weaponpaints.fun](https://weaponpaints.fun/)
## CS2 Server
- Have working CounterStrikeSharp (**with RUNTIME!**)
- Download from Release and copy plugin to plugins
- Run server with plugin, **it will generate config if installed correctly!**
- Edit `addons/counterstrikesharp/configs/`**`plugins/WeaponPaints/WeaponPaints.json`** set **`GlobalShare`** to **`true`** for global, or include database credentials
- Edit `addons/counterstrikesharp/configs/`**`plugins/WeaponPaints/WeaponPaints.json`** include database credentials
- In `addons/counterstrikesharp/configs/`**`core.json`** set **FollowCS2ServerGuidelines** to **`false`**
## Plugin Configuration
@@ -32,12 +31,11 @@ Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin
<summary>Click to expand</summary>
<code><pre>{
"Version": 4, // Don't touch
"DatabaseHost": "", // MySQL host (required if GlobalShare = false)
"DatabasePort": 3306, // MySQL port (required if GlobalShare = false)
"DatabaseUser": "", // MySQL username (required if GlobalShare = false)
"DatabasePassword": "", // MySQL user password (required if GlobalShare = false)
"DatabaseName": "", // MySQL database name (required if GlobalShare = false)
"GlobalShare": false, // Enable or disable GlobalShare, plugin can work without mysql credentials but with shared website at weaponpaints.fun
"DatabaseHost": "", // MySQL host
"DatabasePort": 3306, // MySQL port
"DatabaseUser": "", // MySQL username
"DatabasePassword": "", // MySQL user password
"DatabaseName": "", // MySQL database name
"CmdRefreshCooldownSeconds": 60, // Cooldown time in refreshing skins (!wp command)
"Prefix": "[WeaponPaints]", // Prefix every chat message
"Website": "example.com/skins", // Website used in WebsiteMessageCommand (!ws command)
@@ -55,7 +53,6 @@ Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin
"SkinMenuTitle": "Select skin for {WEAPON}" // Menu title (!skins menu, after weapon select)
},
"Additional": {
"SkinVisibilityFix": true, // Enable or disable fix for skin visibility
"KnifeEnabled": true, // Enable or disable knife feature
"SkinEnabled": true, // Enable or disable skin feature
"CommandWpEnabled": true, // Enable or disable refreshing command
@@ -74,7 +71,6 @@ Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin
</details>
## Web install
Disregard if the config is **`GlobalShare = true`**
- Requires PHP >= 7.4 ***(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)***
@@ -87,11 +83,6 @@ Disregard if the config is **`GlobalShare = true`**
- Steam login/logout
- Change knife, paint, seed and wear
## Known issues
- Issue on Windows servers, no knives are given.
- You can't change knife if it's equpied in cs2 inventory
- Can cause incompatibility with plugins/maps which manipulates weapons and knives
## Troubleshooting
<details>
**Skins are not changing:**
@@ -100,11 +91,6 @@ Set FollowCSGOGuidelines to false in cssharps core.jcon config
**Database error table does not exists:**
Plugin is not loaded or configured with mysql credentials. Tables are auto-created by plugin.
**Knives are disappearing:**
Set in config GiveKnifeAfterRemove to true
**Knives are not changing for players:**
You can't change knife if you have your own equipped
</details>
### Use this plugin at your own risk! Using this may lead to GSLT ban or something else Valve come with. [Valve Server guidelines](https://blog.counter-strike.net/index.php/server_guidelines/)

24
SchemaString.cs Normal file
View File

@@ -0,0 +1,24 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Modules.Memory;
using System.Runtime.CompilerServices;
using System.Text;
namespace WeaponPaints;
public class SchemaString<TSchemaClass> : NativeObject where TSchemaClass : NativeObject
{
internal SchemaString(TSchemaClass instance, string member) : base(Schema.GetSchemaValue<nint>(instance.Handle, typeof(TSchemaClass).Name!, member))
{ }
internal unsafe void Set(string str)
{
var bytes = Encoding.UTF8.GetBytes(str);
for (var i = 0; i < bytes.Length; i++)
{
Unsafe.Write((void*)(Handle.ToInt64() + i), bytes[i]);
}
Unsafe.Write((void*)(Handle.ToInt64() + bytes.Length), 0);
}
}

View File

@@ -44,17 +44,28 @@ namespace WeaponPaints
string[] createTableQueries = new[]
{
@"CREATE TABLE IF NOT EXISTS `wp_player_skins` (
`steamid` varchar(64) NOT NULL,
`steamid` varchar(18) NOT NULL,
`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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci",
) ENGINE=InnoDB",
@"CREATE TABLE IF NOT EXISTS `wp_player_knife` (
`steamid` varchar(64) NOT NULL,
`steamid` varchar(18) NOT NULL,
`knife` varchar(64) NOT NULL,
UNIQUE (`steamid`)
) ENGINE = InnoDB"
) ENGINE = InnoDB",
@"CREATE TABLE IF NOT EXISTS `wp_player_gloves` (
`steamid` varchar(18) NOT NULL,
`weapon_defindex` int(11) NOT NULL,
UNIQUE (`steamid`)
) ENGINE=InnoDB",
@"CREATE TABLE `wp_player_agents` (
`steamid` varchar(18) NOT NULL,
`agent_ct` varchar(64) DEFAULT NULL,
`agent_t` varchar(64) DEFAULT NULL,
UNIQUE KEY `steamid` (`steamid`)
) ENGINE=InnoDB"
};
foreach (var query in createTableQueries)
@@ -78,10 +89,9 @@ namespace WeaponPaints
internal static bool IsPlayerValid(CCSPlayerController? player)
{
if (player is null) return false;
if (player is null || WeaponPaints.weaponSync is null) return false;
return (player is not null && player.IsValid && !player.IsBot && !player.IsHLTV
&& WeaponPaints.weaponSync != null && player.Connected == PlayerConnectedState.PlayerConnected);
return (player.IsValid && !player.IsBot && !player.IsHLTV && player.UserId.HasValue);
}
internal static void LoadSkinsFromFile(string filePath)
@@ -98,6 +108,34 @@ namespace WeaponPaints
}
}
internal static void LoadGlovesFromFile(string filePath)
{
try
{
string json = File.ReadAllText(filePath);
var deserializedSkins = JsonConvert.DeserializeObject<List<JObject>>(json);
WeaponPaints.glovesList = deserializedSkins ?? new List<JObject>();
}
catch (FileNotFoundException)
{
throw;
}
}
internal static void LoadAgentsFromFile(string filePath)
{
try
{
string json = File.ReadAllText(filePath);
var deserializedSkins = JsonConvert.DeserializeObject<List<JObject>>(json);
WeaponPaints.agentsList = deserializedSkins ?? new List<JObject>();
}
catch (FileNotFoundException)
{
throw;
}
}
internal static void Log(string message)
{
Console.BackgroundColor = ConsoleColor.DarkGray;
@@ -187,26 +225,5 @@ namespace WeaponPaints
Console.WriteLine(" >> GitHub: https://github.com/Nereziel/cs2-WeaponPaints");
Console.WriteLine(" ");
}
/*(
internal static void TestDatabaseConnection()
{
try
{
using var connection = new MySqlConnection(BuildDatabaseConnectionString());
connection.Open();
if (connection.State != System.Data.ConnectionState.Open)
{
throw new Exception("[WeaponPaints] Unable connect to database!");
}
}
catch (Exception ex)
{
throw new Exception("[WeaponPaints] Unknown mysql exception! " + ex.Message);
}
CheckDatabaseTables();
}
*/
}
}

View File

@@ -1 +1 @@
1.6a
2.2e

View File

@@ -1,6 +1,8 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Entities.Constants;
using CounterStrikeSharp.API.Modules.Memory;
using CounterStrikeSharp.API.Modules.Timers;
using CounterStrikeSharp.API.Modules.Utils;
using Microsoft.Extensions.Logging;
using System.Runtime.InteropServices;
@@ -9,124 +11,26 @@ namespace WeaponPaints
{
public partial class WeaponPaints
{
internal static void ChangeWeaponAttributes(CBasePlayerWeapon? weapon, CCSPlayerController? player, bool isKnife = false)
{
if (player is null || weapon is null || !weapon.IsValid || !Utility.IsPlayerValid(player)) return;
int playerIndex = (int)player.Index;
if (!gPlayerWeaponsInfo.ContainsKey(playerIndex)) return;
if (isKnife && !g_playersKnife.ContainsKey(playerIndex) || isKnife && g_playersKnife[playerIndex] == "weapon_knife") return;
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
if (isKnife)
{
weapon.AttributeManager.Item.EntityQuality = 3;
}
if (_config.Additional.GiveRandomSkin &&
!gPlayerWeaponsInfo[playerIndex].ContainsKey(weaponDefIndex))
{
// Random skins
weapon.AttributeManager.Item.ItemID = 16384;
weapon.AttributeManager.Item.ItemIDLow = 16384 & 0xFFFFFFFF;
weapon.AttributeManager.Item.ItemIDHigh = weapon.AttributeManager.Item.ItemIDLow >> 32;
weapon.FallbackPaintKit = GetRandomPaint(weaponDefIndex);
weapon.FallbackSeed = 0;
weapon.FallbackWear = 0.000001f;
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
int[] array = { 1171, 1170, 1169, 1164, 1162, 1161, 1159, 1175, 1174, 1167, 1165, 1168, 1163, 1160, 1166, 1173 };
int fallbackPaintKit = weapon.FallbackPaintKit;
if (array.Contains(fallbackPaintKit))
{
skeleton.ModelState.MeshGroupMask = 1;
}
else
{
if (skeleton.ModelState.MeshGroupMask != 2)
{
skeleton.ModelState.MeshGroupMask = 2;
}
}
}
return;
}
if (!gPlayerWeaponsInfo[playerIndex].ContainsKey(weaponDefIndex)) return;
WeaponInfo weaponInfo = gPlayerWeaponsInfo[playerIndex][weaponDefIndex];
//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.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);
int[] array = { 1171, 1170, 1169, 1164, 1162, 1161, 1159, 1175, 1174, 1167, 1165, 1168, 1163, 1160, 1166, 1173 };
int fallbackPaintKit = weapon.FallbackPaintKit;
if (array.Contains(fallbackPaintKit))
{
skeleton.ModelState.MeshGroupMask = 1;
}
else
{
if (skeleton.ModelState.MeshGroupMask != 2)
{
skeleton.ModelState.MeshGroupMask = 2;
}
}
}
}
internal static void GiveKnifeToPlayer(CCSPlayerController? player)
{
if (!_config.Additional.KnifeEnabled || player == null || !player.IsValid) return;
string knifeToGive;
if (g_playersKnife.TryGetValue((int)player.Index, out var knife))
{
knifeToGive = knife;
}
else if (_config.Additional.GiveRandomKnife)
{
var knifeTypes = weaponList.Where(pair => pair.Key.StartsWith("weapon_knife") || pair.Key.StartsWith("weapon_bayonet")).ToList();
if (PlayerHasKnife(player)) return;
if (knifeTypes.Count == 0)
{
Utility.Log("No valid knife types found.");
return;
}
Random random = new();
int index = random.Next(knifeTypes.Count);
knifeToGive = knifeTypes[index].Key;
}
else
{
knifeToGive = (CsTeam)player.TeamNum == CsTeam.Terrorist ? "weapon_knife_t" : "weapon_knife";
}
player.GiveNamedItem(knifeToGive);
string knifeToGive = (CsTeam)player.TeamNum == CsTeam.Terrorist ? "weapon_knife_t" : "weapon_knife";
player.GiveNamedItem(CsItem.Knife);
}
internal static bool PlayerHasKnife(CCSPlayerController? player)
{
if (!_config.Additional.KnifeEnabled) return false;
if (player == null || !player.IsValid || player.PlayerPawn == null || !player.PlayerPawn.IsValid || !player.PawnIsAlive)
if (player == null || !player.IsValid || player.PlayerPawn == null || !player.PlayerPawn.IsValid)
{
return false;
}
if (player.PlayerPawn?.Value == null || player.PlayerPawn?.Value.WeaponServices == null || player.PlayerPawn?.Value.ItemServices == null)
if (player.PlayerPawn.Value == null || player.PlayerPawn.Value.WeaponServices == null || player.PlayerPawn.Value.ItemServices == null)
return false;
var weapons = player.PlayerPawn.Value.WeaponServices?.MyWeapons;
@@ -144,232 +48,193 @@ namespace WeaponPaints
return false;
}
/*
internal void RefreshPlayerKnife(CCSPlayerController? player)
{
return;
if (player == null || !player.IsValid || player.PlayerPawn.Value == null || !player.PawnIsAlive) return;
if (player.PlayerPawn.Value.WeaponServices == null || player.PlayerPawn.Value.ItemServices == null) return;
var weapons = player.PlayerPawn.Value.WeaponServices.MyWeapons;
if (weapons != null && weapons.Count > 0)
{
CCSPlayer_ItemServices service = new(player.PlayerPawn.Value.ItemServices.Handle);
//var dropWeapon = VirtualFunction.CreateVoid<nint, nint>(service.Handle, GameData.GetOffset("CCSPlayer_ItemServices_DropActivePlayerWeapon"));
foreach (var weapon in weapons)
{
if (weapon != null && weapon.IsValid && weapon.Value != null && weapon.Value.IsValid)
{
//if (weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 42 || weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 59)
if (weapon.Value.DesignerName.Contains("knife") || weapon.Value.DesignerName.Contains("bayonet"))
{
if (weapon.Index <= 0) return;
int weaponEntityIndex = (int)weapon.Index;
NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3");
AddTimer(0.22f, () =>
{
if (player.PlayerPawn.Value.WeaponServices.ActiveWeapon.Value!.DesignerName.Contains("knife")
||
player.PlayerPawn.Value.WeaponServices.ActiveWeapon.Value!.DesignerName.Contains("bayonet")
)
{
if (player.PawnIsAlive)
{
NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3");
service.DropActivePlayerWeapon(weapon.Value);
GiveKnifeToPlayer(player);
}
}
});
Task.Delay(TimeSpan.FromSeconds(3.5)).ContinueWith(_ =>
{
try
{
CEntityInstance? knife = Utilities.GetEntityFromIndex<CEntityInstance>(weaponEntityIndex);
if (knife != null && knife.IsValid && knife.Handle != -1 && knife.Index > 0)
{
knife.Remove();
}
}
catch (Exception) { }
});
break;
}
}
}
}
}
*/
/*
internal void RefreshSkins(CCSPlayerController? player)
{
return;
if (!Utility.IsPlayerValid(player) || !player!.PawnIsAlive) return;
AddTimer(0.18f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3"));
AddTimer(0.25f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot2"));
AddTimer(0.38f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot1"));
}
*/
internal void RefreshWeapons(CCSPlayerController? player)
{
if (!g_bCommandsAllowed) return;
if (player == null || !player.IsValid || player.PlayerPawn?.Value == null || (LifeState_t)player.LifeState != LifeState_t.LIFE_ALIVE)
return;
if (player.PlayerPawn.Value.WeaponServices == null || player.PlayerPawn.Value.ItemServices == null)
return;
var weapons = player.PlayerPawn.Value.WeaponServices.MyWeapons;
if (weapons == null || weapons.Count == 0)
return;
if (player.Team == CsTeam.None || player.Team == CsTeam.Spectator)
return;
// Dictionary to store weapons and their ammo
int playerTeam = player.TeamNum;
Dictionary<string, List<(int, int)>> weaponsWithAmmo = new Dictionary<string, List<(int, int)>>();
if (weapons != null && weapons.Count > 0)
foreach (var weapon in weapons)
{
//Dictionary<string, (int, int)> weaponsWithAmmo = new Dictionary<string, (int, int)>();
Dictionary<string, List<(int, int)>> weaponsWithAmmo = new Dictionary<string, List<(int, int)>>();
bool bomb = false;
bool defuser = player.PawnHasDefuser;
bool healthshot = false;
if (weapon == null || !weapon.IsValid || weapon.Value == null ||
!weapon.Value.IsValid || !weapon.Value.DesignerName.Contains("weapon_"))
continue;
// Iterate through each weapon
foreach (var weapon in weapons)
CCSWeaponBaseGun gun = weapon.Value.As<CCSWeaponBaseGun>();
if (weapon.Value.Entity == null) continue;
if (weapon.Value.OwnerEntity == null) continue;
if (!weapon.Value.OwnerEntity.IsValid) continue;
if (gun == null) continue;
if (gun.Entity == null) continue;
if (!gun.IsValid) continue;
if (!gun.VisibleinPVS) continue;
try
{
if (weapon == null || !weapon.IsValid || weapon.Value == null ||
!weapon.Value.IsValid || !weapon.Value.DesignerName.Contains("weapon_"))
continue;
string? weaponByDefindex = null;
try
CCSWeaponBaseVData? weaponData = weapon.Value.As<CCSWeaponBase>().VData;
if (weaponData == null) continue;
if (weaponData.GearSlot == gear_slot_t.GEAR_SLOT_RIFLE || weaponData.GearSlot == gear_slot_t.GEAR_SLOT_PISTOL)
{
string? weaponByDefindex = null;
if (!WeaponDefindex.TryGetValue(weapon.Value.AttributeManager.Item.ItemDefinitionIndex, out weaponByDefindex))
continue;
CCSWeaponBaseVData? weaponData = weapon.Value.As<CCSWeaponBase>().VData;
int clip1 = weapon.Value.Clip1;
int reservedAmmo = weapon.Value.ReserveAmmo[0];
if (weaponData != null)
if (!weaponsWithAmmo.ContainsKey(weaponByDefindex))
{
if (weaponData.GearSlot == gear_slot_t.GEAR_SLOT_C4)
bomb = true;
if (weaponData.Name.Equals("weapon_healtshot"))
healthshot = true;
if (weaponData.GearSlot == gear_slot_t.GEAR_SLOT_GRENADES || weaponData.GearSlot == gear_slot_t.GEAR_SLOT_UTILITY || weaponData.GearSlot == gear_slot_t.GEAR_SLOT_BOOSTS)
{
int clip1 = weapon.Value.Clip1;
int reservedAmmo = weapon.Value.ReserveAmmo[0];
weaponsWithAmmo.Add(weapon.Value.DesignerName, new List<(int, int)>() { (clip1, reservedAmmo) });
}
weaponsWithAmmo.Add(weaponByDefindex, new List<(int, int)>());
}
if (!weapon.Value.DesignerName.Contains("knife") && weaponDefindex.TryGetValue(weapon.Value.AttributeManager.Item.ItemDefinitionIndex, out weaponByDefindex) && weaponByDefindex != null)
{
int clip1 = weapon.Value.Clip1;
int reservedAmmo = weapon.Value.ReserveAmmo[0];
weaponsWithAmmo[weaponByDefindex].Add((clip1, reservedAmmo));
if (!weaponsWithAmmo.ContainsKey(weaponByDefindex))
{
weaponsWithAmmo.Add(weaponByDefindex, new List<(int, int)>());
}
if (gun == null || gun.VData == null) return;
weaponsWithAmmo[weaponByDefindex].Add((clip1, reservedAmmo));
}
}
catch (Exception ex)
{
Logger.LogWarning(ex.Message);
continue;
weapon.Value.Remove();
}
}
player.RemoveWeapons();
AddTimer(0.2f, () =>
catch (Exception ex)
{
if (bomb)
player.GiveNamedItem("weapon_c4");
if (defuser)
{
var itemServ = player.PlayerPawn?.Value?.ItemServices;
if (itemServ != null)
{
var items = new CCSPlayer_ItemServices(itemServ.Handle);
items.HasDefuser = true;
}
}
if (healthshot)
player.GiveNamedItem("weapon_healtshot");
GiveKnifeToPlayer(player);
foreach (var entry in weaponsWithAmmo)
{
foreach (var ammo in entry.Value)
{
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(entry.Key));
Server.NextFrame(() =>
{
try
{
if (newWeapon != null)
{
newWeapon.Clip1 = ammo.Item1;
newWeapon.ReserveAmmo[0] = ammo.Item2;
}
}
catch (Exception ex)
{
Logger.LogWarning("Error setting weapon properties: " + ex.Message);
}
});
}
}
});
Logger.LogWarning(ex.Message);
continue;
}
}
try
{
player.ExecuteClientCommand("slot 3");
player.ExecuteClientCommand("slot 3");
var weapon = player.PlayerPawn.Value.WeaponServices.ActiveWeapon;
if (weapon is null || !weapon.IsValid || weapon.Value == null) return;
CCSWeaponBaseVData? weaponData = weapon.Value.As<CCSWeaponBase>().VData;
if (weapon.Value.DesignerName.Contains("knife") || weaponData?.GearSlot == gear_slot_t.GEAR_SLOT_KNIFE)
{
CCSWeaponBaseGun gun = weapon.Value.As<CCSWeaponBaseGun>();
AddTimer(0.3f, () =>
{
if (player.TeamNum != playerTeam) return;
player.ExecuteClientCommand("slot 3");
gun = weapon.Value.As<CCSWeaponBaseGun>();
player.DropActiveWeapon();
AddTimer(0.7f, () =>
{
if (player.TeamNum != playerTeam) return;
if (gun == null || !gun.IsValid || gun.State != CSWeaponState_t.WEAPON_NOT_CARRIED) return;
gun.Remove();
});
GiveKnifeToPlayer(player);
});
}
}
catch (Exception ex)
{
Logger.LogWarning($"Cannot remove knife: {ex.Message}");
}
AddTimer(0.6f, () =>
{
if (!g_bCommandsAllowed) return;
foreach (var entry in weaponsWithAmmo)
{
foreach (var ammo in entry.Value)
{
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(entry.Key));
Server.NextFrame(() =>
{
try
{
if (newWeapon != null)
{
newWeapon.Clip1 = ammo.Item1;
newWeapon.ReserveAmmo[0] = ammo.Item2;
}
}
catch (Exception ex)
{
Logger.LogWarning("Error setting weapon properties: " + ex.Message);
}
});
}
}
}, TimerFlags.STOP_ON_MAPCHANGE);
}
internal void RefreshKnife(CCSPlayerController? player, bool force = false)
private static void RefreshGloves(CCSPlayerController player)
{
if (player == null || !player.IsValid || player.PlayerPawn?.Value == null || (LifeState_t)player.LifeState != LifeState_t.LIFE_ALIVE)
if (!Utility.IsPlayerValid(player) || (LifeState_t)player.LifeState != LifeState_t.LIFE_ALIVE) return;
CCSPlayerPawn? pawn = player.PlayerPawn.Value;
if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE)
return;
if (player.PlayerPawn.Value.WeaponServices == null || player.PlayerPawn.Value.ItemServices == null)
return;
var weapons = player.PlayerPawn.Value.WeaponServices.MyWeapons;
if (weapons != null && weapons.Count > 0)
string model = pawn.CBodyComponent?.SceneNode?.GetSkeletonInstance()?.ModelState.ModelName ?? string.Empty;
if (!string.IsNullOrEmpty(model))
{
foreach (var weapon in weapons)
{
if (weapon != null && weapon.IsValid && weapon.Value != null && weapon.Value.IsValid && weapon.Index > 0)
{
try
{
CCSWeaponBaseVData? weaponData = weapon.Value.As<CCSWeaponBase>().VData;
pawn.SetModel("characters/models/tm_jumpsuit/tm_jumpsuit_varianta.vmdl");
pawn.SetModel(model);
}
if (weapon.Value.DesignerName.Contains("knife") || weaponData?.GearSlot == gear_slot_t.GEAR_SLOT_KNIFE)
{
player.RemoveItemByDesignerName(weapon.Value.DesignerName, weapon.Value.Entity?.EntityInstance.IsValid ?? false);
AddTimer(0.2f, () => GiveKnifeToPlayer(player));
break;
}
}
catch (Exception ex)
{
Logger.LogWarning($"Cannot remove knife: {ex.Message}");
}
Instance.AddTimer(0.06f, () =>
{
try
{
if (player == null || !player.IsValid)
return;
if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE)
return;
if (g_playersGlove.TryGetValue(player.Slot, out var gloveInfo) && gloveInfo != 0)
{
CCSPlayerPawn? pawn = player.PlayerPawn.Value;
if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE)
return;
WeaponInfo weaponInfo = gPlayerWeaponsInfo[player.Slot][gloveInfo];
CEconItemView item = pawn.EconGloves;
item.ItemDefinitionIndex = gloveInfo;
item.ItemIDLow = 16384 & 0xFFFFFFFF;
item.ItemIDHigh = 16384;
CAttributeList_SetOrAddAttributeValueByName.Invoke(item.NetworkedDynamicAttributes.Handle, "set item texture prefab", weaponInfo.Paint);
CAttributeList_SetOrAddAttributeValueByName.Invoke(item.NetworkedDynamicAttributes.Handle, "set item texture seed", weaponInfo.Seed);
CAttributeList_SetOrAddAttributeValueByName.Invoke(item.NetworkedDynamicAttributes.Handle, "set item texture wear", weaponInfo.Wear);
item.Initialized = true;
CBaseModelEntity_SetBodygroup.Invoke(pawn, "default_gloves", 1);
}
}
}
catch (Exception) { }
}, TimerFlags.STOP_ON_MAPCHANGE);
}
private static int GetRandomPaint(int defindex)
@@ -393,23 +258,92 @@ namespace WeaponPaints
return 0;
}
private static CSkeletonInstance GetSkeletonInstance(CGameSceneNode node)
public static void SubclassChange(CBasePlayerWeapon weapon, ushort itemD)
{
Func<nint, nint> GetSkeletonInstance = VirtualFunction.Create<nint, nint>(node.Handle, 8);
return new CSkeletonInstance(GetSkeletonInstance(node.Handle));
var SubclassChangeFunc = VirtualFunction.Create<nint, string, int>(
GameData.GetSignature("ChangeSubclass")
);
SubclassChangeFunc(weapon.Handle, itemD.ToString());
}
private static unsafe CHandle<CBaseViewModel>[]? GetPlayerViewModels(CCSPlayerController player)
public static void UpdateWeaponMeshGroupMask(CBaseEntity weapon, bool isLegacy = false)
{
if (weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
{
var skeleton = weapon.CBodyComponent.SceneNode.GetSkeletonInstance();
if (skeleton != null)
{
var value = (ulong)(isLegacy ? 2 : 1);
if (skeleton.ModelState.MeshGroupMask != value)
{
skeleton.ModelState.MeshGroupMask = value;
}
}
}
}
public static void UpdatePlayerWeaponMeshGroupMask(CCSPlayerController player, CBasePlayerWeapon weapon, bool isLegacy)
{
UpdateWeaponMeshGroupMask(weapon, isLegacy);
var viewModel = GetPlayerViewModel(player);
if (viewModel != null && viewModel.Weapon.Value != null && viewModel.Weapon.Value.Index == weapon.Index)
{
UpdateWeaponMeshGroupMask(viewModel, isLegacy);
Utilities.SetStateChanged(viewModel, "CBaseEntity", "m_CBodyComponent");
}
}
public static void GivePlayerAgent(CCSPlayerController player)
{
if (!g_playersAgent.ContainsKey(player.Slot)) return;
string? model = player.TeamNum == 3 ? g_playersAgent[player.Slot].CT : g_playersAgent[player.Slot].T;
if (string.IsNullOrEmpty(model)) return;
if (player.PlayerPawn.Value == null)
return;
try
{
Server.NextFrame(() =>
{
player.PlayerPawn.Value.SetModel(
$"characters/models/{model}.vmdl"
);
});
}
catch (Exception)
{
}
}
public static CCSPlayerController? GetPlayerFromItemServices(CCSPlayer_ItemServices itemServices)
{
var pawn = itemServices.Pawn.Value;
if (pawn == null || !pawn.IsValid || !pawn.Controller.IsValid || pawn.Controller.Value == null) return null;
var player = new CCSPlayerController(pawn.Controller.Value.Handle);
if (!Utility.IsPlayerValid(player)) return null;
return player;
}
private static unsafe CBaseViewModel? GetPlayerViewModel(CCSPlayerController player)
{
if (player.PlayerPawn.Value == null || player.PlayerPawn.Value.ViewModelServices == null) return null;
CCSPlayer_ViewModelServices viewModelServices = new CCSPlayer_ViewModelServices(player.PlayerPawn.Value.ViewModelServices!.Handle);
return GetFixedArray<CHandle<CBaseViewModel>>(viewModelServices.Handle, "CCSPlayer_ViewModelServices", "m_hViewModel", 3);
CCSPlayer_ViewModelServices viewModelServices = new(player.PlayerPawn.Value.ViewModelServices!.Handle);
nint ptr = viewModelServices.Handle + Schema.GetSchemaOffset("CCSPlayer_ViewModelServices", "m_hViewModel");
var references = MemoryMarshal.CreateSpan(ref ptr, 3);
var viewModel = (CHandle<CBaseViewModel>)Activator.CreateInstance(typeof(CHandle<CBaseViewModel>), references[0])!;
if (viewModel == null || viewModel.Value == null) return null;
return viewModel.Value;
}
public static unsafe T[] GetFixedArray<T>(nint pointer, string @class, string member, int length) where T : CHandle<CBaseViewModel>
{
nint ptr = pointer + Schema.GetSchemaOffset(@class, member);
Span<nint> references = MemoryMarshal.CreateSpan<nint>(ref ptr, length);
Span<nint> references = MemoryMarshal.CreateSpan(ref ptr, length);
T[] values = new T[length];
for (int i = 0; i < length; i++)
@@ -419,6 +353,5 @@ namespace WeaponPaints
return values;
}
}
}

View File

@@ -3,7 +3,7 @@
public class WeaponInfo
{
public int Paint { get; set; }
public int Seed { get; set; }
public float Wear { get; set; }
public int Seed { get; set; } = 0;
public float Wear { get; set; } = 0f;
}
}

View File

@@ -1,7 +1,7 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Core.Attributes;
using CounterStrikeSharp.API.Modules.Cvars;
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using MySqlConnector;
@@ -10,9 +10,11 @@ using System.Collections.Concurrent;
namespace WeaponPaints;
[MinimumApiVersion(163)]
[MinimumApiVersion(191)]
public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
{
internal static WeaponPaints Instance { get; private set; } = new();
internal static readonly Dictionary<string, string> weaponList = new()
{
{"weapon_deagle", "Desert Eagle"},
@@ -77,18 +79,23 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
internal static IStringLocalizer? _localizer;
internal static Dictionary<int, int> g_knifePickupCount = new Dictionary<int, int>();
internal static ConcurrentDictionary<int, string> g_playersKnife = new ConcurrentDictionary<int, string>();
internal static ConcurrentDictionary<int, ushort> g_playersGlove = new ConcurrentDictionary<int, ushort>();
internal static ConcurrentDictionary<int, (string? CT, string? T)> g_playersAgent = new ConcurrentDictionary<int, (string?, string?)>();
internal static ConcurrentDictionary<int, ConcurrentDictionary<int, WeaponInfo>> gPlayerWeaponsInfo = new ConcurrentDictionary<int, ConcurrentDictionary<int, WeaponInfo>>();
internal static List<JObject> skinsList = new List<JObject>();
internal static List<JObject> glovesList = new List<JObject>();
internal static List<JObject> agentsList = new List<JObject>();
internal static WeaponSynchronization? weaponSync;
internal bool g_bCommandsAllowed = true;
public static bool g_bCommandsAllowed = true;
internal Dictionary<int, string> PlayerWeaponImage = new();
internal Uri GlobalShareApi = new("https://weaponpaints.fun/api.php");
internal int GlobalShareServerId = 0;
internal static Dictionary<int, DateTime> commandsCooldown = new Dictionary<int, DateTime>();
internal static Database? _database;
//private CounterStrikeSharp.API.Modules.Timers.Timer? g_hTimerCheckSkinsData = null;
public static Dictionary<int, string> weaponDefindex { get; } = new Dictionary<int, string>
internal static MemoryFunctionVoid<nint, string, float> CAttributeList_SetOrAddAttributeValueByName = new(GameData.GetSignature("CAttributeList_SetOrAddAttributeValueByName"));
internal static MemoryFunctionVoid<CBaseModelEntity, string, UInt64> CBaseModelEntity_SetBodygroup = new(GameData.GetSignature("CBaseModelEntity_SetBodygroup"));
public static Dictionary<int, string> WeaponDefindex { get; } = new Dictionary<int, string>
{
{ 1, "weapon_deagle" },
{ 2, "weapon_elite" },
@@ -149,9 +156,9 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
public WeaponPaintsConfig Config { get; set; } = new();
public override string ModuleAuthor => "Nereziel & daffyy";
public override string ModuleDescription => "Skin and knife selector, standalone and web-based";
public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based";
public override string ModuleName => "WeaponPaints";
public override string ModuleVersion => "1.6b";
public override string ModuleVersion => "2.2e";
public static WeaponPaintsConfig GetWeaponPaintsConfig()
{
@@ -160,22 +167,28 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
public override void Load(bool hotReload)
{
if (hotReload && weaponSync != null)
Instance = this;
if (hotReload)
{
OnMapStart(string.Empty);
foreach (var player in Utilities.GetPlayers())
{
if (weaponSync == null || player is null || !player.IsValid || !player.PawnIsAlive || player.IsBot || player.IsHLTV || player.Connected != PlayerConnectedState.PlayerConnected)
if (weaponSync == null || player is null || !player.IsValid || player.SteamID.ToString().Length != 17 || player.IsBot ||
player.IsHLTV || player.Connected != PlayerConnectedState.PlayerConnected)
continue;
g_knifePickupCount[(int)player.Index] = 0;
gPlayerWeaponsInfo.TryRemove((int)player.Index, out _);
g_playersKnife.TryRemove((int)player.Index, out _);
g_knifePickupCount[player.Slot] = 0;
gPlayerWeaponsInfo.TryRemove(player.Slot, out _);
g_playersKnife.TryRemove(player.Slot, out _);
g_playersGlove.TryRemove(player.Slot, out _);
g_playersAgent.TryRemove(player.Slot, out _);
PlayerInfo playerInfo = new PlayerInfo
{
UserId = player.UserId,
Slot = player.Slot,
Index = (int)player.Index,
SteamId = player?.SteamID.ToString(),
Name = player?.PlayerName,
@@ -183,52 +196,63 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
};
if (Config.Additional.SkinEnabled)
_ = weaponSync.GetWeaponPaintsFromDatabase(playerInfo);
{
_ = Task.Run(async () => await weaponSync.GetWeaponPaintsFromDatabase(playerInfo));
}
if (Config.Additional.KnifeEnabled)
_ = weaponSync.GetKnifeFromDatabase(playerInfo);
{
_ = Task.Run(async () => await weaponSync.GetKnifeFromDatabase(playerInfo));
}
if (Config.Additional.GloveEnabled)
{
_ = Task.Run(async () => await weaponSync.GetGloveFromDatabase(playerInfo));
}
if (Config.Additional.AgentEnabled)
{
_ = Task.Run(async () => await weaponSync.GetAgentFromDatabase(playerInfo));
}
}
}
Utility.LoadSkinsFromFile(ModuleDirectory + "/skins.json");
Utility.LoadGlovesFromFile(ModuleDirectory + "/gloves.json");
Utility.LoadAgentsFromFile(ModuleDirectory + "/agents.json");
if (Config.Additional.KnifeEnabled)
SetupKnifeMenu();
if (Config.Additional.SkinEnabled)
SetupSkinsMenu();
if (Config.Additional.GloveEnabled)
SetupGlovesMenu();
if (Config.Additional.AgentEnabled)
SetupAgentsMenu();
RegisterListeners();
RegisterCommands();
Utility.LoadSkinsFromFile(ModuleDirectory + "/skins.json");
}
public void OnConfigParsed(WeaponPaintsConfig config)
{
if (!config.GlobalShare)
if (config.DatabaseHost.Length < 1 || config.DatabaseName.Length < 1 || config.DatabaseUser.Length < 1)
{
if (config.DatabaseHost.Length < 1 || config.DatabaseName.Length < 1 || config.DatabaseUser.Length < 1)
{
Logger.LogError("You need to setup Database credentials in config!");
throw new Exception("[WeaponPaints] You need to setup Database credentials in config!");
}
/*
DatabaseConnectionString = Utility.BuildDatabaseConnectionString();
Utility.TestDatabaseConnection();
*/
var builder = new MySqlConnectionStringBuilder
{
Server = config.DatabaseHost,
UserID = config.DatabaseUser,
Password = config.DatabasePassword,
Database = config.DatabaseName,
Port = (uint)config.DatabasePort,
Pooling = true
};
_database = new(builder.ConnectionString);
_ = Utility.CheckDatabaseTables();
Logger.LogError("You need to setup Database credentials in config!");
throw new Exception("[WeaponPaints] You need to setup Database credentials in config!");
}
var builder = new MySqlConnectionStringBuilder
{
Server = config.DatabaseHost,
UserID = config.DatabaseUser,
Password = config.DatabasePassword,
Database = config.DatabaseName,
Port = (uint)config.DatabasePort,
Pooling = true
};
_database = new(builder.ConnectionString);
_ = Utility.CheckDatabaseTables();
Config = config;
_config = config;
_localizer = Localizer;
@@ -242,41 +266,4 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
{
base.Unload(hotReload);
}
private void GlobalShareConnect()
{
if (!Config.GlobalShare) return;
var values = new Dictionary<string, string>
{
{ "server_address", $"{ConVar.Find("ip")!.StringValue}:{ConVar.Find("hostport")!.GetPrimitiveValue<int>().ToString()}" },
{ "server_hostname", ConVar.Find("hostname")!.StringValue }
};
using (var httpClient = new HttpClient())
{
httpClient.BaseAddress = GlobalShareApi;
var formContent = new FormUrlEncodedContent(values);
Task<HttpResponseMessage> responseTask = httpClient.PostAsync("", formContent);
responseTask.Wait();
HttpResponseMessage response = responseTask.Result;
if (response.IsSuccessStatusCode)
{
Task<string> responseBodyTask = response.Content.ReadAsStringAsync();
responseBodyTask.Wait();
string responseBody = responseBodyTask.Result;
GlobalShareServerId = int.Parse(responseBody);
}
else
{
Logger.LogError("Unable to retrieve serverid from GlobalShare!");
throw new Exception("[WeaponPaints] Unable to retrieve serverid from GlobalShare!");
}
}
Logger.LogInformation("GlobalShare ONLINE!");
Console.WriteLine("[WeaponPaints] GlobalShare ONLINE");
}
}

View File

@@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.163" />
<PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.193" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="MySqlConnector" Version="2.3.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
@@ -18,4 +18,8 @@
<ItemGroup>
<None Update="lang\**\*.*" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<None Update="gamedata\*.*" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,4 @@
using Dapper;
using Newtonsoft.Json.Linq;
using System.Collections.Concurrent;
namespace WeaponPaints
@@ -8,174 +7,135 @@ namespace WeaponPaints
{
private readonly WeaponPaintsConfig _config;
private readonly Database _database;
private readonly Uri _globalShareApi;
private readonly int _globalShareServerId;
internal WeaponSynchronization(Database database, WeaponPaintsConfig config, Uri globalShareApi, int globalShareServerId)
internal WeaponSynchronization(Database database, WeaponPaintsConfig config)
{
_database = database;
_config = config;
_globalShareApi = globalShareApi;
_globalShareServerId = globalShareServerId;
}
internal async Task GetKnifeFromDatabase(PlayerInfo player)
{
if (!_config.Additional.KnifeEnabled) return;
if (player.SteamId == null || player.Index == 0) return;
try
{
if (_config.GlobalShare)
{
var values = new Dictionary<string, string>
{
{ "server_id", _globalShareServerId.ToString() },
{ "steamid", player.SteamId },
{ "knife", "1" }
};
UriBuilder builder = new UriBuilder(_globalShareApi);
builder.Query = string.Join("&", values.Select(p => $"{Uri.EscapeDataString(p.Key)}={Uri.EscapeDataString(p.Value)}"));
using (var httpClient = new HttpClient())
{
httpClient.BaseAddress = _globalShareApi;
var formContent = new FormUrlEncodedContent(values);
HttpResponseMessage response = await httpClient.GetAsync(builder.Uri);
if (response.IsSuccessStatusCode)
{
string result = await response.Content.ReadAsStringAsync();
if (!string.IsNullOrEmpty(result))
{
WeaponPaints.g_playersKnife[player.Index] = result;
}
else
{
return;
}
}
else
{
return;
}
}
if (!_config.Additional.KnifeEnabled || string.IsNullOrEmpty(player?.SteamId))
return;
}
await using (var connection = await _database.GetConnectionAsync())
await using var connection = await _database.GetConnectionAsync();
string query = "SELECT `knife` FROM `wp_player_knife` WHERE `steamid` = @steamid";
string? playerKnife = await connection.QueryFirstOrDefaultAsync<string>(query, new { steamid = player.SteamId });
if (!string.IsNullOrEmpty(playerKnife))
{
string query = "SELECT `knife` FROM `wp_player_knife` WHERE `steamid` = @steamid";
string? playerKnife = await connection.QueryFirstOrDefaultAsync<string>(query, new { steamid = player.SteamId });
WeaponPaints.g_playersKnife[player.Slot] = playerKnife;
}
}
catch (Exception ex)
{
Utility.Log($"An error occurred in GetKnifeFromDatabase: {ex.Message}");
}
}
if (playerKnife != null)
internal async Task GetGloveFromDatabase(PlayerInfo player)
{
try
{
if (!_config.Additional.GloveEnabled || string.IsNullOrEmpty(player?.SteamId))
return;
await using var connection = await _database.GetConnectionAsync();
string query = "SELECT `weapon_defindex` FROM `wp_player_gloves` WHERE `steamid` = @steamid";
ushort? gloveData = await connection.QueryFirstOrDefaultAsync<ushort?>(query, new { steamid = player.SteamId });
if (gloveData != null)
{
WeaponPaints.g_playersGlove[player.Slot] = gloveData.Value;
}
}
catch (Exception ex)
{
Utility.Log($"An error occurred in GetGloveFromDatabase: {ex.Message}");
}
}
internal async Task GetAgentFromDatabase(PlayerInfo player)
{
try
{
if (!_config.Additional.AgentEnabled || string.IsNullOrEmpty(player?.SteamId))
return;
await using var connection = await _database.GetConnectionAsync();
string query = "SELECT `agent_ct`, `agent_t` FROM `wp_player_agents` WHERE `steamid` = @steamid";
var agentData = await connection.QueryFirstOrDefaultAsync<(string, string)>(query, new { steamid = player.SteamId });
if (agentData != default)
{
string agentCT = agentData.Item1;
string agentT = agentData.Item2;
if (!string.IsNullOrEmpty(agentCT) || !string.IsNullOrEmpty(agentT))
{
WeaponPaints.g_playersKnife[player.Index] = playerKnife;
WeaponPaints.g_playersAgent[player.Slot] = (
agentCT,
agentT
);
}
}
}
catch (Exception e)
catch (Exception ex)
{
Utility.Log(e.Message);
return;
Utility.Log($"An error occurred in GetGloveFromDatabase: {ex.Message}");
}
}
internal async Task GetWeaponPaintsFromDatabase(PlayerInfo player)
{
if (!_config.Additional.SkinEnabled) return;
if (player.SteamId == null || player.Index == 0) return;
if (!WeaponPaints.gPlayerWeaponsInfo.TryGetValue(player.Index, out _))
{
WeaponPaints.gPlayerWeaponsInfo[player.Index] = new ConcurrentDictionary<int, WeaponInfo>();
}
try
{
if (_config.GlobalShare)
if (!_config.Additional.SkinEnabled || player == null || string.IsNullOrEmpty(player.SteamId))
return;
var weaponInfos = new ConcurrentDictionary<int, WeaponInfo>();
await using var connection = await _database.GetConnectionAsync();
string query = "SELECT * FROM `wp_player_skins` WHERE `steamid` = @steamid";
var playerSkins = await connection.QueryAsync<dynamic>(query, new { steamid = player.SteamId });
if (playerSkins == null)
{
var values = new Dictionary<string, string>
{
{ "server_id", _globalShareServerId.ToString() },
{ "steamid", player.SteamId },
{ "skins", "1" }
};
UriBuilder builder = new UriBuilder(_globalShareApi);
builder.Query = string.Join("&", values.Select(p => $"{Uri.EscapeDataString(p.Key)}={Uri.EscapeDataString(p.Value)}"));
using (var httpClient = new HttpClient())
{
httpClient.BaseAddress = _globalShareApi;
var formContent = new FormUrlEncodedContent(values);
HttpResponseMessage response = await httpClient.GetAsync(builder.Uri);
if (response.IsSuccessStatusCode)
{
string responseBody = await response.Content.ReadAsStringAsync();
JArray jsonArray = JArray.Parse(responseBody);
if (jsonArray != null && jsonArray.Count > 0)
{
foreach (var weapon in jsonArray)
{
int? weaponDefIndex = weapon["weapon_defindex"]?.Value<int>();
int? weaponPaintId = weapon["weapon_paint_id"]?.Value<int>();
float? weaponWear = weapon["weapon_wear"]?.Value<float>();
int? weaponSeed = weapon["weapon_seed"]?.Value<int>();
if (weaponDefIndex != null && weaponPaintId != null && weaponWear != null && weaponSeed != null)
{
WeaponInfo weaponInfo = new WeaponInfo
{
Paint = weaponPaintId.Value,
Seed = weaponSeed.Value,
Wear = weaponWear.Value
};
WeaponPaints.gPlayerWeaponsInfo[player.Index][weaponDefIndex.Value] = weaponInfo;
}
}
}
return;
}
else
{
return;
}
}
WeaponPaints.gPlayerWeaponsInfo[player.Slot] = weaponInfos;
return;
}
await using (var connection = await _database.GetConnectionAsync())
foreach (var row in playerSkins)
{
string query = "SELECT * FROM `wp_player_skins` WHERE `steamid` = @steamid";
var playerSkins = await connection.QueryAsync(query, new { steamid = player.SteamId });
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;
foreach (var row in playerSkins)
WeaponInfo weaponInfo = new WeaponInfo
{
int weaponDefIndex = row.weapon_defindex ?? default;
int weaponPaintId = row.weapon_paint_id ?? default;
float weaponWear = row.weapon_wear ?? default;
int weaponSeed = row.weapon_seed ?? default;
Paint = weaponPaintId,
Seed = weaponSeed,
Wear = weaponWear
};
WeaponInfo weaponInfo = new WeaponInfo
{
Paint = weaponPaintId,
Seed = weaponSeed,
Wear = weaponWear
};
WeaponPaints.gPlayerWeaponsInfo[player.Index][weaponDefIndex] = weaponInfo;
}
weaponInfos[weaponDefIndex] = weaponInfo;
}
WeaponPaints.gPlayerWeaponsInfo[player.Slot] = weaponInfos;
}
catch (Exception e)
catch (Exception ex)
{
Utility.Log(e.Message);
return;
Utility.Log($"An error occurred in GetWeaponPaintsFromDatabase: {ex.Message}");
}
}
internal async Task SyncKnifeToDatabase(PlayerInfo player, string knife)
{
if (!_config.Additional.KnifeEnabled) return;
if (player.SteamId == null || player.Index == 0) return;
if (!_config.Additional.KnifeEnabled || player == null || string.IsNullOrEmpty(player.SteamId) || string.IsNullOrEmpty(knife)) return;
try
{
@@ -185,36 +145,90 @@ namespace WeaponPaints
}
catch (Exception e)
{
Utility.Log(e.Message);
Utility.Log($"Error syncing knife to database: {e.Message}");
}
}
internal async Task SyncGloveToDatabase(PlayerInfo player, int defindex)
{
if (!_config.Additional.GloveEnabled || player == null || string.IsNullOrEmpty(player.SteamId)) return;
try
{
await using var connection = await _database.GetConnectionAsync();
string query = "INSERT INTO `wp_player_gloves` (`steamid`, `weapon_defindex`) VALUES(@steamid, @weapon_defindex) ON DUPLICATE KEY UPDATE `weapon_defindex` = @weapon_defindex";
await connection.ExecuteAsync(query, new { steamid = player.SteamId, weapon_defindex = defindex });
}
catch (Exception e)
{
Utility.Log($"Error syncing glove to database: {e.Message}");
}
}
internal async Task SyncAgentToDatabase(PlayerInfo player)
{
if (!_config.Additional.AgentEnabled || player == null || string.IsNullOrEmpty(player.SteamId)) return;
try
{
await using var connection = await _database.GetConnectionAsync();
string query = @"
INSERT INTO `wp_player_agents` (`steamid`, `agent_ct`, `agent_t`)
VALUES(@steamid, @agent_ct, @agent_t)
ON DUPLICATE KEY UPDATE
`agent_ct` = @agent_ct,
`agent_t` = @agent_t";
await connection.ExecuteAsync(query, new { steamid = player.SteamId, agent_ct = WeaponPaints.g_playersAgent[player.Slot].CT, agent_t = WeaponPaints.g_playersAgent[player.Slot].T });
}
catch (Exception e)
{
Utility.Log($"Error syncing agents to database: {e.Message}");
}
}
internal async Task SyncWeaponPaintsToDatabase(PlayerInfo player)
{
if (player == null || player.Index <= 0 || player.SteamId == null) return;
await using var connection = await _database.GetConnectionAsync();
if (!WeaponPaints.gPlayerWeaponsInfo.ContainsKey(player.Index))
if (player == null || string.IsNullOrEmpty(player.SteamId) || !WeaponPaints.gPlayerWeaponsInfo.TryGetValue(player.Slot, out var weaponsInfo))
return;
foreach (var weaponInfoPair in WeaponPaints.gPlayerWeaponsInfo[player.Index])
try
{
int weaponDefIndex = weaponInfoPair.Key;
WeaponInfo weaponInfo = weaponInfoPair.Value;
await using var connection = await _database.GetConnectionAsync();
int paintId = weaponInfo.Paint;
float wear = weaponInfo.Wear;
int seed = weaponInfo.Seed;
foreach (var weaponInfoPair in weaponsInfo)
{
int weaponDefIndex = weaponInfoPair.Key;
WeaponInfo weaponInfo = weaponInfoPair.Value;
string updateSql = "INSERT INTO `wp_player_skins` (`steamid`, `weapon_defindex`, " +
"`weapon_paint_id`, `weapon_wear`, `weapon_seed`) " +
"VALUES (@steamid, @weaponDefIndex, @paintId, @wear, @seed) " +
"ON DUPLICATE KEY UPDATE `weapon_paint_id` = @paintId, " +
"`weapon_wear` = @wear, `weapon_seed` = @seed";
int paintId = weaponInfo.Paint;
float wear = weaponInfo.Wear;
int seed = weaponInfo.Seed;
var updateParams = new { steamid = player.SteamId, weaponDefIndex, paintId, wear, seed };
await connection.ExecuteAsync(updateSql, updateParams);
string queryCheckExistence = "SELECT COUNT(*) FROM `wp_player_skins` WHERE `steamid` = @steamid AND `weapon_defindex` = @weaponDefIndex";
int existingRecordCount = await connection.ExecuteScalarAsync<int>(queryCheckExistence, new { steamid = player.SteamId, weaponDefIndex });
string query;
object parameters;
if (existingRecordCount > 0)
{
query = "UPDATE `wp_player_skins` SET `weapon_paint_id` = @paintId, `weapon_wear` = @wear, `weapon_seed` = @seed WHERE `steamid` = @steamid AND `weapon_defindex` = @weaponDefIndex";
parameters = new { steamid = player.SteamId, weaponDefIndex, paintId, wear, seed };
}
else
{
query = "INSERT INTO `wp_player_skins` (`steamid`, `weapon_defindex`, `weapon_paint_id`, `weapon_wear`, `weapon_seed`) " +
"VALUES (@steamid, @weaponDefIndex, @paintId, @wear, @seed)";
parameters = new { steamid = player.SteamId, weaponDefIndex, paintId, wear, seed };
}
await connection.ExecuteAsync(query, parameters);
}
}
catch (Exception e)
{
Utility.Log($"Error syncing weapon paints to database: {e.Message}");
}
}
}

View File

@@ -0,0 +1,23 @@
{
"ChangeSubclass": {
"signatures": {
"library": "server",
"windows": "\\x48\\x89\\x5C\\x24\\x08\\x57\\x48\\x83\\xEC\\x20\\x48\\x8B\\xDA\\x48\\x8B\\xF9\\xE8\\x2A\\x2A\\x2A\\x2A\\x84\\xC0\\x74\\x2A\\x41\\xB0\\x01",
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x41\\x55\\x49\\x89\\xF5\\x41\\x54\\x49\\x89\\xFC\\x53\\x48\\x81\\xEC\\xA8\\x00\\x00\\x00"
}
},
"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"
}
}
}

View File

@@ -3,12 +3,20 @@
"wp_info_website": "Visit {lime}{0}{default} where you can change skins",
"wp_info_refresh": "Type {lime}!wp{default} to synchronize chosen skins",
"wp_info_knife": "Type {lime}!knife{default} to open knife menu",
"wp_info_glove": "Type {lime}!gloves{default} to open gloves menu",
"wp_info_agent": "Type {lime}!agents{default} to open agents menu",
"wp_command_cooldown": "{lightred}You can't refresh weapon paints right now",
"wp_command_refresh_done": "{lime}Refreshing weapon paints",
"wp_knife_menu_select": "You have chosen {lime}{0}{default} as your knife",
"wp_knife_menu_kill": "To correctly apply skin for knife, you need to type {lime}!kill{default}",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "Knife Menu",
"wp_glove_menu_select": "You have chosen {lime}{0}{default} as your glove",
"wp_glove_menu_title": "Gloves Menu",
"wp_agent_menu_select": "You have chosen {lime}{0}{default} as your agent",
"wp_agent_menu_title": "Agents Menu",
"wp_skin_menu_weapon_title": "Weapon Menu",
"wp_skin_menu_skin_title": "Select skin for {lime}{0}{default}",
"wp_skin_menu_select": "You have chosen {lime}{0}{default} as your skin"
"wp_skin_menu_select": "You have chosen {lime}{0}{default} as your skin",
"None": "None"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[Ieroču Ādiņas] {default}",
"wp_info_website": "Apmeklē {lime}{0}{default} kur tu vari nomainīt skinus",
"wp_info_refresh": "Raksti {lime}!wp{default} lai sinhronizētu izvēlētos skinus",
"wp_info_knife": "Raksti {lime}!knife{default} lai atvērtu nažu izvēlni",
"wp_command_cooldown": "{lightred} Tu šobrīd nevari atjaunot ieroču skinus...",
"wp_command_refresh_done": "{lime}Izvēlētie skini tiek atjaunoti",
"wp_knife_menu_select": "Tu esi izvēlējies {lime}{0}{default} nazi",
"wp_knife_menu_kill": "Lai pareizi atjaunotu naža skinu, ieraksti čatā {lime}!kill{default}",
"wp_knife_menu_title": "Nažu Izvēlne",
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "Apmeklējiet {lime}{0}{default}, kur varat mainīt ādas",
"wp_info_refresh": "Ievadiet {lime}!wp{default}, lai sinhronizētu izvēlētās ādas",
"wp_info_knife": "Ievadiet {lime}!knife{default}, lai atvērtu nazis izvēlni",
"wp_info_glove": "Ievadiet {lime}!gloves{default}, lai atvērtu cimdi izvēlni",
"wp_info_agent": "Ierakstiet {lime}!agents{default}, lai atvērtu aģentu izvēlni",
"wp_command_cooldown": "{lightred}Šobrīd jūs nevarat atjaunot ieroču ādas",
"wp_command_refresh_done": "{lime}Atjauno ieroču ādas",
"wp_knife_menu_select": "Jūs esat izvēlējies {lime}{0}{default} kā savu nazi",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "Nazis Izvēlne",
"wp_glove_menu_select": "Jūs esat izvēlējies {lime}{0}{default} kā savus cimdus",
"wp_glove_menu_title": "Cimdu Izvēlne",
"wp_agent_menu_select": "Jūs esat izvēlējušies {lime}{0}{default} kā savu aģentu",
"wp_agent_menu_title": "Aģentu izvēlnes",
"wp_skin_menu_weapon_title": "Ieroču Izvēlne",
"wp_skin_menu_skin_title": "Izvēlies skinu ierocim: {lime}{0}{default}",
"wp_skin_menu_select": "Tu esi izvēlējies {lime}{0}{default} kā savu skinu"
"wp_skin_menu_skin_title": "Izvēlieties ādu {lime}{0}{default}",
"wp_skin_menu_select": "Jūs esat izvēlējies {lime}{0}{default} kā savu ādu",
"None": "Nav"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "Odwiedź {lime}{0}{default} gdzie będziesz mógł ustawić skiny",
"wp_info_refresh": "Wpisz {lime}!wp{default} aby zsynchronizować swoje skiny",
"wp_info_knife": "Wpisz {lime}!knife{default} aby wy<EFBFBD>wietlić menu no<EFBFBD>y",
"wp_command_cooldown": "{lightred}Odczekaj chwilę przed wykonaniem tej komendy...",
"wp_command_refresh_done": "{lime}Pomyslnie zsynchronizowano twoje skiny",
"wp_info_website": "Odwiedź {lime}{0}{default}, gdzie możesz zmieniać skórki",
"wp_info_refresh": "Wpisz {lime}!wp{default}, aby zsynchronizować wybrane skórki",
"wp_info_knife": "Wpisz {lime}!knife{default}, aby otworzyć menu noży",
"wp_info_glove": "Wpisz {lime}!gloves{default}, aby otworzyć menu rękawiczek",
"wp_info_agent": "Wpisz {lime}!agents{default}, aby otworzyć menu agentów",
"wp_command_cooldown": "{lightred}Nie możesz teraz odświeżyć skórek broni",
"wp_command_refresh_done": "{lime}Odświeżanie skórek broni",
"wp_knife_menu_select": "Wybrałeś {lime}{0}{default} jako swój nóż",
"wp_knife_menu_kill": "Do prawidłowego zastosowania noża użyj {lime}!kill{default}",
"wp_knife_menu_title": "Menu noży",
"wp_skin_menu_weapon_title": "Menu broni",
"wp_skin_menu_skin_title": "Wybierz skin dla {lime}{0}{default}",
"wp_skin_menu_select": "Wybrałeś {lime}{0}{default} jako swój skin"
"wp_knife_menu_kill": "{lime}Wybrane skiny będą ustawione dopiero po ponownym wejściu na serwer lub wpisaniu komendy {orange}!kill",
"wp_knife_menu_title": "Menu Noży",
"wp_glove_menu_select": "Wybrałeś {lime}{0}{default} jako swoje rękawiczki",
"wp_glove_menu_title": "Menu Rękawiczek",
"wp_agent_menu_select": "Wybrałeś {lime}{0}{default} jako swojego agenta",
"wp_agent_menu_title": "Menu agentów",
"wp_skin_menu_weapon_title": "Menu Broni",
"wp_skin_menu_skin_title": "Wybierz skórkę dla {lime}{0}{default}",
"wp_skin_menu_select": "Wybrałeś {lime}{0}{default} jako swoją skórkę",
"None": "Brak"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "Visite {lime}{0}{default} para mudar suas skins e faca",
"wp_info_refresh": "Digite {lime}!wp{default} para sincronizar as suas skins",
"wp_info_website": "Visite {lime}{0}{default}, onde você pode alterar skins",
"wp_info_refresh": "Digite {lime}!wp{default} para sincronizar as skins selecionadas",
"wp_info_knife": "Digite {lime}!knife{default} para abrir o menu de facas",
"wp_command_cooldown": "{lightred}Você não pode atualizar as skins das armas agora",
"wp_command_refresh_done": "{lime}Sincronizando as suas skins",
"wp_info_glove": "Digite {lime}!gloves{default} para abrir o menu de luvas",
"wp_info_agent": "Digite {lime}!agents{default} para abrir o menu de agentes",
"wp_command_cooldown": "{lightred}Você não pode atualizar as skins de arma agora",
"wp_command_refresh_done": "{lime}Atualizando as skins de arma",
"wp_knife_menu_select": "Você escolheu {lime}{0}{default} como sua faca",
"wp_knife_menu_kill": "Para aplicar corretamente a skin da faca, você precisa digitar {lime}!kill{default}",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "Menu de Facas",
"wp_glove_menu_select": "Você escolheu {lime}{0}{default} como suas luvas",
"wp_glove_menu_title": "Menu de Luvas",
"wp_agent_menu_select": "Você escolheu {lime}{0}{default} como seu agente",
"wp_agent_menu_title": "Menu de Agentes",
"wp_skin_menu_weapon_title": "Menu de Armas",
"wp_skin_menu_skin_title": "Selecionou a skin para {lime}{0}{default}",
"wp_skin_menu_select": "Você escolheu {lime}{0}{default} como sua skin"
"wp_skin_menu_skin_title": "Selecione uma skin para {lime}{0}{default}",
"wp_skin_menu_select": "Você escolheu {lime}{0}{default} como sua skin",
"None": "Nenhum"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "Visita {lime}{0}{default} onde podes mudar as tuas skins",
"wp_info_refresh": "Digita {lime}!wp{default} para sincronizar as tuas skins",
"wp_info_knife": "Digita {lime}!knife{default} para abrir o menu de facas",
"wp_command_cooldown": "{lightred}Tu não podes sincronizar agora as tuas skins",
"wp_command_refresh_done": "{lime}Sincronizando as tuas skins",
"wp_knife_menu_select": "Tu escolheste {lime}{0}{default} como a tua faca",
"wp_knife_menu_kill": "Para aplicar corretamente a skins para a tua faca, digita {lime}!kill{default}",
"wp_knife_menu_title": "Menu Facas",
"wp_info_website": "Visite {lime}{0}{default}, onde pode alterar skins",
"wp_info_refresh": "Digite {lime}!wp{default} para sincronizar as skins selecionadas",
"wp_info_knife": "Digite {lime}!knife{default} para abrir o menu de facas",
"wp_info_glove": "Digite {lime}!gloves{default} para abrir o menu de luvas",
"wp_info_agent": "Digite {lime}!agents{default} para abrir o menu de agentes",
"wp_command_cooldown": "{lightred}Você não pode atualizar as skins de arma agora",
"wp_command_refresh_done": "{lime}Atualizando as skins de arma",
"wp_knife_menu_select": "Você escolheu {lime}{0}{default} como sua faca",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "Menu de Facas",
"wp_glove_menu_select": "Você escolheu {lime}{0}{default} como suas luvas",
"wp_glove_menu_title": "Menu de Luvas",
"wp_agent_menu_select": "Escolheste {lime}{0}{default} como teu agente",
"wp_agent_menu_title": "Menu de Agentes",
"wp_skin_menu_weapon_title": "Menu de Armas",
"wp_skin_menu_skin_title": "Escolhe a skin para {lime}{0}{default}",
"wp_skin_menu_select": "Tu escolheste {lime}{0}{default} como a tua skin"
"wp_skin_menu_skin_title": "Selecione uma skin para {lime}{0}{default}",
"wp_skin_menu_select": "Você escolheu {lime}{0}{default} como sua skin",
"None": "Nenhum"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "Посетите сайт {lime}{0},{default} чтобы выбрать скин",
"wp_info_refresh": "Наберите в чат {lime}!wp{default} для синхронизации выбранных скинов",
"wp_info_knife": "Наберите в чат {lime}!knife,{default} чтобы выбрать нож",
"wp_command_cooldown": "{lightred}Вы не можете выбрать оружие прямо сейчас",
"wp_command_refresh_done": "{lime}Обновление скинов для оружия",
"wp_knife_menu_select": "Вы выбрали {lime}{0}{default} скин для ножа",
"wp_knife_menu_kill": "Чтобы правильно применить скин для ножа, набери в чат {lime}!kill{default}",
"wp_knife_menu_title": "Меню ножей",
"wp_skin_menu_weapon_title": "Меню оружия",
"wp_info_website": "Посетите {lime}{0}{default}, где вы можете изменить скины",
"wp_info_refresh": "Введите {lime}!wp{default}, чтобы синхронизировать выбранные скины",
"wp_info_knife": "Введите {lime}!knife{default}, чтобы открыть меню ножей",
"wp_info_glove": "Введите {lime}!gloves{default}, чтобы открыть меню перчаток",
"wp_info_agent": "Введите {lime}!agents{default}, чтобы открыть меню агентов",
"wp_command_cooldown": "{lightred}Вы не можете обновить скины оружия сейчас",
"wp_command_refresh_done": "{lime}Обновление скинов оружия",
"wp_knife_menu_select": "Вы выбрали {lime}{0}{default} в качестве вашего ножа",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "Меню Ножей",
"wp_glove_menu_select": "Вы выбрали {lime}{0}{default} в качестве ваших перчаток",
"wp_glove_menu_title": "Меню Перчаток",
"wp_agent_menu_select": "Вы выбрали {lime}{0}{default} в качестве своего агента",
"wp_agent_menu_title": "Меню агентов",
"wp_skin_menu_weapon_title": "Меню Оружия",
"wp_skin_menu_skin_title": "Выберите скин для {lime}{0}{default}",
"wp_skin_menu_select": "Вы выбрали {lime}{0}{default} скина для оружия"
"wp_skin_menu_select": "Вы выбрали {lime}{0}{default} в качестве вашего скина",
"None": "Нет"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "Görünümleri değiştirebileceğiniz {lime}{0}{default} adresini ziyaret edin",
"wp_info_refresh": "Seçilen kaplamyı senkronize etmek için {lime}!wp{default} yazın",
"wp_info_website": "Ziyaret edin {lime}{0}{default}, burada skinleri değiştirebilirsiniz",
"wp_info_refresh": "Senkronize edilen skinleri görmek için {lime}!wp{default} yazın",
"wp_info_knife": "Bıçak menüsünü açmak için {lime}!knife{default} yazın",
"wp_command_cooldown": "{lightred}Şu anda silah kaplamasını yenileyemezsiniz",
"wp_command_refresh_done": "{lime}Silah kaplaması yenileniyor",
"wp_knife_menu_select": "Bıçağınız olarak {lime}{0}{default} seçtiniz",
"wp_knife_menu_kill": "Bıçak için doğru şekilde kaplama uygulamak için {lime}!kill{default} yazmanız gerekir",
"wp_info_glove": "Eldiven menüsünü açmak için {lime}!gloves{default} yazın",
"wp_info_agent": "Ajanlar menüsünü açmak için {lime}!agents{default} yazın",
"wp_command_cooldown": "{lightred}Şu anda silah skinlerini yenileyemezsiniz",
"wp_command_refresh_done": "{lime}Silah skinleri yenileniyor",
"wp_knife_menu_select": "{lime}{0}{default} olarak bıçağınızı seçtiniz",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "Bıçak Menüsü",
"wp_glove_menu_select": "{lime}{0}{default} olarak eldiveninizi seçtiniz",
"wp_glove_menu_title": "Eldiven Menüsü",
"wp_agent_menu_select": "Ajanınız olarak {lime}{0}{default} seçtiniz",
"wp_agent_menu_title": "Ajan Menüsü",
"wp_skin_menu_weapon_title": "Silah Menüsü",
"wp_skin_menu_skin_title": "Select skin for {lime}{0}{default}",
"wp_skin_menu_select": "Teniniz olarak {lime}{0}{default} seçtiniz"
"wp_skin_menu_skin_title": "{lime}{0}{default} için bir skin seçin",
"wp_skin_menu_select": "{lime}{0}{default} olarak bir skin seçtiniz",
"None": "Hiçbiri"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "Відвідайте веб-сайт {lime}{0},{default} щоб вибрати скин",
"wp_info_refresh": "Напишіть у чат {lime}!wp{default} для синхронізації вибраних скинів",
"wp_info_knife": "Напишіть у чат {lime}!knife,{default} щоб вибрати ніж",
"wp_command_cooldown": "{lightred}Ви не можете вибрати зброю зараз",
"wp_command_refresh_done": "{lime}Оновлення скинів для зброї",
"wp_knife_menu_select": "Ви вибрали скин {lime}{0}{default} для ножа",
"wp_knife_menu_kill": "Щоб правильно застосувати скин для ножа, напишіть у чат {lime}!kill{default}",
"wp_knife_menu_title": "Меню ножів",
"wp_skin_menu_weapon_title": "Меню зброї",
"wp_skin_menu_skin_title": "Виберіть скин для {lime}{0}{default}",
"wp_skin_menu_select": "Ви вибрали скин {lime}{0}{default} для зброї"
"wp_info_website": "Відвідайте {lime}{0}{default}, де ви можете змінити шкури",
"wp_info_refresh": "Введіть {lime}!wp{default}, щоб синхронізувати обрані шкури",
"wp_info_knife": "Введіть {lime}!knife{default}, щоб відкрити меню ножів",
"wp_info_glove": "Введіть {lime}!gloves{default}, щоб відкрити меню рукавичок",
"wp_info_agent": "Введіть {lime}!агенти{default}, щоб відкрити меню агентів",
"wp_command_cooldown": "{lightred}Наразі ви не можете оновлювати шкіри зброї",
"wp_command_refresh_done": "{lime}Оновлення шкірок зброї",
"wp_knife_menu_select": "Ви вибрали {lime}{0}{default} як ваш ніж",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "Меню Ножів",
"wp_glove_menu_select": "Ви вибрали {lime}{0}{default} як ваші рукавички",
"wp_glove_menu_title": "Меню Рукавичок",
"wp_agent_menu_select": "Ви обрали {lime}{0}{default} як вашого агента",
"wp_agent_menu_title": "Меню агентів",
"wp_skin_menu_weapon_title": "Меню Зброї",
"wp_skin_menu_skin_title": "Виберіть шкіру для {lime}{0}{default}",
"wp_skin_menu_select": "Ви вибрали {lime}{0}{default} як вашу шкіру",
"None": "Немає"
}

View File

@@ -1,14 +1,22 @@
{
"wp_prefix": "{lightblue}[武器皮肤] {default}",
"wp_info_website": "在线访问 {lime}{0}{default} 更改你的武器皮肤",
"wp_info_refresh": "输入 {lime}!wp{default} 进行在线皮肤同步",
"wp_info_knife": "输入 {lime}!knife{default} 打开刀菜单",
"wp_command_cooldown": "{lightred}皮肤同步刷新冷却中",
"wp_command_refresh_done": "{lime}刷新武器皮肤中",
"wp_knife_menu_select": "你选择了 {lime}{0}{default} 作为你的刀",
"wp_knife_menu_kill": "如需完全应用皮肤到刀上, 你需要输入 {lime}!kill{default} 自杀来进行刷新",
"wp_knife_menu_title": "刀菜单",
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
"wp_info_website": "访问 {lime}{0}{default},您可以更改皮肤",
"wp_info_refresh": "输入 {lime}!wp{default} 同步已选择的皮肤",
"wp_info_knife": "输入 {lime}!knife{default} 打开刀菜单",
"wp_info_glove": "输入 {lime}!gloves{default} 打开手套菜单",
"wp_info_agent": "键入 {lime}!agents{default} 打开代理菜单",
"wp_command_cooldown": "{lightred}您现在无法刷新武器皮肤",
"wp_command_refresh_done": "{lime}刷新武器皮肤",
"wp_knife_menu_select": "您已选择 {lime}{0}{default} 作为您的刀具",
"wp_knife_menu_kill": "",
"wp_knife_menu_title": "刀具菜单",
"wp_glove_menu_select": "您已选择 {lime}{0}{default} 作为您的手套",
"wp_glove_menu_title": "手套菜单",
"wp_agent_menu_select": "您选择了{lime}{0}{default}作为您的代理",
"wp_agent_menu_title": "代理菜单",
"wp_skin_menu_weapon_title": "武器菜单",
"wp_skin_menu_skin_title": "选择 {lime}{0}{default} 皮肤",
"wp_skin_menu_select": "选择 {lime}{0}{default} 作为的皮肤"
"wp_skin_menu_skin_title": " {lime}{0}{default} 选择皮肤",
"wp_skin_menu_select": "您已选择 {lime}{0}{default} 作为的皮肤",
"None": "无"
}

386
website/data/agents.json Normal file
View File

@@ -0,0 +1,386 @@
[
{
"team": 2,
"image": "",
"model": "null",
"agent_name": "Agent | Default"
},
{
"team": 3,
"image": "",
"model": "null",
"agent_name": "Agent | Default"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4619.png",
"model": "ctm_st6/ctm_st6_variantj",
"agent_name": "'Blueberries' Buckshot | NSWC SEAL"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4680.png",
"model": "ctm_st6/ctm_st6_variantl",
"agent_name": "'Two Times' McCoy | TACP Cavalry"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4711.png",
"model": "ctm_swat/ctm_swat_variante",
"agent_name": "Cmdr. Mae 'Dead Cold' Jamison | SWAT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4712.png",
"model": "ctm_swat/ctm_swat_variantf",
"agent_name": "1st Lieutenant Farlow | SWAT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4713.png",
"model": "ctm_swat/ctm_swat_variantg",
"agent_name": "John 'Van Healen' Kask | SWAT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4714.png",
"model": "ctm_swat/ctm_swat_varianth",
"agent_name": "Bio-Haz Specialist | SWAT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4715.png",
"model": "ctm_swat/ctm_swat_varianti",
"agent_name": "Sergeant Bombson | SWAT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4716.png",
"model": "ctm_swat/ctm_swat_variantj",
"agent_name": "Chem-Haz Specialist | SWAT"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4718.png",
"model": "tm_balkan/tm_balkan_variantk",
"agent_name": "Rezan the Redshirt | Sabre"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4726.png",
"model": "tm_professional/tm_professional_varf",
"agent_name": "Sir Bloody Miami Darryl | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4727.png",
"model": "tm_professional/tm_professional_varg",
"agent_name": "Safecracker Voltzmann | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4728.png",
"model": "tm_professional/tm_professional_varh",
"agent_name": "Little Kev | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4730.png",
"model": "tm_professional/tm_professional_varj",
"agent_name": "Getaway Sally | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4732.png",
"model": "tm_professional/tm_professional_vari",
"agent_name": "Number K | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4733.png",
"model": "tm_professional/tm_professional_varf1",
"agent_name": "Sir Bloody Silent Darryl | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4734.png",
"model": "tm_professional/tm_professional_varf2",
"agent_name": "Sir Bloody Skullhead Darryl | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4735.png",
"model": "tm_professional/tm_professional_varf3",
"agent_name": "Sir Bloody Darryl Royale | The Professionals"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4736.png",
"model": "tm_professional/tm_professional_varf4",
"agent_name": "Sir Bloody Loudmouth Darryl | The Professionals"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4749.png",
"model": "ctm_gendarmerie/ctm_gendarmerie_varianta",
"agent_name": "Sous-Lieutenant Medic | Gendarmerie Nationale"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4750.png",
"model": "ctm_gendarmerie/ctm_gendarmerie_variantb",
"agent_name": "Chem-Haz Capitaine | Gendarmerie Nationale"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4751.png",
"model": "ctm_gendarmerie/ctm_gendarmerie_variantc",
"agent_name": "Chef d'Escadron Rouchard | Gendarmerie Nationale"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4752.png",
"model": "ctm_gendarmerie/ctm_gendarmerie_variantd",
"agent_name": "Aspirant | Gendarmerie Nationale"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4753.png",
"model": "ctm_gendarmerie/ctm_gendarmerie_variante",
"agent_name": "Officer Jacques Beltram | Gendarmerie Nationale"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4756.png",
"model": "ctm_swat/ctm_swat_variantk",
"agent_name": "Lieutenant 'Tree Hugger' Farlow | SWAT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4757.png",
"model": "ctm_diver/ctm_diver_varianta",
"agent_name": "Cmdr. Davida 'Goggles' Fernandez | SEAL Frogman"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4771.png",
"model": "ctm_diver/ctm_diver_variantb",
"agent_name": "Cmdr. Frank 'Wet Sox' Baroud | SEAL Frogman"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4772.png",
"model": "ctm_diver/ctm_diver_variantc",
"agent_name": "Lieutenant Rex Krikey | SEAL Frogman"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4773.png",
"model": "tm_jungle_raider/tm_jungle_raider_varianta",
"agent_name": "Elite Trapper Solman | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4774.png",
"model": "tm_jungle_raider/tm_jungle_raider_variantb",
"agent_name": "Crasswater The Forgotten | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4775.png",
"model": "tm_jungle_raider/tm_jungle_raider_variantc",
"agent_name": "Arno The Overgrown | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4776.png",
"model": "tm_jungle_raider/tm_jungle_raider_variantd",
"agent_name": "Col. Mangos Dabisi | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4777.png",
"model": "tm_jungle_raider/tm_jungle_raider_variante",
"agent_name": "Vypa Sista of the Revolution | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4778.png",
"model": "tm_jungle_raider/tm_jungle_raider_variantf",
"agent_name": "Trapper Aggressor | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4780.png",
"model": "tm_jungle_raider/tm_jungle_raider_variantb2",
"agent_name": "'Medium Rare' Crasswater | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-4781.png",
"model": "tm_jungle_raider/tm_jungle_raider_variantf2",
"agent_name": "Trapper | Guerrilla Warfare"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5105.png",
"model": "tm_leet/tm_leet_variantg",
"agent_name": "Ground Rebel | Elite Crew"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5106.png",
"model": "tm_leet/tm_leet_varianth",
"agent_name": "Osiris | Elite Crew"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5107.png",
"model": "tm_leet/tm_leet_varianti",
"agent_name": "Prof. Shahmat | Elite Crew"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5108.png",
"model": "tm_leet/tm_leet_variantf",
"agent_name": "The Elite Mr. Muhlik | Elite Crew"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5109.png",
"model": "tm_leet/tm_leet_variantj",
"agent_name": "Jungle Rebel | Elite Crew"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5205.png",
"model": "tm_phoenix/tm_phoenix_varianth",
"agent_name": "Soldier | Phoenix"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5206.png",
"model": "tm_phoenix/tm_phoenix_variantf",
"agent_name": "Enforcer | Phoenix"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5207.png",
"model": "tm_phoenix/tm_phoenix_variantg",
"agent_name": "Slingshot | Phoenix"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5208.png",
"model": "tm_phoenix/tm_phoenix_varianti",
"agent_name": "Street Soldier | Phoenix"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5305.png",
"model": "ctm_fbi/ctm_fbi_variantf",
"agent_name": "Operator | FBI SWAT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5306.png",
"model": "ctm_fbi/ctm_fbi_variantg",
"agent_name": "Markus Delrow | FBI HRT"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5307.png",
"model": "ctm_fbi/ctm_fbi_varianth",
"agent_name": "Michael Syfers | FBI Sniper"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5308.png",
"model": "ctm_fbi/ctm_fbi_variantb",
"agent_name": "Special Agent Ava | FBI"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5400.png",
"model": "ctm_st6/ctm_st6_variantk",
"agent_name": "3rd Commando Company | KSK"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5401.png",
"model": "ctm_st6/ctm_st6_variante",
"agent_name": "Seal Team 6 Soldier | NSWC SEAL"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5402.png",
"model": "ctm_st6/ctm_st6_variantg",
"agent_name": "Buckshot | NSWC SEAL"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5403.png",
"model": "ctm_st6/ctm_st6_variantm",
"agent_name": "'Two Times' McCoy | USAF TACP"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5404.png",
"model": "ctm_st6/ctm_st6_varianti",
"agent_name": "Lt. Commander Ricksaw | NSWC SEAL"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5405.png",
"model": "ctm_st6/ctm_st6_variantn",
"agent_name": "Primeiro Tenente | Brazilian 1st Battalion"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5500.png",
"model": "tm_balkan/tm_balkan_variantf",
"agent_name": "Dragomir | Sabre"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5501.png",
"model": "tm_balkan/tm_balkan_varianti",
"agent_name": "Maximus | Sabre"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5502.png",
"model": "tm_balkan/tm_balkan_variantg",
"agent_name": "Rezan The Ready | Sabre"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5503.png",
"model": "tm_balkan/tm_balkan_variantj",
"agent_name": "Blackwolf | Sabre"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5504.png",
"model": "tm_balkan/tm_balkan_varianth",
"agent_name": "'The Doctor' Romanov | Sabre"
},
{
"team": 2,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5505.png",
"model": "tm_balkan/tm_balkan_variantl",
"agent_name": "Dragomir | Sabre Footsoldier"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5601.png",
"model": "ctm_sas/ctm_sas_variantf",
"agent_name": "B Squadron Officer | SAS"
},
{
"team": 3,
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/agent-5602.png",
"model": "ctm_sas/ctm_sas_variantg",
"agent_name": "D Squadron Officer | NZSAS"
}
]

440
website/data/gloves.json Normal file
View File

@@ -0,0 +1,440 @@
[
{
"weapon_defindex": 0,
"paint": "0",
"image": "",
"paint_name": "Gloves | Default"
},
{
"weapon_defindex": 4725,
"paint": "10085",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_brokenfang_gloves-10085.png",
"paint_name": "★ Broken Fang Gloves | Jade"
},
{
"weapon_defindex": 4725,
"paint": "10086",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_brokenfang_gloves-10086.png",
"paint_name": "★ Broken Fang Gloves | Yellow-banded"
},
{
"weapon_defindex": 4725,
"paint": "10087",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_brokenfang_gloves-10087.png",
"paint_name": "★ Broken Fang Gloves | Needle Point"
},
{
"weapon_defindex": 4725,
"paint": "10088",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_brokenfang_gloves-10088.png",
"paint_name": "★ Broken Fang Gloves | Unhinged"
},
{
"weapon_defindex": 5027,
"paint": "10006",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_bloodhound_gloves-10006.png",
"paint_name": "★ Bloodhound Gloves | Charred"
},
{
"weapon_defindex": 5027,
"paint": "10007",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_bloodhound_gloves-10007.png",
"paint_name": "★ Bloodhound Gloves | Snakebite"
},
{
"weapon_defindex": 5027,
"paint": "10008",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_bloodhound_gloves-10008.png",
"paint_name": "★ Bloodhound Gloves | Bronzed"
},
{
"weapon_defindex": 5027,
"paint": "10039",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_bloodhound_gloves-10039.png",
"paint_name": "★ Bloodhound Gloves | Guerrilla"
},
{
"weapon_defindex": 5030,
"paint": "10018",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10018.png",
"paint_name": "★ Sport Gloves | Superconductor"
},
{
"weapon_defindex": 5030,
"paint": "10019",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10019.png",
"paint_name": "★ Sport Gloves | Arid"
},
{
"weapon_defindex": 5030,
"paint": "10037",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10037.png",
"paint_name": "★ Sport Gloves | Pandora's Box"
},
{
"weapon_defindex": 5030,
"paint": "10038",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10038.png",
"paint_name": "★ Sport Gloves | Hedge Maze"
},
{
"weapon_defindex": 5030,
"paint": "10045",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10045.png",
"paint_name": "★ Sport Gloves | Amphibious"
},
{
"weapon_defindex": 5030,
"paint": "10046",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10046.png",
"paint_name": "★ Sport Gloves | Bronze Morph"
},
{
"weapon_defindex": 5030,
"paint": "10047",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10047.png",
"paint_name": "★ Sport Gloves | Omega"
},
{
"weapon_defindex": 5030,
"paint": "10048",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10048.png",
"paint_name": "★ Sport Gloves | Vice"
},
{
"weapon_defindex": 5030,
"paint": "10073",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10073.png",
"paint_name": "★ Sport Gloves | Slingshot"
},
{
"weapon_defindex": 5030,
"paint": "10074",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10074.png",
"paint_name": "★ Sport Gloves | Big Game"
},
{
"weapon_defindex": 5030,
"paint": "10075",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10075.png",
"paint_name": "★ Sport Gloves | Scarlet Shamagh"
},
{
"weapon_defindex": 5030,
"paint": "10076",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/sporty_gloves-10076.png",
"paint_name": "★ Sport Gloves | Nocts"
},
{
"weapon_defindex": 5031,
"paint": "10013",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10013.png",
"paint_name": "★ Driver Gloves | Lunar Weave"
},
{
"weapon_defindex": 5031,
"paint": "10015",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10015.png",
"paint_name": "★ Driver Gloves | Convoy"
},
{
"weapon_defindex": 5031,
"paint": "10016",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10016.png",
"paint_name": "★ Driver Gloves | Crimson Weave"
},
{
"weapon_defindex": 5031,
"paint": "10040",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10040.png",
"paint_name": "★ Driver Gloves | Diamondback"
},
{
"weapon_defindex": 5031,
"paint": "10041",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10041.png",
"paint_name": "★ Driver Gloves | King Snake"
},
{
"weapon_defindex": 5031,
"paint": "10042",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10042.png",
"paint_name": "★ Driver Gloves | Imperial Plaid"
},
{
"weapon_defindex": 5031,
"paint": "10043",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10043.png",
"paint_name": "★ Driver Gloves | Overtake"
},
{
"weapon_defindex": 5031,
"paint": "10044",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10044.png",
"paint_name": "★ Driver Gloves | Racing Green"
},
{
"weapon_defindex": 5031,
"paint": "10069",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10069.png",
"paint_name": "★ Driver Gloves | Rezan the Red"
},
{
"weapon_defindex": 5031,
"paint": "10070",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10070.png",
"paint_name": "★ Driver Gloves | Snow Leopard"
},
{
"weapon_defindex": 5031,
"paint": "10071",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10071.png",
"paint_name": "★ Driver Gloves | Queen Jaguar"
},
{
"weapon_defindex": 5031,
"paint": "10072",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/slick_gloves-10072.png",
"paint_name": "★ Driver Gloves | Black Tie"
},
{
"weapon_defindex": 5032,
"paint": "10009",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10009.png",
"paint_name": "★ Hand Wraps | Leather"
},
{
"weapon_defindex": 5032,
"paint": "10010",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10010.png",
"paint_name": "★ Hand Wraps | Spruce DDPAT"
},
{
"weapon_defindex": 5032,
"paint": "10021",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10021.png",
"paint_name": "★ Hand Wraps | Slaughter"
},
{
"weapon_defindex": 5032,
"paint": "10036",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10036.png",
"paint_name": "★ Hand Wraps | Badlands"
},
{
"weapon_defindex": 5032,
"paint": "10053",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10053.png",
"paint_name": "★ Hand Wraps | Cobalt Skulls"
},
{
"weapon_defindex": 5032,
"paint": "10054",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10054.png",
"paint_name": "★ Hand Wraps | Overprint"
},
{
"weapon_defindex": 5032,
"paint": "10055",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10055.png",
"paint_name": "★ Hand Wraps | Duct Tape"
},
{
"weapon_defindex": 5032,
"paint": "10056",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10056.png",
"paint_name": "★ Hand Wraps | Arboreal"
},
{
"weapon_defindex": 5032,
"paint": "10081",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10081.png",
"paint_name": "★ Hand Wraps | Desert Shamagh"
},
{
"weapon_defindex": 5032,
"paint": "10082",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10082.png",
"paint_name": "★ Hand Wraps | Giraffe"
},
{
"weapon_defindex": 5032,
"paint": "10083",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10083.png",
"paint_name": "★ Hand Wraps | Constrictor"
},
{
"weapon_defindex": 5032,
"paint": "10084",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/leather_handwraps-10084.png",
"paint_name": "★ Hand Wraps | CAUTION!"
},
{
"weapon_defindex": 5033,
"paint": "10024",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10024.png",
"paint_name": "★ Moto Gloves | Eclipse"
},
{
"weapon_defindex": 5033,
"paint": "10026",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10026.png",
"paint_name": "★ Moto Gloves | Spearmint"
},
{
"weapon_defindex": 5033,
"paint": "10027",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10027.png",
"paint_name": "★ Moto Gloves | Boom!"
},
{
"weapon_defindex": 5033,
"paint": "10028",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10028.png",
"paint_name": "★ Moto Gloves | Cool Mint"
},
{
"weapon_defindex": 5033,
"paint": "10049",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10049.png",
"paint_name": "★ Moto Gloves | POW!"
},
{
"weapon_defindex": 5033,
"paint": "10050",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10050.png",
"paint_name": "★ Moto Gloves | Turtle"
},
{
"weapon_defindex": 5033,
"paint": "10051",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10051.png",
"paint_name": "★ Moto Gloves | Transport"
},
{
"weapon_defindex": 5033,
"paint": "10052",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10052.png",
"paint_name": "★ Moto Gloves | Polygon"
},
{
"weapon_defindex": 5033,
"paint": "10077",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10077.png",
"paint_name": "★ Moto Gloves | Finish Line"
},
{
"weapon_defindex": 5033,
"paint": "10078",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10078.png",
"paint_name": "★ Moto Gloves | Smoke Out"
},
{
"weapon_defindex": 5033,
"paint": "10079",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10079.png",
"paint_name": "★ Moto Gloves | Blood Pressure"
},
{
"weapon_defindex": 5033,
"paint": "10080",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/motorcycle_gloves-10080.png",
"paint_name": "★ Moto Gloves | 3rd Commando Company"
},
{
"weapon_defindex": 5034,
"paint": "10030",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10030.png",
"paint_name": "★ Specialist Gloves | Forest DDPAT"
},
{
"weapon_defindex": 5034,
"paint": "10033",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10033.png",
"paint_name": "★ Specialist Gloves | Crimson Kimono"
},
{
"weapon_defindex": 5034,
"paint": "10034",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10034.png",
"paint_name": "★ Specialist Gloves | Emerald Web"
},
{
"weapon_defindex": 5034,
"paint": "10035",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10035.png",
"paint_name": "★ Specialist Gloves | Foundation"
},
{
"weapon_defindex": 5034,
"paint": "10061",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10061.png",
"paint_name": "★ Specialist Gloves | Crimson Web"
},
{
"weapon_defindex": 5034,
"paint": "10062",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10062.png",
"paint_name": "★ Specialist Gloves | Buckshot"
},
{
"weapon_defindex": 5034,
"paint": "10063",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10063.png",
"paint_name": "★ Specialist Gloves | Fade"
},
{
"weapon_defindex": 5034,
"paint": "10064",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10064.png",
"paint_name": "★ Specialist Gloves | Mogul"
},
{
"weapon_defindex": 5034,
"paint": "10065",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10065.png",
"paint_name": "★ Specialist Gloves | Marble Fade"
},
{
"weapon_defindex": 5034,
"paint": "10066",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10066.png",
"paint_name": "★ Specialist Gloves | Lt. Commander"
},
{
"weapon_defindex": 5034,
"paint": "10067",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10067.png",
"paint_name": "★ Specialist Gloves | Tiger Strike"
},
{
"weapon_defindex": 5034,
"paint": "10068",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/specialist_gloves-10068.png",
"paint_name": "★ Specialist Gloves | Field Agent"
},
{
"weapon_defindex": 5035,
"paint": "10057",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_hydra_gloves-10057.png",
"paint_name": "★ Hydra Gloves | Emerald"
},
{
"weapon_defindex": 5035,
"paint": "10058",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_hydra_gloves-10058.png",
"paint_name": "★ Hydra Gloves | Mangrove"
},
{
"weapon_defindex": 5035,
"paint": "10059",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_hydra_gloves-10059.png",
"paint_name": "★ Hydra Gloves | Rattler"
},
{
"weapon_defindex": 5035,
"paint": "10060",
"image": "https://raw.githubusercontent.com/daffyyyy/cs2-WeaponPaints/main/website/img/skins/studded_hydra_gloves-10060.png",
"paint_name": "★ Hydra Gloves | Case Hardened"
}
]

File diff suppressed because one or more lines are too long

View File

@@ -8,7 +8,7 @@ $weapons = array (
"weapon_aug" => 8,
"weapon_awp" => 9,
"weapon_famas" => 10,
"weapon_g3sg1" => 10,
"weapon_g3sg1" => 11,
"weapon_galilar" => 13,
"weapon_m249" => 14,
"weapon_m4a1" => 16,
@@ -53,7 +53,14 @@ $weapons = array (
"weapon_knife_stiletto" => 522,
"weapon_knife_widowmaker" => 523,
"weapon_knife_skeleton" => 525);
$json = json_decode(file_get_contents('skins.json'));
$
$json = json_decode(file_get_contents('https://bymykel.github.io/CSGO-API/api/en/skins.json'));
die(var_dump($json));
echo "<pre>";
foreach($json as $skin)
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Some files were not shown because too many files have changed in this diff Show More