Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
726e67865c | ||
|
|
868e6c8746 | ||
|
|
a1285bef26 | ||
|
|
b1920f312c | ||
|
|
5e9850bece | ||
|
|
e1802fd0f0 | ||
|
|
267de3c4de | ||
|
|
9f24fbf3ef | ||
|
|
9c23545173 | ||
|
|
40d1088ee6 | ||
|
|
e7f546ed58 | ||
|
|
beab940ebb | ||
|
|
7dc78e7706 | ||
|
|
02208095f0 | ||
|
|
63f4b4c43d | ||
|
|
a6821b85b4 | ||
|
|
a37f4e9e58 | ||
|
|
fb4340cc1d | ||
|
|
bbbf27a751 | ||
|
|
c9d8bb9b5f | ||
|
|
1109c0cf56 | ||
|
|
63869f4c94 | ||
|
|
fa284678e8 | ||
|
|
558f3178f2 | ||
|
|
c5f9cc6429 | ||
|
|
4087d3d016 | ||
|
|
e7919bb468 | ||
|
|
33bd83d0a1 | ||
|
|
73d989c0ce | ||
|
|
f1cecfc73e | ||
|
|
aae6f7e260 | ||
|
|
171d520cc0 | ||
|
|
deac9bab97 | ||
|
|
8a76530302 | ||
|
|
d1cbecaecb | ||
|
|
ebc932e47c | ||
|
|
e258ed8c92 | ||
|
|
e44af369bb | ||
|
|
47055ad6f7 | ||
|
|
d9166253b3 | ||
|
|
4e90506645 | ||
|
|
bd93936fab | ||
|
|
63403dfc8e | ||
|
|
b24a2bd04e | ||
|
|
dbc652a68c | ||
|
|
a59ce8f1a5 | ||
|
|
baaa47d837 | ||
|
|
7dcfea3e17 | ||
|
|
4eab8f0a87 | ||
|
|
236c79c4b9 | ||
|
|
83084452df |
8
.github/workflows/build.yml
vendored
@@ -60,12 +60,10 @@ jobs:
|
|||||||
${{ env.OUTPUT_PATH }}/Microsoft.Extensions.DependencyModel.dll \
|
${{ env.OUTPUT_PATH }}/Microsoft.Extensions.DependencyModel.dll \
|
||||||
- name: Copy skins.json
|
- name: Copy skins.json
|
||||||
run: cp website/data/skins.json ${{ env.OUTPUT_PATH }}/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: Zip
|
- name: Zip
|
||||||
uses: thedoctor0/zip-release@0.7.5
|
run: zip -r "${{ env.PROJECT_NAME }}.zip" "${{ env.OUTPUT_PATH }}" gamedata/
|
||||||
with:
|
|
||||||
type: 'zip'
|
|
||||||
filename: '${{ env.PROJECT_NAME }}.zip'
|
|
||||||
path: ${{ env.OUTPUT_PATH }}
|
|
||||||
- name: Clean files Website
|
- name: Clean files Website
|
||||||
run: |
|
run: |
|
||||||
rm -rf website/img/
|
rm -rf website/img/
|
||||||
|
|||||||
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
.vs/
|
.vs/
|
||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
|
website/getskins.php
|
||||||
|
|||||||
308
Commands.cs
@@ -1,4 +1,5 @@
|
|||||||
using CounterStrikeSharp.API.Core;
|
using CounterStrikeSharp.API;
|
||||||
|
using CounterStrikeSharp.API.Core;
|
||||||
using CounterStrikeSharp.API.Modules.Commands;
|
using CounterStrikeSharp.API.Modules.Commands;
|
||||||
using CounterStrikeSharp.API.Modules.Menu;
|
using CounterStrikeSharp.API.Modules.Menu;
|
||||||
|
|
||||||
@@ -10,43 +11,55 @@ namespace WeaponPaints
|
|||||||
{
|
{
|
||||||
if (!Config.Additional.CommandWpEnabled || !Config.Additional.SkinEnabled || !g_bCommandsAllowed) return;
|
if (!Config.Additional.CommandWpEnabled || !Config.Additional.SkinEnabled || !g_bCommandsAllowed) return;
|
||||||
if (!Utility.IsPlayerValid(player)) return;
|
if (!Utility.IsPlayerValid(player)) return;
|
||||||
if (player == null || player.Index <= 0) return;
|
|
||||||
|
if (player == null || !player.IsValid || player.UserId == null || player.IsBot) return;
|
||||||
|
|
||||||
int playerIndex = (int)player!.Index;
|
int playerIndex = (int)player!.Index;
|
||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
UserId = player.UserId,
|
UserId = player.UserId,
|
||||||
Index = (int)player.Index,
|
Index = (int)player.Index,
|
||||||
SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(),
|
SteamId = player?.SteamID.ToString(),
|
||||||
Name = player?.PlayerName,
|
Name = player?.PlayerName,
|
||||||
IpAddress = player?.IpAddress?.Split(":")[0]
|
IpAddress = player?.IpAddress?.Split(":")[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (player == null || player.UserId == null) return;
|
if (player == null || !player.IsValid || player.UserId == null || player.IsBot) return;
|
||||||
|
|
||||||
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
|
try
|
||||||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
|
|
||||||
{
|
{
|
||||||
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
|
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
|
||||||
if (weaponSync != null)
|
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
|
||||||
Task.Run(async () => await weaponSync.GetWeaponPaintsFromDatabase(playerInfo));
|
|
||||||
if (Config.Additional.KnifeEnabled)
|
|
||||||
{
|
{
|
||||||
|
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
|
||||||
|
|
||||||
if (weaponSync != null)
|
if (weaponSync != null)
|
||||||
Task.Run(async () => await weaponSync.GetKnifeFromDatabase(playerInfo));
|
{
|
||||||
|
Task.Run(async () => await weaponSync.GetWeaponPaintsFromDatabase(playerInfo));
|
||||||
|
|
||||||
RefreshWeapons(player);
|
if (Config.Additional.GloveEnabled)
|
||||||
|
Task.Run(async () => await weaponSync.GetGloveFromDatabase(playerInfo));
|
||||||
|
|
||||||
|
if (Config.Additional.KnifeEnabled)
|
||||||
|
Task.Run(async () => await weaponSync.GetKnifeFromDatabase(playerInfo));
|
||||||
|
|
||||||
|
RefreshWeapons(player);
|
||||||
|
RefreshGloves(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Localizer["wp_command_refresh_done"]))
|
||||||
|
{
|
||||||
|
player!.Print(Localizer["wp_command_refresh_done"]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Localizer["wp_command_refresh_done"]))
|
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
|
||||||
{
|
{
|
||||||
player!.Print(Localizer["wp_command_refresh_done"]);
|
player!.Print(Localizer["wp_command_cooldown"]);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
|
|
||||||
{
|
|
||||||
player!.Print(Localizer["wp_command_cooldown"]);
|
|
||||||
}
|
}
|
||||||
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCommandWS(CCSPlayerController? player, CommandInfo command)
|
private void OnCommandWS(CCSPlayerController? player, CommandInfo command)
|
||||||
@@ -62,11 +75,18 @@ namespace WeaponPaints
|
|||||||
{
|
{
|
||||||
player!.Print(Localizer["wp_info_refresh"]);
|
player!.Print(Localizer["wp_info_refresh"]);
|
||||||
}
|
}
|
||||||
if (!Config.Additional.KnifeEnabled) return;
|
|
||||||
if (!string.IsNullOrEmpty(Localizer["wp_info_knife"]))
|
if (Config.Additional.GloveEnabled)
|
||||||
{
|
if (!string.IsNullOrEmpty(Localizer["wp_info_glove"]))
|
||||||
player!.Print(Localizer["wp_info_knife"]);
|
{
|
||||||
}
|
player!.Print(Localizer["wp_info_glove"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.Additional.KnifeEnabled)
|
||||||
|
if (!string.IsNullOrEmpty(Localizer["wp_info_knife"]))
|
||||||
|
{
|
||||||
|
player!.Print(Localizer["wp_info_knife"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RegisterCommands()
|
private void RegisterCommands()
|
||||||
@@ -78,7 +98,7 @@ namespace WeaponPaints
|
|||||||
});
|
});
|
||||||
AddCommand($"css_{Config.Additional.CommandRefresh}", "Skins refresh", (player, info) =>
|
AddCommand($"css_{Config.Additional.CommandRefresh}", "Skins refresh", (player, info) =>
|
||||||
{
|
{
|
||||||
if (!Utility.IsPlayerValid(player) || !g_bCommandsAllowed) return;
|
if (!Utility.IsPlayerValid(player)) return;
|
||||||
OnCommandRefresh(player, info);
|
OnCommandRefresh(player, info);
|
||||||
});
|
});
|
||||||
if (Config.Additional.CommandKillEnabled)
|
if (Config.Additional.CommandKillEnabled)
|
||||||
@@ -101,44 +121,40 @@ namespace WeaponPaints
|
|||||||
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
.ToDictionary(pair => pair.Key, pair => pair.Value);
|
||||||
|
|
||||||
var giveItemMenu = new ChatMenu(Localizer["wp_knife_menu_title"]);
|
var giveItemMenu = new ChatMenu(Localizer["wp_knife_menu_title"]);
|
||||||
var handleGive = (CCSPlayerController? player, ChatMenuOption option) =>
|
var handleGive = (CCSPlayerController player, ChatMenuOption option) =>
|
||||||
{
|
{
|
||||||
if (Utility.IsPlayerValid(player))
|
if (!Utility.IsPlayerValid(player)) return;
|
||||||
|
|
||||||
|
var knifeName = option.Text;
|
||||||
|
var knifeKey = knivesOnly.FirstOrDefault(x => x.Value == knifeName).Key;
|
||||||
|
if (!string.IsNullOrEmpty(knifeKey))
|
||||||
{
|
{
|
||||||
if (player == null) return;
|
if (!string.IsNullOrEmpty(Localizer["wp_knife_menu_select"]))
|
||||||
var knifeName = option.Text;
|
|
||||||
var knifeKey = knivesOnly.FirstOrDefault(x => x.Value == knifeName).Key;
|
|
||||||
if (!string.IsNullOrEmpty(knifeKey))
|
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(Localizer["wp_knife_menu_select"]))
|
player!.Print(Localizer["wp_knife_menu_select", knifeName]);
|
||||||
{
|
|
||||||
player!.Print(Localizer["wp_knife_menu_select", knifeName]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Localizer["wp_knife_menu_kill"]) && Config.Additional.CommandKillEnabled)
|
|
||||||
{
|
|
||||||
player!.Print(Localizer["wp_knife_menu_kill"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
|
||||||
{
|
|
||||||
UserId = player.UserId,
|
|
||||||
Index = (int)player.Index,
|
|
||||||
SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(),
|
|
||||||
Name = player?.PlayerName,
|
|
||||||
IpAddress = player?.IpAddress?.Split(":")[0]
|
|
||||||
};
|
|
||||||
|
|
||||||
g_playersKnife[(int)player!.Index] = knifeKey;
|
|
||||||
|
|
||||||
if (player!.PawnIsAlive && g_bCommandsAllowed)
|
|
||||||
{
|
|
||||||
RefreshWeapons(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (weaponSync != null)
|
|
||||||
Task.Run(async () => await weaponSync.SyncKnifeToDatabase(playerInfo, knifeKey));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Localizer["wp_knife_menu_kill"]) && Config.Additional.CommandKillEnabled)
|
||||||
|
{
|
||||||
|
player!.Print(Localizer["wp_knife_menu_kill"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
|
{
|
||||||
|
UserId = player.UserId,
|
||||||
|
Index = (int)player.Index,
|
||||||
|
SteamId = player.SteamID.ToString(),
|
||||||
|
Name = player.PlayerName,
|
||||||
|
IpAddress = player.IpAddress?.Split(":")[0]
|
||||||
|
};
|
||||||
|
|
||||||
|
g_playersKnife[(int)player!.Index] = knifeKey;
|
||||||
|
|
||||||
|
if (g_bCommandsAllowed && (LifeState_t)player.LifeState == LifeState_t.LIFE_ALIVE)
|
||||||
|
AddTimer(0.1f, () => RefreshWeapons(player), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
|
|
||||||
|
if (weaponSync != null)
|
||||||
|
Task.Run(async () => await weaponSync.SyncKnifeToDatabase(playerInfo, knifeKey));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
foreach (var knifePair in knivesOnly)
|
foreach (var knifePair in knivesOnly)
|
||||||
@@ -155,7 +171,8 @@ namespace WeaponPaints
|
|||||||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
|
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
|
||||||
{
|
{
|
||||||
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
|
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
|
||||||
ChatMenus.OpenMenu(player, giveItemMenu);
|
giveItemMenu.PostSelectAction = PostSelectAction.Close;
|
||||||
|
MenuManager.OpenChatMenu(player, giveItemMenu);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
|
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
|
||||||
@@ -169,6 +186,7 @@ namespace WeaponPaints
|
|||||||
{
|
{
|
||||||
var classNamesByWeapon = weaponList.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
|
var classNamesByWeapon = weaponList.ToDictionary(kvp => kvp.Value, kvp => kvp.Key);
|
||||||
var weaponSelectionMenu = new ChatMenu(Localizer["wp_skin_menu_weapon_title"]);
|
var weaponSelectionMenu = new ChatMenu(Localizer["wp_skin_menu_weapon_title"]);
|
||||||
|
weaponSelectionMenu.PostSelectAction = PostSelectAction.Close;
|
||||||
|
|
||||||
// Function to handle skin selection for a specific weapon
|
// Function to handle skin selection for a specific weapon
|
||||||
var handleWeaponSelection = (CCSPlayerController? player, ChatMenuOption option) =>
|
var handleWeaponSelection = (CCSPlayerController? player, ChatMenuOption option) =>
|
||||||
@@ -187,17 +205,16 @@ namespace WeaponPaints
|
|||||||
)?.ToList();
|
)?.ToList();
|
||||||
|
|
||||||
var skinSubMenu = new ChatMenu(Localizer["wp_skin_menu_skin_title", selectedWeapon]);
|
var skinSubMenu = new ChatMenu(Localizer["wp_skin_menu_skin_title", selectedWeapon]);
|
||||||
|
skinSubMenu.PostSelectAction = PostSelectAction.Close;
|
||||||
|
|
||||||
// Function to handle skin selection for the chosen weapon
|
// Function to handle skin selection for the chosen weapon
|
||||||
var handleSkinSelection = (CCSPlayerController? p, ChatMenuOption opt) =>
|
var handleSkinSelection = (CCSPlayerController p, ChatMenuOption opt) =>
|
||||||
{
|
{
|
||||||
if (p == null || !p.IsValid || p.Index <= 0) return;
|
if (!Utility.IsPlayerValid(p)) return;
|
||||||
|
|
||||||
playerIndex = (int)p.Index;
|
playerIndex = (int)p.Index;
|
||||||
|
|
||||||
if (p.AuthorizedSteamID == null) return;
|
string steamId = p.SteamID.ToString();
|
||||||
|
|
||||||
string steamId = p.AuthorizedSteamID.SteamId64.ToString();
|
|
||||||
var firstSkin = skinsList?.FirstOrDefault(skin =>
|
var firstSkin = skinsList?.FirstOrDefault(skin =>
|
||||||
{
|
{
|
||||||
if (skin != null && skin.TryGetValue("weapon_name", out var weaponName))
|
if (skin != null && skin.TryGetValue("weapon_name", out var weaponName))
|
||||||
@@ -206,6 +223,7 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
string selectedSkin = opt.Text;
|
string selectedSkin = opt.Text;
|
||||||
string selectedPaintID = selectedSkin.Split('(')[1].Trim(')').Trim();
|
string selectedPaintID = selectedSkin.Split('(')[1].Trim(')').Trim();
|
||||||
|
|
||||||
@@ -215,7 +233,19 @@ namespace WeaponPaints
|
|||||||
int.TryParse(weaponDefIndexObj.ToString(), out var weaponDefIndex) &&
|
int.TryParse(weaponDefIndexObj.ToString(), out var weaponDefIndex) &&
|
||||||
int.TryParse(selectedPaintID, out var paintID))
|
int.TryParse(selectedPaintID, out var paintID))
|
||||||
{
|
{
|
||||||
p!.Print(Localizer["wp_skin_menu_select", selectedSkin]);
|
if (Config.Additional.ShowSkinImage && skinsList != null)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
p.Print(Localizer["wp_skin_menu_select", selectedSkin]);
|
||||||
|
|
||||||
if (!gPlayerWeaponsInfo[playerIndex].ContainsKey(weaponDefIndex))
|
if (!gPlayerWeaponsInfo[playerIndex].ContainsKey(weaponDefIndex))
|
||||||
{
|
{
|
||||||
@@ -228,18 +258,15 @@ namespace WeaponPaints
|
|||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
UserId = player.UserId,
|
UserId = p.UserId,
|
||||||
Index = (int)player.Index,
|
Index = (int)p.Index,
|
||||||
SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(),
|
SteamId = p.SteamID.ToString(),
|
||||||
Name = player?.PlayerName,
|
Name = p.PlayerName,
|
||||||
IpAddress = player?.IpAddress?.Split(":")[0]
|
IpAddress = p.IpAddress?.Split(":")[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Config.GlobalShare)
|
if (g_bCommandsAllowed && (LifeState_t)p.LifeState == LifeState_t.LIFE_ALIVE)
|
||||||
{
|
AddTimer(0.15f, () => RefreshWeapons(p), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
if (weaponSync != null)
|
|
||||||
Task.Run(async () => await weaponSync.SyncWeaponPaintsToDatabase(playerInfo));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -262,7 +289,7 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open the submenu for skin selection of the chosen weapon
|
// Open the submenu for skin selection of the chosen weapon
|
||||||
ChatMenus.OpenMenu(player, skinSubMenu);
|
MenuManager.OpenChatMenu(player, skinSubMenu);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -274,23 +301,126 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
// Command to open the weapon selection menu for players
|
// Command to open the weapon selection menu for players
|
||||||
AddCommand($"css_{Config.Additional.CommandSkinSelection}", "Skins selection menu", (player, info) =>
|
AddCommand($"css_{Config.Additional.CommandSkinSelection}", "Skins selection menu", (player, info) =>
|
||||||
|
{
|
||||||
|
if (!Utility.IsPlayerValid(player)) 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))
|
||||||
|
{
|
||||||
|
commandsCooldown[(int)player.UserId] = 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)) return;
|
||||||
|
|
||||||
if (player == null || player.UserId == null) return;
|
uint playerIndex = player!.Index;
|
||||||
|
string selectedPaintName = option.Text;
|
||||||
|
|
||||||
if (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
|
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,
|
||||||
|
Index = (int)player.Index,
|
||||||
|
SteamId = player.SteamID.ToString(),
|
||||||
|
Name = player.PlayerName,
|
||||||
|
IpAddress = player.IpAddress?.Split(":")[0]
|
||||||
|
};
|
||||||
|
|
||||||
|
if (paint != 0)
|
||||||
|
{
|
||||||
|
g_playersGlove[playerIndex] = (ushort)weaponDefindex;
|
||||||
|
|
||||||
|
if (!gPlayerWeaponsInfo[(int)playerIndex].ContainsKey(weaponDefindex))
|
||||||
|
{
|
||||||
|
WeaponInfo weaponInfo = new();
|
||||||
|
weaponInfo.Paint = paint;
|
||||||
|
gPlayerWeaponsInfo[(int)playerIndex][weaponDefindex] = weaponInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_playersGlove.TryRemove(playerIndex, out _);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Localizer["wp_glove_menu_select"]))
|
||||||
|
{
|
||||||
|
player!.Print(Localizer["wp_glove_menu_select", selectedPaintName]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Server.NextFrame(() =>
|
||||||
|
{
|
||||||
|
RefreshGloves(player);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (weaponSync != null)
|
||||||
|
{
|
||||||
|
Task.Run(async () => await weaponSync.SyncGloveToDatabase(playerInfo, (ushort)weaponDefindex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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 (!commandsCooldown.TryGetValue((int)player.UserId, out DateTime cooldownEndTime) ||
|
||||||
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
|
DateTime.UtcNow >= (commandsCooldown.TryGetValue((int)player.UserId, out cooldownEndTime) ? cooldownEndTime : DateTime.UtcNow))
|
||||||
{
|
{
|
||||||
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
|
commandsCooldown[(int)player.UserId] = DateTime.UtcNow.AddSeconds(Config.CmdRefreshCooldownSeconds);
|
||||||
ChatMenus.OpenMenu(player, weaponSelectionMenu);
|
MenuManager.OpenChatMenu(player, glovesSelectionMenu);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
|
if (!string.IsNullOrEmpty(Localizer["wp_command_cooldown"]))
|
||||||
{
|
{
|
||||||
player!.Print(Localizer["wp_command_cooldown"]);
|
player!.Print(Localizer["wp_command_cooldown"]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
13
Config.cs
@@ -11,6 +11,9 @@ namespace WeaponPaints
|
|||||||
[JsonPropertyName("KnifeEnabled")]
|
[JsonPropertyName("KnifeEnabled")]
|
||||||
public bool KnifeEnabled { get; set; } = true;
|
public bool KnifeEnabled { get; set; } = true;
|
||||||
|
|
||||||
|
[JsonPropertyName("GloveEnabled")]
|
||||||
|
public bool GloveEnabled { get; set; } = true;
|
||||||
|
|
||||||
[JsonPropertyName("SkinEnabled")]
|
[JsonPropertyName("SkinEnabled")]
|
||||||
public bool SkinEnabled { get; set; } = true;
|
public bool SkinEnabled { get; set; } = true;
|
||||||
|
|
||||||
@@ -23,6 +26,9 @@ namespace WeaponPaints
|
|||||||
[JsonPropertyName("CommandKnife")]
|
[JsonPropertyName("CommandKnife")]
|
||||||
public string CommandKnife { get; set; } = "knife";
|
public string CommandKnife { get; set; } = "knife";
|
||||||
|
|
||||||
|
[JsonPropertyName("CommandGlove")]
|
||||||
|
public string CommandGlove { get; set; } = "gloves";
|
||||||
|
|
||||||
[JsonPropertyName("CommandSkin")]
|
[JsonPropertyName("CommandSkin")]
|
||||||
public string CommandSkin { get; set; } = "ws";
|
public string CommandSkin { get; set; } = "ws";
|
||||||
|
|
||||||
@@ -40,8 +46,12 @@ namespace WeaponPaints
|
|||||||
|
|
||||||
[JsonPropertyName("GiveRandomSkin")]
|
[JsonPropertyName("GiveRandomSkin")]
|
||||||
public bool GiveRandomSkin { get; set; } = false;
|
public bool GiveRandomSkin { get; set; } = false;
|
||||||
|
|
||||||
[JsonPropertyName("GiveKnifeAfterRemove")]
|
[JsonPropertyName("GiveKnifeAfterRemove")]
|
||||||
public bool GiveKnifeAfterRemove { get; set; } = false;
|
public bool GiveKnifeAfterRemove { get; set; } = false;
|
||||||
|
|
||||||
|
[JsonPropertyName("ShowSkinImage")]
|
||||||
|
public bool ShowSkinImage { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WeaponPaintsConfig : BasePluginConfig
|
public class WeaponPaintsConfig : BasePluginConfig
|
||||||
@@ -78,5 +88,4 @@ namespace WeaponPaints
|
|||||||
[JsonPropertyName("Additional")]
|
[JsonPropertyName("Additional")]
|
||||||
public Additional Additional { get; set; } = new Additional();
|
public Additional Additional { get; set; } = new Additional();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
28
Database.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using MySqlConnector;
|
||||||
|
|
||||||
|
namespace WeaponPaints
|
||||||
|
{
|
||||||
|
public class Database
|
||||||
|
{
|
||||||
|
private readonly string _dbConnectionString;
|
||||||
|
|
||||||
|
public Database(string dbConnectionString)
|
||||||
|
{
|
||||||
|
_dbConnectionString = dbConnectionString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<MySqlConnection> GetConnectionAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var connection = new MySqlConnection(_dbConnectionString);
|
||||||
|
await connection.OpenAsync();
|
||||||
|
return connection;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
317
Events.cs
@@ -1,54 +1,73 @@
|
|||||||
using CounterStrikeSharp.API;
|
using CounterStrikeSharp.API;
|
||||||
using CounterStrikeSharp.API.Core;
|
using CounterStrikeSharp.API.Core;
|
||||||
|
using CounterStrikeSharp.API.Core.Attributes.Registration;
|
||||||
|
|
||||||
namespace WeaponPaints
|
namespace WeaponPaints
|
||||||
{
|
{
|
||||||
public partial class WeaponPaints
|
public partial class WeaponPaints
|
||||||
{
|
{
|
||||||
private void OnClientPutInServer(int playerSlot)
|
|
||||||
|
[GameEventHandler]
|
||||||
|
public HookResult OnPlayerConnect(EventPlayerConnectFull @event, GameEventInfo info)
|
||||||
{
|
{
|
||||||
CCSPlayerController? player = Utilities.GetPlayerFromSlot(playerSlot);
|
CCSPlayerController? player = @event.Userid;
|
||||||
|
|
||||||
|
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
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
UserId = player.UserId,
|
UserId = player.UserId,
|
||||||
Index = (int)player.Index,
|
Index = (int)player.Index,
|
||||||
SteamId = player.SteamID.ToString(),
|
SteamId = player.SteamID.ToString(),
|
||||||
Name = player?.PlayerName,
|
Name = player.PlayerName,
|
||||||
IpAddress = player?.IpAddress?.Split(":")[0]
|
IpAddress = player.IpAddress?.Split(":")[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (player == null || !player.IsValid || player.IsBot || player.IsHLTV || weaponSync == null) return;
|
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (Config.Additional.SkinEnabled)
|
// Run skin, knife, and glove tasks asynchronously
|
||||||
await weaponSync.GetKnifeFromDatabase(playerInfo);
|
var skinTask = Config.Additional.SkinEnabled ? weaponSync.GetWeaponPaintsFromDatabase(playerInfo) : Task.CompletedTask;
|
||||||
|
var knifeTask = Config.Additional.KnifeEnabled ? weaponSync.GetKnifeFromDatabase(playerInfo) : Task.CompletedTask;
|
||||||
|
var gloveTask = Config.Additional.GloveEnabled ? weaponSync.GetGloveFromDatabase(playerInfo) : Task.CompletedTask;
|
||||||
|
|
||||||
|
// Await all tasks to complete
|
||||||
|
await Task.WhenAll(skinTask, knifeTask, gloveTask);
|
||||||
});
|
});
|
||||||
|
|
||||||
//if (Config.Additional.KnifeEnabled && weaponSync != null)
|
return HookResult.Continue;
|
||||||
//_ = weaponSync.GetKnifeFromDatabase(playerIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClientDisconnect(int playerSlot)
|
[GameEventHandler]
|
||||||
|
public HookResult OnPlayerDisconnect(EventPlayerDisconnect @event, GameEventInfo info)
|
||||||
{
|
{
|
||||||
CCSPlayerController player = Utilities.GetPlayerFromSlot(playerSlot);
|
CCSPlayerController player = @event.Userid;
|
||||||
|
|
||||||
if (player == null || !player.IsValid || player.IsBot || player.IsHLTV || player.UserId == null) return;
|
if (player is null || !player.IsValid || !player.UserId.HasValue || player.IsBot ||
|
||||||
|
player.IsHLTV || player.SteamID.ToString().Length != 17) return HookResult.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 (weaponSync != null)
|
||||||
|
Task.Run(async () => await weaponSync.SyncWeaponPaintsToDatabase(playerInfo));
|
||||||
|
|
||||||
|
if (Config.Additional.SkinEnabled)
|
||||||
|
gPlayerWeaponsInfo.TryRemove((int)player.Index, out _);
|
||||||
if (Config.Additional.KnifeEnabled)
|
if (Config.Additional.KnifeEnabled)
|
||||||
g_playersKnife.TryRemove((int)player.Index, out _);
|
g_playersKnife.TryRemove((int)player.Index, out _);
|
||||||
if (Config.Additional.SkinEnabled)
|
if (Config.Additional.GloveEnabled)
|
||||||
{
|
g_playersGlove.TryRemove(player.Index, out _);
|
||||||
if (gPlayerWeaponsInfo.TryRemove((int)player.Index, out var innerDictionary))
|
|
||||||
{
|
commandsCooldown.Remove((int)player.UserId);
|
||||||
innerDictionary.Clear();
|
|
||||||
}
|
return HookResult.Continue;
|
||||||
}
|
|
||||||
if (commandsCooldown.ContainsKey((int)player.UserId))
|
|
||||||
{
|
|
||||||
commandsCooldown.Remove((int)player.UserId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEntityCreated(CEntityInstance entity)
|
private void OnEntityCreated(CEntityInstance entity)
|
||||||
@@ -73,7 +92,8 @@ namespace WeaponPaints
|
|||||||
if (weapon.OwnerEntity.Value == null) return;
|
if (weapon.OwnerEntity.Value == null) return;
|
||||||
if (weapon.OwnerEntity.Index <= 0) return;
|
if (weapon.OwnerEntity.Index <= 0) return;
|
||||||
int weaponOwner = (int)weapon.OwnerEntity.Index;
|
int weaponOwner = (int)weapon.OwnerEntity.Index;
|
||||||
var pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex(weaponOwner));
|
CBasePlayerPawn? pawn = Utilities.GetEntityFromIndex<CCSPlayerPawn>((int)weaponOwner);
|
||||||
|
//var pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex(weaponOwner));
|
||||||
if (!pawn.IsValid) return;
|
if (!pawn.IsValid) return;
|
||||||
|
|
||||||
var playerIndex = (int)pawn.Controller.Index;
|
var playerIndex = (int)pawn.Controller.Index;
|
||||||
@@ -86,72 +106,41 @@ namespace WeaponPaints
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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")
|
|
||||||
{
|
|
||||||
g_knifePickupCount[(int)player.Index]++;
|
|
||||||
|
|
||||||
RemovePlayerKnife(player, true);
|
|
||||||
|
|
||||||
if (!PlayerHasKnife(player) && Config.Additional.GiveKnifeAfterRemove)
|
|
||||||
AddTimer(0.3f, () => GiveKnifeToPlayer(player));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return HookResult.Continue;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public HookResult OnPickup(CEntityIOOutput output, string name, CEntityInstance activator, CEntityInstance caller, CVariant value, float delay)
|
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;
|
CCSPlayerController? player = Utilities.GetEntityFromIndex<CCSPlayerPawn>((int)activator.Index).OriginalController.Value;
|
||||||
|
|
||||||
if (player == null || player.IsBot || player.IsHLTV)
|
if (player == null || player.IsBot || player.IsHLTV ||
|
||||||
return HookResult.Continue;
|
player.SteamID.ToString().Length != 17 || !g_knifePickupCount.TryGetValue((int)player.Index, out var pickupCount) ||
|
||||||
|
!g_playersKnife.ContainsKey((int)player.Index))
|
||||||
if (player == null || !player.IsValid || player.SteamID.ToString() == "" ||
|
{
|
||||||
!g_knifePickupCount.ContainsKey((int)player.Index) || !g_playersKnife.ContainsKey((int)player.Index))
|
|
||||||
return HookResult.Continue;
|
return HookResult.Continue;
|
||||||
|
}
|
||||||
|
|
||||||
CBasePlayerWeapon weapon = new(caller.Handle);
|
CBasePlayerWeapon weapon = new(caller.Handle);
|
||||||
|
|
||||||
if (weapon.AttributeManager.Item.ItemDefinitionIndex != 42 && weapon.AttributeManager.Item.ItemDefinitionIndex != 59)
|
if (weapon.AttributeManager.Item.ItemDefinitionIndex != 42 && weapon.AttributeManager.Item.ItemDefinitionIndex != 59)
|
||||||
|
{
|
||||||
return HookResult.Continue;
|
return HookResult.Continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_knifePickupCount[(int)player.Index] >= 2) return HookResult.Continue;
|
if (pickupCount >= 2)
|
||||||
|
{
|
||||||
|
return HookResult.Continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_playersKnife[(int)player.Index] != "weapon_knife")
|
if (g_playersKnife[(int)player.Index] != "weapon_knife")
|
||||||
{
|
{
|
||||||
g_knifePickupCount[(int)player.Index]++;
|
pickupCount++;
|
||||||
player.RemoveItemByDesignerName(weapon.DesignerName);
|
g_knifePickupCount[(int)player.Index] = pickupCount;
|
||||||
|
|
||||||
if (Config.Additional.GiveKnifeAfterRemove)
|
if (Config.Additional.GiveKnifeAfterRemove)
|
||||||
AddTimer(0.2f, () => GiveKnifeToPlayer(player));
|
{
|
||||||
|
AddTimer(0.10f, () =>
|
||||||
|
{
|
||||||
|
RefreshWeapons(player);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return HookResult.Continue;
|
return HookResult.Continue;
|
||||||
@@ -159,99 +148,40 @@ namespace WeaponPaints
|
|||||||
|
|
||||||
private void OnMapStart(string mapName)
|
private void OnMapStart(string mapName)
|
||||||
{
|
{
|
||||||
if (!Config.Additional.KnifeEnabled) return;
|
if (!Config.Additional.KnifeEnabled && !Config.Additional.SkinEnabled && !Config.Additional.GloveEnabled) return;
|
||||||
|
|
||||||
|
if (_database != null)
|
||||||
|
weaponSync = new WeaponSynchronization(_database, Config, GlobalShareApi, GlobalShareServerId);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// needed for now
|
// needed for now
|
||||||
AddTimer(2.0f, () =>
|
AddTimer(2.0f, () =>
|
||||||
{
|
{
|
||||||
|
|
||||||
NativeAPI.IssueServerCommand("mp_t_default_melee \"\"");
|
NativeAPI.IssueServerCommand("mp_t_default_melee \"\"");
|
||||||
NativeAPI.IssueServerCommand("mp_ct_default_melee \"\"");
|
NativeAPI.IssueServerCommand("mp_ct_default_melee \"\"");
|
||||||
NativeAPI.IssueServerCommand("mp_equipment_reset_rounds 0");
|
NativeAPI.IssueServerCommand("mp_equipment_reset_rounds 0");
|
||||||
|
|
||||||
if (Config.GlobalShare)
|
if (Config.GlobalShare)
|
||||||
GlobalShareConnect();
|
GlobalShareConnect();
|
||||||
|
|
||||||
weaponSync = new WeaponSynchronization(DatabaseConnectionString, Config, GlobalShareApi, GlobalShareServerId);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
|
||||||
{
|
|
||||||
UserId = player.UserId,
|
|
||||||
Index = (int)player.Index,
|
|
||||||
SteamId = player?.SteamID.ToString(),
|
|
||||||
Name = player?.PlayerName,
|
|
||||||
IpAddress = player?.IpAddress?.Split(":")[0]
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!gPlayerWeaponsInfo.ContainsKey((int)player!.Index))
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return HookResult.Continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private HookResult OnPlayerSpawn(EventPlayerSpawn @event, GameEventInfo info)
|
private HookResult OnPlayerSpawn(EventPlayerSpawn @event, GameEventInfo info)
|
||||||
{
|
{
|
||||||
CCSPlayerController? player = @event.Userid;
|
CCSPlayerController? player = @event.Userid;
|
||||||
if (player == null || !player.IsValid)
|
|
||||||
{
|
if (player is null || !player.IsValid || player.PlayerPawn == null ||
|
||||||
|
!player.PlayerPawn.IsValid || player.IsHLTV
|
||||||
|
|| !Config.Additional.KnifeEnabled && !Config.Additional.GloveEnabled)
|
||||||
return HookResult.Continue;
|
return HookResult.Continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.Additional.KnifeEnabled && !PlayerHasKnife(player))
|
g_knifePickupCount[(int)player.Index] = 0;
|
||||||
{
|
GiveKnifeToPlayer(player);
|
||||||
g_knifePickupCount[(int)player.Index] = 0;
|
|
||||||
GiveKnifeToPlayer(player);
|
|
||||||
//AddTimer(0.1f, () => GiveKnifeToPlayer(player));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
Server.NextFrame(() =>
|
||||||
if (Config.Additional.SkinVisibilityFix)
|
|
||||||
{
|
{
|
||||||
AddTimer(0.3f, () => RefreshSkins(player));
|
RefreshGloves(player);
|
||||||
}
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
return HookResult.Continue;
|
return HookResult.Continue;
|
||||||
}
|
}
|
||||||
@@ -279,78 +209,77 @@ namespace WeaponPaints
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (player == null || !player.IsValid || !player.PawnIsAlive || player.IsBot || player.IsHLTV) continue;
|
if (player is null || !player.IsValid || !player.PawnIsAlive || player.SteamID.ToString().Length != 17
|
||||||
|
|| player.IsBot || player.IsHLTV || player.Connected != PlayerConnectedState.PlayerConnected)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (Config.Additional.ShowSkinImage && PlayerWeaponImage.ContainsKey(player.Slot) && !string.IsNullOrEmpty(PlayerWeaponImage[player.Slot]))
|
||||||
|
{
|
||||||
|
player.PrintToCenterHtml("<img src='{PATH}'</img>".Replace("{PATH}", PlayerWeaponImage[player.Slot]));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.PlayerPawn?.IsValid != true || player.PlayerPawn?.Value?.IsValid != true)
|
||||||
|
continue;
|
||||||
|
|
||||||
var viewModels = GetPlayerViewModels(player);
|
var viewModels = GetPlayerViewModels(player);
|
||||||
|
if (viewModels == null || viewModels.Length == 0)
|
||||||
if (viewModels == null) continue;
|
continue;
|
||||||
|
|
||||||
var viewModel = viewModels[0];
|
var viewModel = viewModels[0];
|
||||||
if (viewModel == null || viewModel.Value == null || viewModel.Value.Weapon == null || viewModel.Value.Weapon.Value == null) continue;
|
if (viewModel == null || viewModel.Value == null || viewModel.Value.Weapon == null || viewModel.Value.Weapon.Value == null)
|
||||||
CBasePlayerWeapon weapon = viewModel.Value.Weapon.Value;
|
continue;
|
||||||
|
|
||||||
if (weapon == null || !weapon.IsValid) continue;
|
var weapon = viewModel.Value.Weapon.Value;
|
||||||
|
if (weapon == null || !weapon.IsValid || weapon.FallbackPaintKit == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
var isKnife = viewModel.Value.VMName.Contains("knife");
|
if (viewModel.Value.VMName.Contains("knife"))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!isKnife)
|
var sceneNode = viewModel.Value.CBodyComponent?.SceneNode;
|
||||||
|
if (sceneNode == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var skeleton = GetSkeletonInstance(sceneNode);
|
||||||
|
if (skeleton == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
int[] newPaints = { 1171, 1170, 1169, 1164, 1162, 1161, 1159, 1175, 1174, 1167, 1165, 1168, 1163, 1160, 1166, 1173 };
|
||||||
|
if (newPaints.Contains(weapon.FallbackPaintKit))
|
||||||
{
|
{
|
||||||
if (
|
skeleton.ModelState.MeshGroupMask = 1;
|
||||||
viewModel.Value.CBodyComponent != null
|
}
|
||||||
&& viewModel.Value.CBodyComponent.SceneNode != null
|
else
|
||||||
)
|
{
|
||||||
|
if (skeleton.ModelState.MeshGroupMask != 2)
|
||||||
{
|
{
|
||||||
var skeleton = GetSkeletonInstance(viewModel.Value.CBodyComponent.SceneNode);
|
|
||||||
skeleton.ModelState.MeshGroupMask = 2;
|
skeleton.ModelState.MeshGroupMask = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utilities.SetStateChanged(viewModel.Value, "CBaseEntity", "m_CBodyComponent");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utilities.SetStateChanged(viewModel.Value, "CBaseEntity", "m_CBodyComponent");
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RegisterListeners()
|
private void RegisterListeners()
|
||||||
{
|
{
|
||||||
RegisterListener<Listeners.OnEntityCreated>(OnEntityCreated);
|
RegisterListener<Listeners.OnEntityCreated>(OnEntityCreated);
|
||||||
RegisterListener<Listeners.OnClientPutInServer>(OnClientPutInServer);
|
//RegisterListener<Listeners.OnClientPutInServer>(OnClientPutInServer);
|
||||||
RegisterListener<Listeners.OnClientDisconnect>(OnClientDisconnect);
|
//RegisterListener<Listeners.OnClientDisconnect>(OnClientDisconnect);
|
||||||
RegisterListener<Listeners.OnMapStart>(OnMapStart);
|
RegisterListener<Listeners.OnMapStart>(OnMapStart);
|
||||||
RegisterListener<Listeners.OnTick>(OnTick);
|
RegisterListener<Listeners.OnTick>(OnTick);
|
||||||
|
|
||||||
RegisterEventHandler<EventPlayerConnectFull>(OnPlayerConnectFull);
|
|
||||||
RegisterEventHandler<EventPlayerSpawn>(OnPlayerSpawn);
|
RegisterEventHandler<EventPlayerSpawn>(OnPlayerSpawn);
|
||||||
RegisterEventHandler<EventRoundStart>(OnRoundStart, HookMode.Pre);
|
RegisterEventHandler<EventRoundStart>(OnRoundStart, HookMode.Pre);
|
||||||
RegisterEventHandler<EventRoundEnd>(OnRoundEnd);
|
RegisterEventHandler<EventRoundEnd>(OnRoundEnd);
|
||||||
RegisterEventHandler<EventItemPurchase>(OnEventItemPurchasePost);
|
|
||||||
//RegisterEventHandler<EventItemPickup>(OnItemPickup);
|
//RegisterEventHandler<EventItemPickup>(OnItemPickup);
|
||||||
HookEntityOutput("weapon_knife", "OnPlayerPickup", OnPickup, HookMode.Pre);
|
|
||||||
|
HookEntityOutput("weapon_knife", "OnPlayerPickup", OnPickup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* 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;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public string? IpAddress { get; set; }
|
public string? IpAddress { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,8 @@ Unfinished, unoptimized and not fully functional ugly demo weapon paints plugin
|
|||||||
## CS2 Server
|
## CS2 Server
|
||||||
- Have working CounterStrikeSharp (**with RUNTIME!**)
|
- Have working CounterStrikeSharp (**with RUNTIME!**)
|
||||||
- Download from Release and copy plugin to plugins
|
- Download from Release and copy plugin to plugins
|
||||||
- Setup `addons/counterstrikesharp/configs/`**`plugins/WeaponPaints/WeaponPaints.json`** set **`GlobalShare`** to **`true`** for global, or include database credentials
|
- 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
|
||||||
- In `addons/counterstrikesharp/configs/`**`core.json`** set **FollowCS2ServerGuidelines** to **`false`**
|
- In `addons/counterstrikesharp/configs/`**`core.json`** set **FollowCS2ServerGuidelines** to **`false`**
|
||||||
|
|
||||||
## Plugin Configuration
|
## Plugin Configuration
|
||||||
@@ -88,6 +89,7 @@ Disregard if the config is **`GlobalShare = true`**
|
|||||||
|
|
||||||
## Known issues
|
## Known issues
|
||||||
- Issue on Windows servers, no knives are given.
|
- 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
|
- Can cause incompatibility with plugins/maps which manipulates weapons and knives
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
@@ -100,6 +102,9 @@ Plugin is not loaded or configured with mysql credentials. Tables are auto-creat
|
|||||||
|
|
||||||
**Knives are disappearing:**
|
**Knives are disappearing:**
|
||||||
Set in config GiveKnifeAfterRemove to true
|
Set in config GiveKnifeAfterRemove to true
|
||||||
|
|
||||||
|
**Knives are not changing for players:**
|
||||||
|
You can't change knife if you have your own equipped
|
||||||
</details>
|
</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/)
|
### 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
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
86
Utility.cs
@@ -1,11 +1,11 @@
|
|||||||
using CounterStrikeSharp.API.Core;
|
using CounterStrikeSharp.API.Core;
|
||||||
using CounterStrikeSharp.API.Modules.Utils;
|
using CounterStrikeSharp.API.Modules.Utils;
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using MySqlConnector;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Reflection;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using MySqlConnector;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace WeaponPaints
|
namespace WeaponPaints
|
||||||
{
|
{
|
||||||
@@ -23,27 +23,49 @@ namespace WeaponPaints
|
|||||||
Password = Config.DatabasePassword,
|
Password = Config.DatabasePassword,
|
||||||
Database = Config.DatabaseName,
|
Database = Config.DatabaseName,
|
||||||
Port = (uint)Config.DatabasePort,
|
Port = (uint)Config.DatabasePort,
|
||||||
|
Pooling = true
|
||||||
};
|
};
|
||||||
|
|
||||||
return builder.ConnectionString;
|
return builder.ConnectionString;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static async void CheckDatabaseTables()
|
internal static async Task CheckDatabaseTables()
|
||||||
{
|
{
|
||||||
|
if (WeaponPaints._database is null) return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using var connection = new MySqlConnection(BuildDatabaseConnectionString());
|
await using var connection = await WeaponPaints._database.GetConnectionAsync();
|
||||||
await connection.OpenAsync();
|
|
||||||
|
|
||||||
using var transaction = await connection.BeginTransactionAsync();
|
await using var transaction = await connection.BeginTransactionAsync();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string createTable1 = "CREATE TABLE IF NOT EXISTS `wp_player_skins` (`steamid` varchar(64) 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";
|
string[] createTableQueries = new[]
|
||||||
string createTable2 = "CREATE TABLE IF NOT EXISTS `wp_player_knife` (`steamid` varchar(64) NOT NULL, `knife` varchar(64) NOT NULL, UNIQUE (`steamid`)) ENGINE = InnoDB";
|
{
|
||||||
|
@"CREATE TABLE IF NOT EXISTS `wp_player_skins` (
|
||||||
|
`steamid` varchar(64) 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",
|
||||||
|
@"CREATE TABLE IF NOT EXISTS `wp_player_knife` (
|
||||||
|
`steamid` varchar(64) NOT NULL,
|
||||||
|
`knife` varchar(64) NOT NULL,
|
||||||
|
UNIQUE (`steamid`)
|
||||||
|
) ENGINE = InnoDB",
|
||||||
|
@"CREATE TABLE IF NOT EXISTS `wp_player_gloves` (
|
||||||
|
`steamid` varchar(64) NOT NULL,
|
||||||
|
`weapon_defindex` int(11) NOT NULL,
|
||||||
|
UNIQUE (`steamid`)
|
||||||
|
) ENGINE=InnoDB"
|
||||||
|
};
|
||||||
|
|
||||||
await connection.ExecuteAsync(createTable1, transaction: transaction);
|
foreach (var query in createTableQueries)
|
||||||
await connection.ExecuteAsync(createTable2, transaction: transaction);
|
{
|
||||||
|
await connection.ExecuteAsync(query, transaction: transaction);
|
||||||
|
}
|
||||||
|
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
}
|
||||||
@@ -55,25 +77,43 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw new Exception("[WeaponPaints] Unknown mysql exception! " + ex.Message);
|
throw new Exception("[WeaponPaints] Unknown MySQL exception! " + ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool IsPlayerValid(CCSPlayerController? player)
|
internal static bool IsPlayerValid(CCSPlayerController? player)
|
||||||
{
|
{
|
||||||
return (player != null && player.IsValid && !player.IsBot && !player.IsHLTV && player.AuthorizedSteamID != null);
|
if (player is null) return false;
|
||||||
|
|
||||||
|
return (player is not null && player.IsValid && !player.IsBot && !player.IsHLTV
|
||||||
|
&& WeaponPaints.weaponSync != null && player.Connected == PlayerConnectedState.PlayerConnected && player.SteamID.ToString().Length == 17);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void LoadSkinsFromFile(string filePath)
|
internal static void LoadSkinsFromFile(string filePath)
|
||||||
{
|
{
|
||||||
if (File.Exists(filePath))
|
try
|
||||||
{
|
{
|
||||||
string json = File.ReadAllText(filePath);
|
string json = File.ReadAllText(filePath);
|
||||||
var deserializedSkins = JsonConvert.DeserializeObject<List<JObject>>(json);
|
var deserializedSkins = JsonConvert.DeserializeObject<List<JObject>>(json);
|
||||||
WeaponPaints.skinsList = deserializedSkins ?? new List<JObject>();
|
WeaponPaints.skinsList = deserializedSkins ?? new List<JObject>();
|
||||||
}
|
}
|
||||||
else
|
catch (FileNotFoundException)
|
||||||
{
|
{
|
||||||
throw new FileNotFoundException("File not found.", filePath);
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,11 +154,11 @@ namespace WeaponPaints
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HttpResponseMessage response = await client.GetAsync("https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/VERSION");
|
HttpResponseMessage response = await client.GetAsync("https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/VERSION").ConfigureAwait(false);
|
||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
string remoteVersion = await response.Content.ReadAsStringAsync();
|
string remoteVersion = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||||
remoteVersion = remoteVersion.Trim();
|
remoteVersion = remoteVersion.Trim();
|
||||||
|
|
||||||
int comparisonResult = string.Compare(version, remoteVersion);
|
int comparisonResult = string.Compare(version, remoteVersion);
|
||||||
@@ -141,9 +181,13 @@ namespace WeaponPaints
|
|||||||
logger.LogWarning("Failed to check version");
|
logger.LogWarning("Failed to check version");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (HttpRequestException ex)
|
||||||
|
{
|
||||||
|
logger.LogError(ex, "Failed to connect to the version server.");
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine(ex);
|
logger.LogError(ex, "An error occurred while checking version.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,6 +207,7 @@ namespace WeaponPaints
|
|||||||
Console.WriteLine(" ");
|
Console.WriteLine(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*(
|
||||||
internal static void TestDatabaseConnection()
|
internal static void TestDatabaseConnection()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -181,5 +226,6 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
CheckDatabaseTables();
|
CheckDatabaseTables();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
405
WeaponAction.cs
@@ -1,6 +1,7 @@
|
|||||||
using CounterStrikeSharp.API;
|
using CounterStrikeSharp.API;
|
||||||
using CounterStrikeSharp.API.Core;
|
using CounterStrikeSharp.API.Core;
|
||||||
using CounterStrikeSharp.API.Modules.Memory;
|
using CounterStrikeSharp.API.Modules.Memory;
|
||||||
|
using CounterStrikeSharp.API.Modules.Timers;
|
||||||
using CounterStrikeSharp.API.Modules.Utils;
|
using CounterStrikeSharp.API.Modules.Utils;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
@@ -11,7 +12,7 @@ namespace WeaponPaints
|
|||||||
{
|
{
|
||||||
internal static void ChangeWeaponAttributes(CBasePlayerWeapon? weapon, CCSPlayerController? player, bool isKnife = false)
|
internal static void ChangeWeaponAttributes(CBasePlayerWeapon? weapon, CCSPlayerController? player, bool isKnife = false)
|
||||||
{
|
{
|
||||||
if (player == null || weapon == null || !weapon.IsValid || !Utility.IsPlayerValid(player)) return;
|
if (player is null || weapon is null || !weapon.IsValid || !Utility.IsPlayerValid(player)) return;
|
||||||
|
|
||||||
int playerIndex = (int)player.Index;
|
int playerIndex = (int)player.Index;
|
||||||
|
|
||||||
@@ -21,12 +22,13 @@ namespace WeaponPaints
|
|||||||
|
|
||||||
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
|
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
|
||||||
|
|
||||||
|
|
||||||
if (isKnife)
|
if (isKnife)
|
||||||
{
|
{
|
||||||
weapon.AttributeManager.Item.EntityQuality = 3;
|
weapon.AttributeManager.Item.EntityQuality = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int fallbackPaintKit = weapon.FallbackPaintKit;
|
||||||
|
|
||||||
if (_config.Additional.GiveRandomSkin &&
|
if (_config.Additional.GiveRandomSkin &&
|
||||||
!gPlayerWeaponsInfo[playerIndex].ContainsKey(weaponDefIndex))
|
!gPlayerWeaponsInfo[playerIndex].ContainsKey(weaponDefIndex))
|
||||||
{
|
{
|
||||||
@@ -37,14 +39,51 @@ namespace WeaponPaints
|
|||||||
weapon.FallbackPaintKit = GetRandomPaint(weaponDefIndex);
|
weapon.FallbackPaintKit = GetRandomPaint(weaponDefIndex);
|
||||||
weapon.FallbackSeed = 0;
|
weapon.FallbackSeed = 0;
|
||||||
weapon.FallbackWear = 0.000001f;
|
weapon.FallbackWear = 0.000001f;
|
||||||
|
|
||||||
|
fallbackPaintKit = weapon.FallbackPaintKit;
|
||||||
|
|
||||||
|
if (fallbackPaintKit == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var foundSkin = skinsList.FirstOrDefault(skin =>
|
||||||
|
((int?)skin?["weapon_defindex"] ?? 0) == weaponDefIndex &&
|
||||||
|
((int?)skin?["paint"] ?? 0) == fallbackPaintKit &&
|
||||||
|
skin?["paint_name"] != null
|
||||||
|
);
|
||||||
|
|
||||||
|
string skinName = foundSkin?["paint_name"]?.ToString() ?? "";
|
||||||
|
if (!string.IsNullOrEmpty(skinName))
|
||||||
|
new SchemaString<CEconItemView>(weapon.AttributeManager.Item, "m_szCustomName").Set(skinName);
|
||||||
|
|
||||||
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
|
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
|
||||||
{
|
{
|
||||||
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
|
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
|
||||||
if (skeleton.ModelState.MeshGroupMask != 2)
|
|
||||||
|
int[] newPaints = { 1171, 1170, 1169, 1164, 1162, 1161, 1159, 1175, 1174, 1167, 1165, 1168, 1163, 1160, 1166, 1173 };
|
||||||
|
|
||||||
|
if (newPaints.Contains(fallbackPaintKit))
|
||||||
{
|
{
|
||||||
skeleton.ModelState.MeshGroupMask = 2;
|
skeleton.ModelState.MeshGroupMask = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (skeleton.ModelState.MeshGroupMask != 2)
|
||||||
|
{
|
||||||
|
skeleton.ModelState.MeshGroupMask = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var viewModels = GetPlayerViewModels(player);
|
||||||
|
if (viewModels == null || viewModels.Length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var viewModel = viewModels[0];
|
||||||
|
if (viewModel == null || viewModel.Value == null || viewModel.Value.Weapon == null || viewModel.Value.Weapon.Value == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Utilities.SetStateChanged(viewModel.Value, "CBaseEntity", "m_CBodyComponent");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,39 +97,78 @@ namespace WeaponPaints
|
|||||||
weapon.FallbackSeed = weaponInfo.Seed;
|
weapon.FallbackSeed = weaponInfo.Seed;
|
||||||
weapon.FallbackWear = weaponInfo.Wear;
|
weapon.FallbackWear = weaponInfo.Wear;
|
||||||
|
|
||||||
|
fallbackPaintKit = weapon.FallbackPaintKit;
|
||||||
|
|
||||||
|
if (fallbackPaintKit == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var foundSkin1 = skinsList.FirstOrDefault(skin =>
|
||||||
|
((int?)skin?["weapon_defindex"] ?? 0) == weaponDefIndex &&
|
||||||
|
((int?)skin?["paint"] ?? 0) == fallbackPaintKit &&
|
||||||
|
skin?["paint_name"] != null
|
||||||
|
);
|
||||||
|
|
||||||
|
var skinName1 = foundSkin1?["paint_name"]?.ToString() ?? "";
|
||||||
|
if (!string.IsNullOrEmpty(skinName1))
|
||||||
|
new SchemaString<CEconItemView>(weapon.AttributeManager.Item, "m_szCustomName").Set(skinName1);
|
||||||
|
|
||||||
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
|
if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null)
|
||||||
{
|
{
|
||||||
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
|
var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode);
|
||||||
if (skeleton.ModelState.MeshGroupMask != 2)
|
int[] newPaints = { 1171, 1170, 1169, 1164, 1162, 1161, 1159, 1175, 1174, 1167, 1165, 1168, 1163, 1160, 1166, 1173 };
|
||||||
|
if (newPaints.Contains(fallbackPaintKit))
|
||||||
{
|
{
|
||||||
skeleton.ModelState.MeshGroupMask = 2;
|
skeleton.ModelState.MeshGroupMask = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (skeleton.ModelState.MeshGroupMask != 2)
|
||||||
|
{
|
||||||
|
skeleton.ModelState.MeshGroupMask = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var viewModels1 = GetPlayerViewModels(player);
|
||||||
|
if (viewModels1 == null || viewModels1.Length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var viewModel1 = viewModels1[0];
|
||||||
|
if (viewModel1 == null || viewModel1.Value == null || viewModel1.Value.Weapon == null || viewModel1.Value.Weapon.Value == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Utilities.SetStateChanged(viewModel1.Value, "CBaseEntity", "m_CBodyComponent");
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void GiveKnifeToPlayer(CCSPlayerController? player)
|
internal static void GiveKnifeToPlayer(CCSPlayerController? player)
|
||||||
{
|
{
|
||||||
if (!_config.Additional.KnifeEnabled || player == null || !player.IsValid) return;
|
if (!_config.Additional.KnifeEnabled || player == null || !player.IsValid) return;
|
||||||
|
|
||||||
|
string knifeToGive;
|
||||||
if (g_playersKnife.TryGetValue((int)player.Index, out var knife))
|
if (g_playersKnife.TryGetValue((int)player.Index, out var knife))
|
||||||
{
|
{
|
||||||
player.GiveNamedItem(knife);
|
knifeToGive = knife;
|
||||||
}
|
}
|
||||||
else if (_config.Additional.GiveRandomKnife)
|
else if (_config.Additional.GiveRandomKnife)
|
||||||
{
|
{
|
||||||
var knifeTypes = weaponList.Where(pair => pair.Key.StartsWith("weapon_knife") || pair.Key.StartsWith("weapon_bayonet")).ToDictionary(pair => pair.Key, pair => pair.Value);
|
var knifeTypes = weaponList.Where(pair => pair.Key.StartsWith("weapon_knife") || pair.Key.StartsWith("weapon_bayonet")).ToList();
|
||||||
|
|
||||||
|
if (knifeTypes.Count == 0)
|
||||||
|
{
|
||||||
|
Utility.Log("No valid knife types found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Random random = new();
|
Random random = new();
|
||||||
int index = random.Next(knifeTypes.Count);
|
int index = random.Next(knifeTypes.Count);
|
||||||
var randomKnifeClass = knifeTypes.Keys.ElementAt(index);
|
knifeToGive = knifeTypes[index].Key;
|
||||||
|
|
||||||
player.GiveNamedItem(randomKnifeClass);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var defaultKnife = (CsTeam)player.TeamNum == CsTeam.Terrorist ? "weapon_knife_t" : "weapon_knife";
|
knifeToGive = (CsTeam)player.TeamNum == CsTeam.Terrorist ? "weapon_knife_t" : "weapon_knife";
|
||||||
player.GiveNamedItem(defaultKnife);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.GiveNamedItem(knifeToGive);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool PlayerHasKnife(CCSPlayerController? player)
|
internal static bool PlayerHasKnife(CCSPlayerController? player)
|
||||||
@@ -120,205 +198,223 @@ namespace WeaponPaints
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void RefreshPlayerKnife(CCSPlayerController? player)
|
internal void RefreshWeapons(CCSPlayerController? player)
|
||||||
{
|
{
|
||||||
if (player == null || !player.IsValid || player.PlayerPawn.Value == null || !player.PawnIsAlive) return;
|
if (player == null || !player.IsValid || player.PlayerPawn?.Value == null || (LifeState_t)player.LifeState != LifeState_t.LIFE_ALIVE)
|
||||||
if (player.PlayerPawn.Value.WeaponServices == null || player.PlayerPawn.Value.ItemServices == null) return;
|
return;
|
||||||
|
|
||||||
|
if (player.PlayerPawn.Value.WeaponServices == null || player.PlayerPawn.Value.ItemServices == null)
|
||||||
|
return;
|
||||||
|
|
||||||
var weapons = player.PlayerPawn.Value.WeaponServices.MyWeapons;
|
var weapons = player.PlayerPawn.Value.WeaponServices.MyWeapons;
|
||||||
|
if (weapons == null || weapons.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (weapons != null && weapons.Count > 0)
|
if (weapons != null && weapons.Count > 0)
|
||||||
{
|
{
|
||||||
CCSPlayer_ItemServices service = new(player.PlayerPawn.Value.ItemServices.Handle);
|
//Dictionary<string, (int, int)> weaponsWithAmmo = new Dictionary<string, (int, int)>();
|
||||||
//var dropWeapon = VirtualFunction.CreateVoid<nint, nint>(service.Handle, GameData.GetOffset("CCSPlayer_ItemServices_DropActivePlayerWeapon"));
|
Dictionary<string, List<(int, int)>> weaponsWithAmmo = new Dictionary<string, List<(int, int)>>();
|
||||||
|
bool bomb = false;
|
||||||
|
bool defuser = player.PawnHasDefuser;
|
||||||
|
bool healthshot = false;
|
||||||
|
|
||||||
|
// Iterate through each weapon
|
||||||
foreach (var weapon in weapons)
|
foreach (var weapon in weapons)
|
||||||
{
|
{
|
||||||
if (weapon != null && weapon.IsValid && weapon.Value != null && weapon.Value.IsValid)
|
if (weapon == null || !weapon.IsValid || weapon.Value == null ||
|
||||||
{
|
!weapon.Value.IsValid || !weapon.Value.DesignerName.Contains("weapon_"))
|
||||||
//if (weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 42 || weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 59)
|
continue;
|
||||||
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
|
||||||
|
{
|
||||||
|
string? weaponByDefindex = null;
|
||||||
|
|
||||||
|
CCSWeaponBaseVData? weaponData = weapon.Value.As<CCSWeaponBase>().VData;
|
||||||
|
|
||||||
|
if (weaponData != null)
|
||||||
|
{
|
||||||
|
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) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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];
|
||||||
|
|
||||||
|
if (!weaponsWithAmmo.ContainsKey(weaponByDefindex))
|
||||||
|
{
|
||||||
|
weaponsWithAmmo.Add(weaponByDefindex, new List<(int, int)>());
|
||||||
|
}
|
||||||
|
|
||||||
|
weaponsWithAmmo[weaponByDefindex].Add((clip1, reservedAmmo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogWarning(ex.Message);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.RemoveWeapons();
|
||||||
|
AddTimer(0.1f, () =>
|
||||||
|
{
|
||||||
|
GiveKnifeToPlayer(player);
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
foreach (var entry in weaponsWithAmmo)
|
||||||
|
{
|
||||||
|
foreach (var ammo in entry.Value)
|
||||||
|
{
|
||||||
|
var newWeapon = new CBasePlayerWeapon(player.GiveNamedItem(entry.Key));
|
||||||
|
Server.NextFrame(() =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CEntityInstance? knife = Utilities.GetEntityFromIndex<CEntityInstance>(weaponEntityIndex);
|
if (newWeapon != null)
|
||||||
|
|
||||||
if (knife != null && knife.IsValid && knife.Handle != -1 && knife.Index > 0)
|
|
||||||
{
|
{
|
||||||
knife.Remove();
|
newWeapon.Clip1 = ammo.Item1;
|
||||||
|
newWeapon.ReserveAmmo[0] = ammo.Item2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogWarning("Error setting weapon properties: " + ex.Message);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}, TimerFlags.STOP_ON_MAPCHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void RefreshSkins(CCSPlayerController? player)
|
internal void RefreshKnife(CCSPlayerController? player)
|
||||||
{
|
{
|
||||||
return;
|
if (player == null || !player.IsValid || player.PlayerPawn?.Value == null || (LifeState_t)player.LifeState != LifeState_t.LIFE_ALIVE)
|
||||||
if (!Utility.IsPlayerValid(player) || !player!.PawnIsAlive) return;
|
return;
|
||||||
|
|
||||||
AddTimer(0.18f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3"));
|
if (player.PlayerPawn.Value.WeaponServices == null || player.PlayerPawn.Value.ItemServices == null)
|
||||||
AddTimer(0.25f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot2"));
|
return;
|
||||||
AddTimer(0.38f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot1"));
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void RefreshWeapons(CCSPlayerController? player)
|
|
||||||
{
|
|
||||||
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;
|
var weapons = player.PlayerPawn.Value.WeaponServices.MyWeapons;
|
||||||
if (weapons != null && weapons.Count > 0)
|
if (weapons != null && weapons.Count > 0)
|
||||||
{
|
{
|
||||||
CCSPlayer_ItemServices service = new(player.PlayerPawn.Value.ItemServices.Handle);
|
|
||||||
|
|
||||||
foreach (var weapon in weapons)
|
foreach (var weapon in weapons)
|
||||||
{
|
{
|
||||||
if (weapon != null && weapon.IsValid && weapon.Value != null && weapon.Value.IsValid)
|
if (weapon != null && weapon.IsValid && weapon.Value != null && weapon.Value.IsValid && weapon.Index > 0)
|
||||||
{
|
{
|
||||||
if (weapon.Index <= 0 || !weapon.Value.DesignerName.Contains("weapon_")) continue;
|
|
||||||
//if (weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 42 || weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 59)
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (weapon.Value.DesignerName.Contains("knife") || weapon.Value.DesignerName.Contains("bayonet"))
|
CCSWeaponBaseVData? weaponData = weapon.Value.As<CCSWeaponBase>().VData;
|
||||||
|
|
||||||
|
if (weapon.Value.DesignerName.Contains("knife") || weaponData?.GearSlot == gear_slot_t.GEAR_SLOT_KNIFE)
|
||||||
{
|
{
|
||||||
player.RemoveItemByDesignerName(weapon.Value.DesignerName, true);
|
RefreshWeapons(player);
|
||||||
GiveKnifeToPlayer(player);
|
break;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!weaponDefindex.ContainsKey(weapon.Value.AttributeManager.Item.ItemDefinitionIndex)) continue;
|
|
||||||
int clip1, reservedAmmo;
|
|
||||||
|
|
||||||
clip1 = weapon.Value.Clip1;
|
|
||||||
reservedAmmo = weapon.Value.ReserveAmmo[0];
|
|
||||||
|
|
||||||
string weaponByDefindex = weaponDefindex[weapon.Value.AttributeManager.Item.ItemDefinitionIndex];
|
|
||||||
player.RemoveItemByDesignerName(weapon.Value.DesignerName, true);
|
|
||||||
CBasePlayerWeapon newWeapon = new(player.GiveNamedItem(weaponByDefindex));
|
|
||||||
|
|
||||||
Server.NextFrame(() =>
|
|
||||||
{
|
|
||||||
if (newWeapon == null) return;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
newWeapon.Clip1 = clip1;
|
|
||||||
newWeapon.ReserveAmmo[0] = reservedAmmo;
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{ }
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.LogWarning("Refreshing weapons exception");
|
Logger.LogWarning($"Cannot remove knife: {ex.Message}");
|
||||||
Console.WriteLine("[WeaponPaints] Refreshing weapons exception");
|
|
||||||
Console.WriteLine(ex.Message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if (Config.Additional.SkinVisibilityFix)
|
|
||||||
RefreshSkins(player);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void RemovePlayerKnife(CCSPlayerController? player, bool force = false)
|
private static void RefreshGloves(CCSPlayerController player)
|
||||||
{
|
{
|
||||||
if (player == null || !player.IsValid || player.PlayerPawn.Value == null || !player.PawnIsAlive) return;
|
if (!Utility.IsPlayerValid(player) || (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;
|
CCSPlayerPawn? pawn = player.PlayerPawn.Value;
|
||||||
if (weapons != null && weapons.Count > 0)
|
if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string model = pawn.CBodyComponent?.SceneNode?.GetSkeletonInstance()?.ModelState.ModelName ?? string.Empty;
|
||||||
|
if (!string.IsNullOrEmpty(model))
|
||||||
{
|
{
|
||||||
CCSPlayer_ItemServices service = new CCSPlayer_ItemServices(player.PlayerPawn.Value.ItemServices.Handle);
|
pawn.SetModel("characters/models/tm_jumpsuit/tm_jumpsuit_varianta.vmdl");
|
||||||
//var dropWeapon = VirtualFunction.CreateVoid<nint, nint>(service.Handle, GameData.GetOffset("CCSPlayer_ItemServices_DropActivePlayerWeapon"));
|
pawn.SetModel(model);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var weapon in weapons)
|
Instance.AddTimer(0.06f, () =>
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (weapon != null && weapon.IsValid && weapon.Value != null && weapon.Value.IsValid)
|
if (!player.IsValid)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (g_playersGlove.TryGetValue(player.Index, out var gloveInfo) && gloveInfo != 0)
|
||||||
{
|
{
|
||||||
//if (weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 42 || weapon.Value.AttributeManager.Item.ItemDefinitionIndex == 59)
|
CCSPlayerPawn? pawn = player.PlayerPawn.Value;
|
||||||
if (weapon.Value.DesignerName.Contains("knife") || weapon.Value.DesignerName.Contains("bayonet"))
|
if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE)
|
||||||
{
|
return;
|
||||||
if (!force)
|
|
||||||
{
|
|
||||||
if ((int)weapon.Index <= 0) return;
|
|
||||||
int weaponEntityIndex = (int)weapon.Index;
|
|
||||||
NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3");
|
|
||||||
AddTimer(0.35f, () => service.DropActivePlayerWeapon(weapon.Value));
|
|
||||||
|
|
||||||
AddTimer(1.0f, () =>
|
WeaponInfo weaponInfo = gPlayerWeaponsInfo[(int)player.Index][gloveInfo];
|
||||||
{
|
|
||||||
CEntityInstance? knife = Utilities.GetEntityFromIndex<CEntityInstance>(weaponEntityIndex);
|
|
||||||
if (knife != null && knife.IsValid)
|
|
||||||
{
|
|
||||||
knife.Remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
weapon.Value.Remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
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)
|
private static int GetRandomPaint(int defindex)
|
||||||
{
|
{
|
||||||
|
if (skinsList == null || skinsList.Count == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (skinsList != null)
|
Random rnd = new Random();
|
||||||
{
|
|
||||||
Random rnd = new Random();
|
// Filter weapons by the provided defindex
|
||||||
// Filter weapons by the provided defindex
|
var filteredWeapons = skinsList.Where(w => w["weapon_defindex"]?.ToString() == defindex.ToString()).ToList();
|
||||||
var filteredWeapons = skinsList.FindAll(w => w["weapon_defindex"]?.ToString() == defindex.ToString());
|
|
||||||
|
if (filteredWeapons.Count == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
var randomWeapon = filteredWeapons[rnd.Next(filteredWeapons.Count)];
|
||||||
|
|
||||||
|
if (int.TryParse(randomWeapon["paint"]?.ToString(), out int paintValue))
|
||||||
|
return paintValue;
|
||||||
|
|
||||||
if (filteredWeapons.Count > 0)
|
|
||||||
{
|
|
||||||
var randomWeapon = filteredWeapons[rnd.Next(filteredWeapons.Count)];
|
|
||||||
if (int.TryParse(randomWeapon["paint"]?.ToString(), out int paintValue))
|
|
||||||
{
|
|
||||||
return paintValue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,6 +444,5 @@ namespace WeaponPaints
|
|||||||
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
public class WeaponInfo
|
public class WeaponInfo
|
||||||
{
|
{
|
||||||
public int Paint { get; set; }
|
public int Paint { get; set; }
|
||||||
public int Seed { get; set; }
|
public int Seed { get; set; } = 0;
|
||||||
public float Wear { get; set; }
|
public float Wear { get; set; } = 0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,16 +2,19 @@ using CounterStrikeSharp.API;
|
|||||||
using CounterStrikeSharp.API.Core;
|
using CounterStrikeSharp.API.Core;
|
||||||
using CounterStrikeSharp.API.Core.Attributes;
|
using CounterStrikeSharp.API.Core.Attributes;
|
||||||
using CounterStrikeSharp.API.Modules.Cvars;
|
using CounterStrikeSharp.API.Modules.Cvars;
|
||||||
|
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using MySqlConnector;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
namespace WeaponPaints;
|
namespace WeaponPaints;
|
||||||
|
|
||||||
[MinimumApiVersion(144)]
|
[MinimumApiVersion(168)]
|
||||||
public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
|
||||||
{
|
{
|
||||||
|
internal static WeaponPaints Instance { get; private set; } = new();
|
||||||
internal static readonly Dictionary<string, string> weaponList = new()
|
internal static readonly Dictionary<string, string> weaponList = new()
|
||||||
{
|
{
|
||||||
{"weapon_deagle", "Desert Eagle"},
|
{"weapon_deagle", "Desert Eagle"},
|
||||||
@@ -36,6 +39,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
{"weapon_negev", "Negev"},
|
{"weapon_negev", "Negev"},
|
||||||
{"weapon_sawedoff", "Sawed-Off"},
|
{"weapon_sawedoff", "Sawed-Off"},
|
||||||
{"weapon_tec9", "Tec-9"},
|
{"weapon_tec9", "Tec-9"},
|
||||||
|
{"weapon_taser", "Zeus x27"},
|
||||||
{"weapon_hkp2000", "P2000"},
|
{"weapon_hkp2000", "P2000"},
|
||||||
{"weapon_mp7", "MP7"},
|
{"weapon_mp7", "MP7"},
|
||||||
{"weapon_mp9", "MP9"},
|
{"weapon_mp9", "MP9"},
|
||||||
@@ -67,24 +71,31 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
{ "weapon_knife_cord", "Paracord Knife" },
|
{ "weapon_knife_cord", "Paracord Knife" },
|
||||||
{ "weapon_knife_canis", "Survival Knife" },
|
{ "weapon_knife_canis", "Survival Knife" },
|
||||||
{ "weapon_knife_outdoor", "Nomad Knife" },
|
{ "weapon_knife_outdoor", "Nomad Knife" },
|
||||||
{ "weapon_knife_skeleton", "Skeleton Knife" }
|
{ "weapon_knife_skeleton", "Skeleton Knife" },
|
||||||
|
{ "weapon_knife_kukri", "Kukri Knife" }
|
||||||
};
|
};
|
||||||
|
|
||||||
internal static WeaponPaintsConfig _config = new WeaponPaintsConfig();
|
internal static WeaponPaintsConfig _config = new WeaponPaintsConfig();
|
||||||
internal static IStringLocalizer? _localizer;
|
internal static IStringLocalizer? _localizer;
|
||||||
internal static Dictionary<int, int> g_knifePickupCount = new Dictionary<int, int>();
|
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, string> g_playersKnife = new ConcurrentDictionary<int, string>();
|
||||||
|
internal static ConcurrentDictionary<uint, ushort> g_playersGlove = new ConcurrentDictionary<uint, ushort>();
|
||||||
internal static ConcurrentDictionary<int, ConcurrentDictionary<int, WeaponInfo>> gPlayerWeaponsInfo = new ConcurrentDictionary<int, ConcurrentDictionary<int, WeaponInfo>>();
|
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> skinsList = new List<JObject>();
|
||||||
|
internal static List<JObject> glovesList = new List<JObject>();
|
||||||
internal static WeaponSynchronization? weaponSync;
|
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 Uri GlobalShareApi = new("https://weaponpaints.fun/api.php");
|
||||||
internal int GlobalShareServerId = 0;
|
internal int GlobalShareServerId = 0;
|
||||||
internal static Dictionary<int, DateTime> commandsCooldown = new Dictionary<int, DateTime>();
|
internal static Dictionary<int, DateTime> commandsCooldown = new Dictionary<int, DateTime>();
|
||||||
private string DatabaseConnectionString = string.Empty;
|
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" },
|
{ 1, "weapon_deagle" },
|
||||||
{ 2, "weapon_elite" },
|
{ 2, "weapon_elite" },
|
||||||
@@ -108,6 +119,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
{ 28, "weapon_negev" },
|
{ 28, "weapon_negev" },
|
||||||
{ 29, "weapon_sawedoff" },
|
{ 29, "weapon_sawedoff" },
|
||||||
{ 30, "weapon_tec9" },
|
{ 30, "weapon_tec9" },
|
||||||
|
{ 31, "weapon_taser" },
|
||||||
{ 32, "weapon_hkp2000" },
|
{ 32, "weapon_hkp2000" },
|
||||||
{ 33, "weapon_mp7" },
|
{ 33, "weapon_mp7" },
|
||||||
{ 34, "weapon_mp9" },
|
{ 34, "weapon_mp9" },
|
||||||
@@ -138,14 +150,15 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
{ 521, "weapon_knife_outdoor" },
|
{ 521, "weapon_knife_outdoor" },
|
||||||
{ 522, "weapon_knife_stiletto" },
|
{ 522, "weapon_knife_stiletto" },
|
||||||
{ 523, "weapon_knife_widowmaker" },
|
{ 523, "weapon_knife_widowmaker" },
|
||||||
{ 525, "weapon_knife_skeleton" }
|
{ 525, "weapon_knife_skeleton" },
|
||||||
|
{ 526, "weapon_knife_kukri" }
|
||||||
};
|
};
|
||||||
|
|
||||||
public WeaponPaintsConfig Config { get; set; } = new();
|
public WeaponPaintsConfig Config { get; set; } = new();
|
||||||
public override string ModuleAuthor => "Nereziel & daffyy";
|
public override string ModuleAuthor => "Nereziel & daffyy";
|
||||||
public override string ModuleDescription => "Skin and knife selector, standalone and web-based";
|
public override string ModuleDescription => "Skin, gloves and knife selector, standalone and web-based";
|
||||||
public override string ModuleName => "WeaponPaints";
|
public override string ModuleName => "WeaponPaints";
|
||||||
public override string ModuleVersion => "1.4b";
|
public override string ModuleVersion => "1.8c";
|
||||||
|
|
||||||
public static WeaponPaintsConfig GetWeaponPaintsConfig()
|
public static WeaponPaintsConfig GetWeaponPaintsConfig()
|
||||||
{
|
{
|
||||||
@@ -154,22 +167,21 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
|
|
||||||
public override void Load(bool hotReload)
|
public override void Load(bool hotReload)
|
||||||
{
|
{
|
||||||
if (!Config.GlobalShare)
|
Instance = this;
|
||||||
{
|
|
||||||
DatabaseConnectionString = Utility.BuildDatabaseConnectionString();
|
|
||||||
Utility.TestDatabaseConnection();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hotReload)
|
if (hotReload)
|
||||||
{
|
{
|
||||||
OnMapStart(string.Empty);
|
OnMapStart(string.Empty);
|
||||||
|
|
||||||
List<CCSPlayerController> players = Utilities.GetPlayers();
|
foreach (var player in Utilities.GetPlayers())
|
||||||
|
|
||||||
foreach (CCSPlayerController player in players)
|
|
||||||
{
|
{
|
||||||
if (player == null || !player.IsValid || player.IsBot || player.IsHLTV || player.SteamID.ToString() == "") continue;
|
if (weaponSync == null || player is null || !player.IsValid || player.SteamID.ToString().Length != 17 || !player.PawnIsAlive || player.IsBot ||
|
||||||
if (gPlayerWeaponsInfo.ContainsKey((int)player.Index)) continue;
|
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 _);
|
||||||
|
|
||||||
PlayerInfo playerInfo = new PlayerInfo
|
PlayerInfo playerInfo = new PlayerInfo
|
||||||
{
|
{
|
||||||
@@ -180,28 +192,27 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
IpAddress = player?.IpAddress?.Split(":")[0]
|
IpAddress = player?.IpAddress?.Split(":")[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Config.Additional.SkinEnabled && weaponSync != null)
|
if (Config.Additional.SkinEnabled)
|
||||||
_ = weaponSync.GetWeaponPaintsFromDatabase(playerInfo);
|
_ = weaponSync.GetWeaponPaintsFromDatabase(playerInfo);
|
||||||
if (Config.Additional.KnifeEnabled && weaponSync != null)
|
if (Config.Additional.KnifeEnabled)
|
||||||
_ = weaponSync.GetKnifeFromDatabase(playerInfo);
|
_ = weaponSync.GetKnifeFromDatabase(playerInfo);
|
||||||
|
if (Config.Additional.GloveEnabled)
|
||||||
g_knifePickupCount[(int)player!.Index] = 0;
|
_ = weaponSync.GetGloveFromDatabase(playerInfo);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
RegisterListeners();
|
|
||||||
RegisterCommands();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utility.LoadSkinsFromFile(ModuleDirectory + "/skins.json");
|
||||||
|
Utility.LoadGlovesFromFile(ModuleDirectory + "/gloves.json");
|
||||||
|
|
||||||
if (Config.Additional.KnifeEnabled)
|
if (Config.Additional.KnifeEnabled)
|
||||||
SetupKnifeMenu();
|
SetupKnifeMenu();
|
||||||
if (Config.Additional.SkinEnabled)
|
if (Config.Additional.SkinEnabled)
|
||||||
SetupSkinsMenu();
|
SetupSkinsMenu();
|
||||||
|
if (Config.Additional.GloveEnabled)
|
||||||
|
SetupGlovesMenu();
|
||||||
|
|
||||||
RegisterListeners();
|
RegisterListeners();
|
||||||
RegisterCommands();
|
RegisterCommands();
|
||||||
|
|
||||||
Utility.LoadSkinsFromFile(ModuleDirectory + "/skins.json");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnConfigParsed(WeaponPaintsConfig config)
|
public void OnConfigParsed(WeaponPaintsConfig config)
|
||||||
@@ -213,6 +224,20 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
Logger.LogError("You need to setup Database credentials in config!");
|
Logger.LogError("You need to setup Database credentials in config!");
|
||||||
throw new Exception("[WeaponPaints] 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;
|
||||||
@@ -253,7 +278,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
|||||||
Task<string> responseBodyTask = response.Content.ReadAsStringAsync();
|
Task<string> responseBodyTask = response.Content.ReadAsStringAsync();
|
||||||
responseBodyTask.Wait();
|
responseBodyTask.Wait();
|
||||||
string responseBody = responseBodyTask.Result;
|
string responseBody = responseBodyTask.Result;
|
||||||
GlobalShareServerId = Int32.Parse(responseBody);
|
GlobalShareServerId = int.Parse(responseBody);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.148" />
|
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.168" />
|
||||||
<PackageReference Include="Dapper" Version="2.1.28" />
|
<PackageReference Include="Dapper" Version="2.1.28" />
|
||||||
<PackageReference Include="MySqlConnector" Version="2.3.4" />
|
<PackageReference Include="MySqlConnector" Version="2.3.5" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Dapper;
|
using Dapper;
|
||||||
using MySqlConnector;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
@@ -8,13 +7,13 @@ namespace WeaponPaints
|
|||||||
internal class WeaponSynchronization
|
internal class WeaponSynchronization
|
||||||
{
|
{
|
||||||
private readonly WeaponPaintsConfig _config;
|
private readonly WeaponPaintsConfig _config;
|
||||||
private readonly string _databaseConnectionString;
|
private readonly Database _database;
|
||||||
private readonly Uri _globalShareApi;
|
private readonly Uri _globalShareApi;
|
||||||
private readonly int _globalShareServerId;
|
private readonly int _globalShareServerId;
|
||||||
|
|
||||||
internal WeaponSynchronization(string databaseConnectionString, WeaponPaintsConfig config, Uri globalShareApi, int globalShareServerId)
|
internal WeaponSynchronization(Database database, WeaponPaintsConfig config, Uri globalShareApi, int globalShareServerId)
|
||||||
{
|
{
|
||||||
_databaseConnectionString = databaseConnectionString;
|
_database = database;
|
||||||
_config = config;
|
_config = config;
|
||||||
_globalShareApi = globalShareApi;
|
_globalShareApi = globalShareApi;
|
||||||
_globalShareServerId = globalShareServerId;
|
_globalShareServerId = globalShareServerId;
|
||||||
@@ -64,21 +63,13 @@ namespace WeaponPaints
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var connection = new MySqlConnection(_databaseConnectionString))
|
await using var connection = await _database.GetConnectionAsync();
|
||||||
{
|
string query = "SELECT `knife` FROM `wp_player_knife` WHERE `steamid` = @steamid";
|
||||||
await connection.OpenAsync();
|
string? playerKnife = await connection.QueryFirstOrDefaultAsync<string>(query, new { steamid = player.SteamId });
|
||||||
string query = "SELECT `knife` FROM `wp_player_knife` WHERE `steamid` = @steamid";
|
|
||||||
string? PlayerKnife = await connection.QueryFirstOrDefaultAsync<string>(query, new { steamid = player.SteamId });
|
|
||||||
|
|
||||||
if (PlayerKnife != null)
|
if (!string.IsNullOrEmpty(playerKnife))
|
||||||
{
|
{
|
||||||
WeaponPaints.g_playersKnife[player.Index] = PlayerKnife;
|
WeaponPaints.g_playersKnife[player.Index] = playerKnife;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await connection.CloseAsync();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -88,10 +79,37 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal async Task GetGloveFromDatabase(PlayerInfo player)
|
||||||
|
{
|
||||||
|
if (!_config.Additional.GloveEnabled) return;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Ensure proper disposal of resources using "using" statement
|
||||||
|
await using var connection = await _database.GetConnectionAsync();
|
||||||
|
|
||||||
|
// Construct the SQL query with specific columns for better performance
|
||||||
|
string query = "SELECT `weapon_defindex` FROM `wp_player_gloves` WHERE `steamid` = @steamid";
|
||||||
|
|
||||||
|
// Execute the query and retrieve glove data
|
||||||
|
ushort? gloveData = await connection.QueryFirstOrDefaultAsync<ushort?>(query, new { steamid = player.SteamId });
|
||||||
|
|
||||||
|
// Check if glove data is retrieved successfully
|
||||||
|
if (gloveData != null)
|
||||||
|
{
|
||||||
|
// Update g_playersGlove dictionary with glove data
|
||||||
|
WeaponPaints.g_playersGlove[(uint)player.Index] = gloveData.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// Log any exceptions occurred during database operation
|
||||||
|
Utility.Log("An error occurred while fetching glove data: " + e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal async Task GetWeaponPaintsFromDatabase(PlayerInfo player)
|
internal async Task GetWeaponPaintsFromDatabase(PlayerInfo player)
|
||||||
{
|
{
|
||||||
if (!_config.Additional.SkinEnabled) return;
|
if (!_config.Additional.SkinEnabled) return;
|
||||||
if (player.SteamId == null || player.Index == 0) return;
|
|
||||||
|
|
||||||
if (!WeaponPaints.gPlayerWeaponsInfo.TryGetValue(player.Index, out _))
|
if (!WeaponPaints.gPlayerWeaponsInfo.TryGetValue(player.Index, out _))
|
||||||
{
|
{
|
||||||
@@ -150,36 +168,25 @@ namespace WeaponPaints
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var connection = new MySqlConnection(_databaseConnectionString))
|
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 });
|
||||||
|
|
||||||
|
foreach (var row in playerSkins)
|
||||||
{
|
{
|
||||||
await connection.OpenAsync();
|
int? weaponDefIndex = row.weapon_defindex;
|
||||||
|
int? weaponPaintId = row.weapon_paint_id;
|
||||||
|
float? weaponWear = row.weapon_wear;
|
||||||
|
int? weaponSeed = row.weapon_seed;
|
||||||
|
|
||||||
string query = "SELECT * FROM `wp_player_skins` WHERE `steamid` = @steamid";
|
WeaponInfo weaponInfo = new WeaponInfo
|
||||||
IEnumerable<dynamic> PlayerSkins = await connection.QueryAsync<dynamic>(query, new { steamid = player.SteamId });
|
|
||||||
|
|
||||||
if (PlayerSkins != null && PlayerSkins.AsList().Count > 0)
|
|
||||||
{
|
{
|
||||||
PlayerSkins.ToList().ForEach(row =>
|
Paint = weaponPaintId.HasValue ? weaponPaintId.Value : 0,
|
||||||
{
|
Seed = weaponSeed.HasValue ? weaponSeed.Value : 0,
|
||||||
int weaponDefIndex = row.weapon_defindex ?? default(int);
|
Wear = weaponWear.HasValue ? weaponWear.Value : 0f
|
||||||
int weaponPaintId = row.weapon_paint_id ?? default(int);
|
};
|
||||||
float weaponWear = row.weapon_wear ?? default(float);
|
|
||||||
int weaponSeed = row.weapon_seed ?? default(int);
|
|
||||||
|
|
||||||
WeaponInfo weaponInfo = new WeaponInfo
|
WeaponPaints.gPlayerWeaponsInfo[player.Index][weaponDefIndex.GetValueOrDefault()] = weaponInfo;
|
||||||
{
|
|
||||||
Paint = weaponPaintId,
|
|
||||||
Seed = weaponSeed,
|
|
||||||
Wear = weaponWear
|
|
||||||
};
|
|
||||||
WeaponPaints.gPlayerWeaponsInfo[player.Index][weaponDefIndex] = weaponInfo;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await connection.CloseAsync();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -192,28 +199,40 @@ namespace WeaponPaints
|
|||||||
internal async Task SyncKnifeToDatabase(PlayerInfo player, string knife)
|
internal async Task SyncKnifeToDatabase(PlayerInfo player, string knife)
|
||||||
{
|
{
|
||||||
if (!_config.Additional.KnifeEnabled) return;
|
if (!_config.Additional.KnifeEnabled) return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (player.SteamId == null || player.Index == 0) return;
|
await using var connection = await _database.GetConnectionAsync();
|
||||||
|
|
||||||
using var connection = new MySqlConnection(_databaseConnectionString);
|
|
||||||
await connection.OpenAsync();
|
|
||||||
string query = "INSERT INTO `wp_player_knife` (`steamid`, `knife`) VALUES(@steamid, @newKnife) ON DUPLICATE KEY UPDATE `knife` = @newKnife";
|
string query = "INSERT INTO `wp_player_knife` (`steamid`, `knife`) VALUES(@steamid, @newKnife) ON DUPLICATE KEY UPDATE `knife` = @newKnife";
|
||||||
await connection.ExecuteAsync(query, new { steamid = player.SteamId, newKnife = knife });
|
await connection.ExecuteAsync(query, new { steamid = player.SteamId, newKnife = knife });
|
||||||
await connection.CloseAsync();
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Utility.Log(e.Message);
|
Utility.Log(e.Message);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal async Task SyncGloveToDatabase(PlayerInfo player, ushort defindex)
|
||||||
|
{
|
||||||
|
if (!_config.Additional.GloveEnabled) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await using var connection = await _database.GetConnectionAsync();
|
||||||
|
string query = "INSERT INTO `wp_player_gloves` (`steamid`, `weapon_defindex`) VALUES(@steamid, @weapon_defindex, @paint) ON DUPLICATE KEY UPDATE `weapon_defindex` = @weapon_defindex";
|
||||||
|
await connection.ExecuteAsync(query, new { steamid = player.SteamId, weapon_defindex = defindex });
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Utility.Log(e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal async Task SyncWeaponPaintsToDatabase(PlayerInfo player)
|
internal async Task SyncWeaponPaintsToDatabase(PlayerInfo player)
|
||||||
{
|
{
|
||||||
if (player == null || player.Index <= 0 || player.SteamId == null) return;
|
if (player == null || player.Index <= 0 || player.SteamId == null) return;
|
||||||
|
|
||||||
using var connection = new MySqlConnection(_databaseConnectionString);
|
await using var connection = await _database.GetConnectionAsync();
|
||||||
await connection.OpenAsync();
|
|
||||||
|
|
||||||
if (!WeaponPaints.gPlayerWeaponsInfo.ContainsKey(player.Index))
|
if (!WeaponPaints.gPlayerWeaponsInfo.ContainsKey(player.Index))
|
||||||
return;
|
return;
|
||||||
@@ -227,23 +246,15 @@ namespace WeaponPaints
|
|||||||
float wear = weaponInfo.Wear;
|
float wear = weaponInfo.Wear;
|
||||||
int seed = weaponInfo.Seed;
|
int seed = weaponInfo.Seed;
|
||||||
|
|
||||||
string updateSql = "UPDATE `wp_player_skins` SET `weapon_paint_id` = @paintId, " +
|
string updateSql = "INSERT INTO `wp_player_skins` (`steamid`, `weapon_defindex`, " +
|
||||||
"`weapon_wear` = @wear, `weapon_seed` = @seed WHERE `steamid` = @steamid " +
|
"`weapon_paint_id`, `weapon_wear`, `weapon_seed`) " +
|
||||||
"AND `weapon_defindex` = @weaponDefIndex";
|
"VALUES (@steamid, @weaponDefIndex, @paintId, @wear, @seed) " +
|
||||||
|
"ON DUPLICATE KEY UPDATE `weapon_paint_id` = @paintId, " +
|
||||||
|
"`weapon_wear` = @wear, `weapon_seed` = @seed";
|
||||||
|
|
||||||
var updateParams = new { paintId, wear, seed, steamid = player.SteamId, weaponDefIndex };
|
var updateParams = new { steamid = player.SteamId, weaponDefIndex, paintId, wear, seed };
|
||||||
int rowsAffected = await connection.ExecuteAsync(updateSql, updateParams);
|
await connection.ExecuteAsync(updateSql, updateParams);
|
||||||
|
|
||||||
if (rowsAffected == 0)
|
|
||||||
{
|
|
||||||
string insertSql = "INSERT INTO `wp_player_skins` (`steamid`, `weapon_defindex`, " +
|
|
||||||
"`weapon_paint_id`, `weapon_wear`, `weapon_seed`) " +
|
|
||||||
"VALUES (@steamid, @weaponDefIndex, @paintId, @wear, @seed)";
|
|
||||||
|
|
||||||
await connection.ExecuteAsync(insertSql, updateParams);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
await connection.CloseAsync();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
16
gamedata/gloves.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,11 +3,14 @@
|
|||||||
"wp_info_website": "Visit {lime}{0}{default} where you can change skins",
|
"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_refresh": "Type {lime}!wp{default} to synchronize chosen skins",
|
||||||
"wp_info_knife": "Type {lime}!knife{default} to open knife menu",
|
"wp_info_knife": "Type {lime}!knife{default} to open knife menu",
|
||||||
|
"wp_info_glove": "Type {lime}!gloves{default} to open gloves menu",
|
||||||
"wp_command_cooldown": "{lightred}You can't refresh weapon paints right now",
|
"wp_command_cooldown": "{lightred}You can't refresh weapon paints right now",
|
||||||
"wp_command_refresh_done": "{lime}Refreshing weapon paints",
|
"wp_command_refresh_done": "{lime}Refreshing weapon paints",
|
||||||
"wp_knife_menu_select": "You have chosen {lime}{0}{default} as your knife",
|
"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_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_skin_menu_weapon_title": "Weapon Menu",
|
"wp_skin_menu_weapon_title": "Weapon Menu",
|
||||||
"wp_skin_menu_skin_title": "Select skin for {lime}{0}{default}",
|
"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"
|
||||||
|
|||||||
25
lang/lv.json
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[Ieroču Ādiņas] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "Apmeklē {lime}{0}{default} kur tu vari nomainīt skinus",
|
"wp_info_website": "Apmeklējiet {lime}{0}{default}, kur varat mainīt ādas",
|
||||||
"wp_info_refresh": "Raksti {lime}!wp{default} lai sinhronizētu izvēlētos skinus",
|
"wp_info_refresh": "Ievadiet {lime}!wp{default}, lai sinhronizētu izvēlētās ādas",
|
||||||
"wp_info_knife": "Raksti {lime}!knife{default} lai atvērtu nažu izvēlni",
|
"wp_info_knife": "Ievadiet {lime}!knife{default}, lai atvērtu nazis izvēlni",
|
||||||
"wp_command_cooldown": "{lightred} Tu šobrīd nevari atjaunot ieroču skinus...",
|
"wp_info_glove": "Ievadiet {lime}!gloves{default}, lai atvērtu cimdi izvēlni",
|
||||||
"wp_command_refresh_done": "{lime}Izvēlētie skini tiek atjaunoti",
|
"wp_command_cooldown": "{lightred}Šobrīd jūs nevarat atjaunot ieroču ādas",
|
||||||
"wp_knife_menu_select": "Tu esi izvēlējies {lime}{0}{default} nazi",
|
"wp_command_refresh_done": "{lime}Atjauno ieroču ādas",
|
||||||
"wp_knife_menu_kill": "Lai pareizi atjaunotu naža skinu, ieraksti čatā {lime}!kill{default}",
|
"wp_knife_menu_select": "Jūs esat izvēlējies {lime}{0}{default} kā savu nazi",
|
||||||
"wp_knife_menu_title": "Nažu Izvēlne",
|
"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_skin_menu_weapon_title": "Ieroču Izvēlne",
|
"wp_skin_menu_weapon_title": "Ieroču Izvēlne",
|
||||||
"wp_skin_menu_skin_title": "Izvēlies skinu ierocim: {lime}{0}{default}",
|
"wp_skin_menu_skin_title": "Izvēlieties ādu {lime}{0}{default}",
|
||||||
"wp_skin_menu_select": "Tu esi izvēlējies {lime}{0}{default} kā savu skinu"
|
"wp_skin_menu_select": "Jūs esat izvēlējies {lime}{0}{default} kā savu ādu"
|
||||||
}
|
}
|
||||||
|
|||||||
25
lang/pl.json
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "Odwiedź {lime}{0}{default} gdzie będziesz mógł ustawić skiny",
|
"wp_info_website": "Odwiedź {lime}{0}{default}, gdzie możesz zmieniać skórki",
|
||||||
"wp_info_refresh": "Wpisz {lime}!wp{default} aby zsynchronizować swoje skiny",
|
"wp_info_refresh": "Wpisz {lime}!wp{default}, aby zsynchronizować wybrane skórki",
|
||||||
"wp_info_knife": "Wpisz {lime}!knife{default} aby wy<EFBFBD>wietlić menu no<EFBFBD>y",
|
"wp_info_knife": "Wpisz {lime}!knife{default}, aby otworzyć menu noży",
|
||||||
"wp_command_cooldown": "{lightred}Odczekaj chwilę przed wykonaniem tej komendy...",
|
"wp_info_glove": "Wpisz {lime}!gloves{default}, aby otworzyć menu rękawiczek",
|
||||||
"wp_command_refresh_done": "{lime}Pomyslnie zsynchronizowano twoje skiny",
|
"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_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_kill": "",
|
||||||
"wp_knife_menu_title": "Menu noży",
|
"wp_knife_menu_title": "Menu Noży",
|
||||||
"wp_skin_menu_weapon_title": "Menu broni",
|
"wp_glove_menu_select": "Wybrałeś {lime}{0}{default} jako swoje rękawiczki",
|
||||||
"wp_skin_menu_skin_title": "Wybierz skin dla {lime}{0}{default}",
|
"wp_glove_menu_title": "Menu Rękawiczek",
|
||||||
"wp_skin_menu_select": "Wybrałeś {lime}{0}{default} jako swój skin"
|
"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ę"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "Visite {lime}{0}{default} para mudar suas skins e faca",
|
"wp_info_website": "Visite {lime}{0}{default}, onde você pode alterar skins",
|
||||||
"wp_info_refresh": "Digite {lime}!wp{default} para sincronizar as suas 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_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_info_glove": "Digite {lime}!gloves{default} para abrir o menu de luvas",
|
||||||
"wp_command_refresh_done": "{lime}Sincronizando as suas skins",
|
"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_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_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_skin_menu_weapon_title": "Menu de Armas",
|
"wp_skin_menu_weapon_title": "Menu de Armas",
|
||||||
"wp_skin_menu_skin_title": "Selecionou a skin para {lime}{0}{default}",
|
"wp_skin_menu_skin_title": "Selecione uma skin para {lime}{0}{default}",
|
||||||
"wp_skin_menu_select": "Você escolheu {lime}{0}{default} como sua skin"
|
"wp_skin_menu_select": "Você escolheu {lime}{0}{default} como sua skin"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "Visita {lime}{0}{default} onde podes mudar as tuas skins",
|
"wp_info_website": "Visite {lime}{0}{default}, onde pode alterar skins",
|
||||||
"wp_info_refresh": "Digita {lime}!wp{default} para sincronizar as tuas skins",
|
"wp_info_refresh": "Digite {lime}!wp{default} para sincronizar as skins selecionadas",
|
||||||
"wp_info_knife": "Digita {lime}!knife{default} para abrir o menu de facas",
|
"wp_info_knife": "Digite {lime}!knife{default} para abrir o menu de facas",
|
||||||
"wp_command_cooldown": "{lightred}Tu não podes sincronizar agora as tuas skins",
|
"wp_info_glove": "Digite {lime}!gloves{default} para abrir o menu de luvas",
|
||||||
"wp_command_refresh_done": "{lime}Sincronizando as tuas skins",
|
"wp_command_cooldown": "{lightred}Você não pode atualizar as skins de arma agora",
|
||||||
"wp_knife_menu_select": "Tu escolheste {lime}{0}{default} como a tua faca",
|
"wp_command_refresh_done": "{lime}Atualizando as skins de arma",
|
||||||
"wp_knife_menu_kill": "Para aplicar corretamente a skins para a tua faca, digita {lime}!kill{default}",
|
"wp_knife_menu_select": "Você escolheu {lime}{0}{default} como sua faca",
|
||||||
"wp_knife_menu_title": "Menu Facas",
|
"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_skin_menu_weapon_title": "Menu de Armas",
|
"wp_skin_menu_weapon_title": "Menu de Armas",
|
||||||
"wp_skin_menu_skin_title": "Escolhe a skin para {lime}{0}{default}",
|
"wp_skin_menu_skin_title": "Selecione uma skin para {lime}{0}{default}",
|
||||||
"wp_skin_menu_select": "Tu escolheste {lime}{0}{default} como a tua skin"
|
"wp_skin_menu_select": "Você escolheu {lime}{0}{default} como sua skin"
|
||||||
}
|
}
|
||||||
|
|||||||
23
lang/ru.json
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "Посетите сайт {lime}{0},{default} чтобы выбрать скин",
|
"wp_info_website": "Посетите {lime}{0}{default}, где вы можете изменить скины",
|
||||||
"wp_info_refresh": "Наберите в чат {lime}!wp{default} для синхронизации выбранных скинов",
|
"wp_info_refresh": "Введите {lime}!wp{default}, чтобы синхронизировать выбранные скины",
|
||||||
"wp_info_knife": "Наберите в чат {lime}!knife,{default} чтобы выбрать нож",
|
"wp_info_knife": "Введите {lime}!knife{default}, чтобы открыть меню ножей",
|
||||||
"wp_command_cooldown": "{lightred}Вы не можете выбрать оружие прямо сейчас",
|
"wp_info_glove": "Введите {lime}!gloves{default}, чтобы открыть меню перчаток",
|
||||||
"wp_command_refresh_done": "{lime}Обновление скинов для оружия",
|
"wp_command_cooldown": "{lightred}Вы не можете обновить скины оружия сейчас",
|
||||||
"wp_knife_menu_select": "Вы выбрали {lime}{0}{default} скин для ножа",
|
"wp_command_refresh_done": "{lime}Обновление скинов оружия",
|
||||||
"wp_knife_menu_kill": "Чтобы правильно применить скин для ножа, набери в чат {lime}!kill{default}",
|
"wp_knife_menu_select": "Вы выбрали {lime}{0}{default} в качестве вашего ножа",
|
||||||
"wp_knife_menu_title": "Меню ножей",
|
"wp_knife_menu_kill": "",
|
||||||
"wp_skin_menu_weapon_title": "Меню оружия",
|
"wp_knife_menu_title": "Меню Ножей",
|
||||||
|
"wp_glove_menu_select": "Вы выбрали {lime}{0}{default} в качестве ваших перчаток",
|
||||||
|
"wp_glove_menu_title": "Меню Перчаток",
|
||||||
|
"wp_skin_menu_weapon_title": "Меню Оружия",
|
||||||
"wp_skin_menu_skin_title": "Выберите скин для {lime}{0}{default}",
|
"wp_skin_menu_skin_title": "Выберите скин для {lime}{0}{default}",
|
||||||
"wp_skin_menu_select": "Вы выбрали {lime}{0}{default} скина для оружия"
|
"wp_skin_menu_select": "Вы выбрали {lime}{0}{default} в качестве вашего скина"
|
||||||
}
|
}
|
||||||
19
lang/tr.json
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "Görünümleri değiştirebileceğiniz {lime}{0}{default} adresini ziyaret edin",
|
"wp_info_website": "Ziyaret edin {lime}{0}{default}, burada skinleri değiştirebilirsiniz",
|
||||||
"wp_info_refresh": "Seçilen kaplamyı senkronize etmek için {lime}!wp{default} yazın",
|
"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_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_info_glove": "Eldiven menüsünü açmak için {lime}!gloves{default} yazın",
|
||||||
"wp_command_refresh_done": "{lime}Silah kaplaması yenileniyor",
|
"wp_command_cooldown": "{lightred}Şu anda silah skinlerini yenileyemezsiniz",
|
||||||
"wp_knife_menu_select": "Bıçağınız olarak {lime}{0}{default} seçtiniz",
|
"wp_command_refresh_done": "{lime}Silah skinleri yenileniyor",
|
||||||
"wp_knife_menu_kill": "Bıçak için doğru şekilde kaplama uygulamak için {lime}!kill{default} yazmanız gerekir",
|
"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_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_skin_menu_weapon_title": "Silah Menüsü",
|
"wp_skin_menu_weapon_title": "Silah Menüsü",
|
||||||
"wp_skin_menu_skin_title": "Select skin for {lime}{0}{default}",
|
"wp_skin_menu_skin_title": "{lime}{0}{default} için bir skin seçin",
|
||||||
"wp_skin_menu_select": "Teniniz olarak {lime}{0}{default} seçtiniz"
|
"wp_skin_menu_select": "{lime}{0}{default} olarak bir skin seçtiniz"
|
||||||
}
|
}
|
||||||
|
|||||||
25
lang/ua.json
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "Відвідайте веб-сайт {lime}{0},{default} щоб вибрати скин",
|
"wp_info_website": "Відвідайте {lime}{0}{default}, де ви можете змінити шкури",
|
||||||
"wp_info_refresh": "Напишіть у чат {lime}!wp{default} для синхронізації вибраних скинів",
|
"wp_info_refresh": "Введіть {lime}!wp{default}, щоб синхронізувати обрані шкури",
|
||||||
"wp_info_knife": "Напишіть у чат {lime}!knife,{default} щоб вибрати ніж",
|
"wp_info_knife": "Введіть {lime}!knife{default}, щоб відкрити меню ножів",
|
||||||
"wp_command_cooldown": "{lightred}Ви не можете вибрати зброю зараз",
|
"wp_info_glove": "Введіть {lime}!gloves{default}, щоб відкрити меню рукавичок",
|
||||||
"wp_command_refresh_done": "{lime}Оновлення скинів для зброї",
|
"wp_command_cooldown": "{lightred}Наразі ви не можете оновлювати шкіри зброї",
|
||||||
"wp_knife_menu_select": "Ви вибрали скин {lime}{0}{default} для ножа",
|
"wp_command_refresh_done": "{lime}Оновлення шкірок зброї",
|
||||||
"wp_knife_menu_kill": "Щоб правильно застосувати скин для ножа, напишіть у чат {lime}!kill{default}",
|
"wp_knife_menu_select": "Ви вибрали {lime}{0}{default} як ваш ніж",
|
||||||
"wp_knife_menu_title": "Меню ножів",
|
"wp_knife_menu_kill": "",
|
||||||
"wp_skin_menu_weapon_title": "Меню зброї",
|
"wp_knife_menu_title": "Меню Ножів",
|
||||||
"wp_skin_menu_skin_title": "Виберіть скин для {lime}{0}{default}",
|
"wp_glove_menu_select": "Ви вибрали {lime}{0}{default} як ваші рукавички",
|
||||||
"wp_skin_menu_select": "Ви вибрали скин {lime}{0}{default} для зброї"
|
"wp_glove_menu_title": "Меню Рукавичок",
|
||||||
|
"wp_skin_menu_weapon_title": "Меню Зброї",
|
||||||
|
"wp_skin_menu_skin_title": "Виберіть шкіру для {lime}{0}{default}",
|
||||||
|
"wp_skin_menu_select": "Ви вибрали {lime}{0}{default} як вашу шкіру"
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"wp_prefix": "{lightblue}[武器皮肤] {default}",
|
"wp_prefix": "{lightblue}[WeaponPaints] {default}",
|
||||||
"wp_info_website": "在线访问 {lime}{0}{default} 更改你的武器皮肤",
|
"wp_info_website": "访问 {lime}{0}{default},您可以更改皮肤",
|
||||||
"wp_info_refresh": "输入 {lime}!wp{default} 进行在线皮肤同步",
|
"wp_info_refresh": "输入 {lime}!wp{default} 同步已选择的皮肤",
|
||||||
"wp_info_knife": "输入 {lime}!knife{default} 打开刀菜单",
|
"wp_info_knife": "输入 {lime}!knife{default} 打开刀具菜单",
|
||||||
"wp_command_cooldown": "{lightred}皮肤同步刷新冷却中",
|
"wp_info_glove": "输入 {lime}!gloves{default} 打开手套菜单",
|
||||||
"wp_command_refresh_done": "{lime}刷新武器皮肤中",
|
"wp_command_cooldown": "{lightred}您现在无法刷新武器皮肤",
|
||||||
"wp_knife_menu_select": "你选择了 {lime}{0}{default} 作为你的刀",
|
"wp_command_refresh_done": "{lime}刷新武器皮肤",
|
||||||
"wp_knife_menu_kill": "如需完全应用皮肤到刀上, 你需要输入 {lime}!kill{default} 自杀来进行刷新",
|
"wp_knife_menu_select": "您已选择 {lime}{0}{default} 作为您的刀具",
|
||||||
"wp_knife_menu_title": "刀菜单",
|
"wp_knife_menu_kill": "",
|
||||||
|
"wp_knife_menu_title": "刀具菜单",
|
||||||
|
"wp_glove_menu_select": "您已选择 {lime}{0}{default} 作为您的手套",
|
||||||
|
"wp_glove_menu_title": "手套菜单",
|
||||||
"wp_skin_menu_weapon_title": "武器菜单",
|
"wp_skin_menu_weapon_title": "武器菜单",
|
||||||
"wp_skin_menu_skin_title": "选择 {lime}{0}{default} 的皮肤",
|
"wp_skin_menu_skin_title": "为 {lime}{0}{default} 选择皮肤",
|
||||||
"wp_skin_menu_select": "你选择了 {lime}{0}{default} 作为你的皮肤"
|
"wp_skin_menu_select": "您已选择 {lime}{0}{default} 作为您的皮肤"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ class UtilsClass
|
|||||||
521,
|
521,
|
||||||
522,
|
522,
|
||||||
523,
|
523,
|
||||||
525
|
525,
|
||||||
|
526
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
1
website/data/gloves.json
Normal file
12078
website/data/skins.json
@@ -8,7 +8,7 @@ $weapons = array (
|
|||||||
"weapon_aug" => 8,
|
"weapon_aug" => 8,
|
||||||
"weapon_awp" => 9,
|
"weapon_awp" => 9,
|
||||||
"weapon_famas" => 10,
|
"weapon_famas" => 10,
|
||||||
"weapon_g3sg1" => 10,
|
"weapon_g3sg1" => 11,
|
||||||
"weapon_galilar" => 13,
|
"weapon_galilar" => 13,
|
||||||
"weapon_m249" => 14,
|
"weapon_m249" => 14,
|
||||||
"weapon_m4a1" => 16,
|
"weapon_m4a1" => 16,
|
||||||
@@ -53,7 +53,14 @@ $weapons = array (
|
|||||||
"weapon_knife_stiletto" => 522,
|
"weapon_knife_stiletto" => 522,
|
||||||
"weapon_knife_widowmaker" => 523,
|
"weapon_knife_widowmaker" => 523,
|
||||||
"weapon_knife_skeleton" => 525);
|
"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>";
|
echo "<pre>";
|
||||||
foreach($json as $skin)
|
foreach($json as $skin)
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
website/img/skins/leather_handwraps-10009.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
website/img/skins/leather_handwraps-10010.png
Normal file
|
After Width: | Height: | Size: 171 KiB |
BIN
website/img/skins/leather_handwraps-10021.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
website/img/skins/leather_handwraps-10036.png
Normal file
|
After Width: | Height: | Size: 163 KiB |
BIN
website/img/skins/leather_handwraps-10053.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
website/img/skins/leather_handwraps-10054.png
Normal file
|
After Width: | Height: | Size: 175 KiB |
BIN
website/img/skins/leather_handwraps-10055.png
Normal file
|
After Width: | Height: | Size: 182 KiB |
BIN
website/img/skins/leather_handwraps-10056.png
Normal file
|
After Width: | Height: | Size: 166 KiB |
BIN
website/img/skins/leather_handwraps-10081.png
Normal file
|
After Width: | Height: | Size: 171 KiB |
BIN
website/img/skins/leather_handwraps-10082.png
Normal file
|
After Width: | Height: | Size: 179 KiB |
BIN
website/img/skins/leather_handwraps-10083.png
Normal file
|
After Width: | Height: | Size: 179 KiB |
BIN
website/img/skins/leather_handwraps-10084.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
website/img/skins/motorcycle_gloves-10024.png
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
website/img/skins/motorcycle_gloves-10026.png
Normal file
|
After Width: | Height: | Size: 237 KiB |
BIN
website/img/skins/motorcycle_gloves-10027.png
Normal file
|
After Width: | Height: | Size: 241 KiB |
BIN
website/img/skins/motorcycle_gloves-10028.png
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
website/img/skins/motorcycle_gloves-10049.png
Normal file
|
After Width: | Height: | Size: 242 KiB |
BIN
website/img/skins/motorcycle_gloves-10050.png
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
website/img/skins/motorcycle_gloves-10051.png
Normal file
|
After Width: | Height: | Size: 238 KiB |
BIN
website/img/skins/motorcycle_gloves-10052.png
Normal file
|
After Width: | Height: | Size: 238 KiB |
BIN
website/img/skins/motorcycle_gloves-10077.png
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
website/img/skins/motorcycle_gloves-10078.png
Normal file
|
After Width: | Height: | Size: 235 KiB |
BIN
website/img/skins/motorcycle_gloves-10079.png
Normal file
|
After Width: | Height: | Size: 240 KiB |
BIN
website/img/skins/motorcycle_gloves-10080.png
Normal file
|
After Width: | Height: | Size: 231 KiB |
BIN
website/img/skins/slick_gloves-10013.png
Normal file
|
After Width: | Height: | Size: 215 KiB |
BIN
website/img/skins/slick_gloves-10015.png
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
website/img/skins/slick_gloves-10016.png
Normal file
|
After Width: | Height: | Size: 215 KiB |
BIN
website/img/skins/slick_gloves-10040.png
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
website/img/skins/slick_gloves-10041.png
Normal file
|
After Width: | Height: | Size: 244 KiB |
BIN
website/img/skins/slick_gloves-10042.png
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
website/img/skins/slick_gloves-10043.png
Normal file
|
After Width: | Height: | Size: 228 KiB |
BIN
website/img/skins/slick_gloves-10044.png
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
website/img/skins/slick_gloves-10069.png
Normal file
|
After Width: | Height: | Size: 224 KiB |
BIN
website/img/skins/slick_gloves-10070.png
Normal file
|
After Width: | Height: | Size: 235 KiB |
BIN
website/img/skins/slick_gloves-10071.png
Normal file
|
After Width: | Height: | Size: 227 KiB |
BIN
website/img/skins/slick_gloves-10072.png
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
website/img/skins/specialist_gloves-10030.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
website/img/skins/specialist_gloves-10033.png
Normal file
|
After Width: | Height: | Size: 244 KiB |
BIN
website/img/skins/specialist_gloves-10034.png
Normal file
|
After Width: | Height: | Size: 253 KiB |
BIN
website/img/skins/specialist_gloves-10035.png
Normal file
|
After Width: | Height: | Size: 260 KiB |
BIN
website/img/skins/specialist_gloves-10061.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
website/img/skins/specialist_gloves-10062.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
website/img/skins/specialist_gloves-10063.png
Normal file
|
After Width: | Height: | Size: 245 KiB |
BIN
website/img/skins/specialist_gloves-10064.png
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
website/img/skins/specialist_gloves-10065.png
Normal file
|
After Width: | Height: | Size: 252 KiB |
BIN
website/img/skins/specialist_gloves-10066.png
Normal file
|
After Width: | Height: | Size: 257 KiB |
BIN
website/img/skins/specialist_gloves-10067.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
website/img/skins/specialist_gloves-10068.png
Normal file
|
After Width: | Height: | Size: 253 KiB |
BIN
website/img/skins/sporty_gloves-10018.png
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
website/img/skins/sporty_gloves-10019.png
Normal file
|
After Width: | Height: | Size: 249 KiB |
BIN
website/img/skins/sporty_gloves-10037.png
Normal file
|
After Width: | Height: | Size: 248 KiB |
BIN
website/img/skins/sporty_gloves-10038.png
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
website/img/skins/sporty_gloves-10045.png
Normal file
|
After Width: | Height: | Size: 257 KiB |
BIN
website/img/skins/sporty_gloves-10046.png
Normal file
|
After Width: | Height: | Size: 249 KiB |
BIN
website/img/skins/sporty_gloves-10047.png
Normal file
|
After Width: | Height: | Size: 269 KiB |
BIN
website/img/skins/sporty_gloves-10048.png
Normal file
|
After Width: | Height: | Size: 258 KiB |
BIN
website/img/skins/sporty_gloves-10073.png
Normal file
|
After Width: | Height: | Size: 251 KiB |
BIN
website/img/skins/sporty_gloves-10074.png
Normal file
|
After Width: | Height: | Size: 236 KiB |
BIN
website/img/skins/sporty_gloves-10075.png
Normal file
|
After Width: | Height: | Size: 234 KiB |
BIN
website/img/skins/sporty_gloves-10076.png
Normal file
|
After Width: | Height: | Size: 199 KiB |
BIN
website/img/skins/studded_bloodhound_gloves-10006.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
website/img/skins/studded_bloodhound_gloves-10007.png
Normal file
|
After Width: | Height: | Size: 187 KiB |
BIN
website/img/skins/studded_bloodhound_gloves-10008.png
Normal file
|
After Width: | Height: | Size: 200 KiB |
BIN
website/img/skins/studded_bloodhound_gloves-10039.png
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
website/img/skins/studded_brokenfang_gloves-10085.png
Normal file
|
After Width: | Height: | Size: 201 KiB |
BIN
website/img/skins/studded_brokenfang_gloves-10086.png
Normal file
|
After Width: | Height: | Size: 196 KiB |
BIN
website/img/skins/studded_brokenfang_gloves-10087.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
website/img/skins/studded_brokenfang_gloves-10088.png
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
website/img/skins/studded_hydra_gloves-10057.png
Normal file
|
After Width: | Height: | Size: 177 KiB |
BIN
website/img/skins/studded_hydra_gloves-10058.png
Normal file
|
After Width: | Height: | Size: 187 KiB |