diff --git a/Commands.cs b/Commands.cs index 60cf86ce..de71a884 100644 --- a/Commands.cs +++ b/Commands.cs @@ -538,6 +538,11 @@ public partial class WeaponPaints AddTimer(2.0f, () => _playerWeaponImage.Remove(player.Slot), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE); } + if (!string.IsNullOrEmpty(Localizer["wp_glove_menu_select"])) + { + player.Print(Localizer["wp_glove_menu_select", selectedPaintName]); + } + PlayerInfo playerInfo = new PlayerInfo { UserId = player.UserId, diff --git a/Events.cs b/Events.cs index e6e28252..602131df 100644 --- a/Events.cs +++ b/Events.cs @@ -291,7 +291,7 @@ namespace WeaponPaints if (!HasChangedKnife(player, out var _) || !HasChangedPaint(player, weaponDefIndex, out var _)) return HookResult.Continue; - if (player is { Connected: PlayerConnectedState.PlayerConnected, PawnIsAlive: true, PlayerPawn.IsValid: true }) + if (player is { Connected: PlayerConnectedState.Connected, PawnIsAlive: true, PlayerPawn.IsValid: true }) { GiveOnItemPickup(player); } diff --git a/VERSION b/VERSION index f4dd46c7..29aa8ba2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2a +3.3a \ No newline at end of file diff --git a/WeaponAction.cs b/WeaponAction.cs index 78b79b3e..50f7faf4 100644 --- a/WeaponAction.cs +++ b/WeaponAction.cs @@ -385,18 +385,13 @@ namespace WeaponPaints if (pawn == null || !pawn.IsValid) return; - var model = pawn.CBodyComponent?.SceneNode?.GetSkeletonInstance()?.ModelState.ModelName ?? string.Empty; - if (!string.IsNullOrEmpty(model)) - { - pawn.SetModel("characters/models/tm_jumpsuit/tm_jumpsuit_varianta.vmdl"); - pawn.SetModel(model); - } - CEconItemView item = pawn.EconGloves; item.NetworkedDynamicAttributes.Attributes.RemoveAll(); item.AttributeList.Attributes.RemoveAll(); + //force gloves model refresh to prevent model overlap + player.ExecuteClientCommand("lastinv"); Instance.AddTimer(0.08f, () => { try @@ -426,10 +421,13 @@ namespace WeaponPaints CAttributeListSetOrAddAttributeValueByName.Invoke(item.AttributeList.Handle, "set item texture prefab", weaponInfo.Paint); CAttributeListSetOrAddAttributeValueByName.Invoke(item.AttributeList.Handle, "set item texture seed", weaponInfo.Seed); CAttributeListSetOrAddAttributeValueByName.Invoke(item.AttributeList.Handle, "set item texture wear", weaponInfo.Wear); - - item.Initialized = true; - SetBodygroup(pawn, "default_gloves", 1); + item.Initialized = true; + + //force gloves model refresh to prevent model overlap + player.ExecuteClientCommand("lastinv"); + SetBodygroup(pawn, "first_or_third_person", 0); + AddTimer(0.2f, () => SetBodygroup(pawn, "first_or_third_person", 1), TimerFlags.STOP_ON_MAPCHANGE); } catch (Exception) { } }, TimerFlags.STOP_ON_MAPCHANGE); @@ -493,7 +491,7 @@ namespace WeaponPaints Server.NextFrame(() => { player.PlayerPawn.Value.SetModel( - $"characters/models/{model}.vmdl" + $"agents/models/{model}.vmdl" ); }); } diff --git a/WeaponPaints.cs b/WeaponPaints.cs index 8638cd83..88eace73 100644 --- a/WeaponPaints.cs +++ b/WeaponPaints.cs @@ -20,7 +20,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig "Nereziel & daffyy"; public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based"; public override string ModuleName => "WeaponPaints"; - public override string ModuleVersion => "3.2b"; + public override string ModuleVersion => "3.3a"; public override void Load(bool hotReload) { @@ -47,7 +47,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig(Utilities.GetPlayers().TakeWhile(_ => WeaponSync != null)) .Where(player => player.IsValid && !string.IsNullOrEmpty(player.IpAddress) && player is - { IsBot: false, Connected: PlayerConnectedState.PlayerConnected })) + { IsBot: false, Connected: PlayerConnectedState.Connected })) { var playerInfo = new PlayerInfo { diff --git a/WeaponPaints.csproj b/WeaponPaints.csproj index fb7a8537..3c4094aa 100644 --- a/WeaponPaints.csproj +++ b/WeaponPaints.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/website/data/agents_en.json b/website/data/agents_en.json index d5aa4fe5..c1665790 100644 --- a/website/data/agents_en.json +++ b/website/data/agents_en.json @@ -10,5 +10,383 @@ "image": "", "model": "null", "agent_name": "Agent | Default" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4613.png", + "model": "tm_professional/tm_professional_varf5", + "agent_name": "Bloody Darryl The Strapped | The Professionals" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4619.png", + "model": "ctm_st6/ctm_st6_variantj", + "agent_name": "'Blueberries' Buckshot | NSWC SEAL" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4680.png", + "model": "ctm_st6/ctm_st6_variantl", + "agent_name": "'Two Times' McCoy | TACP Cavalry" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4711.png", + "model": "ctm_swat/ctm_swat_variante", + "agent_name": "Cmdr. Mae 'Dead Cold' Jamison | SWAT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4712.png", + "model": "ctm_swat/ctm_swat_variantf", + "agent_name": "1st Lieutenant Farlow | SWAT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4713.png", + "model": "ctm_swat/ctm_swat_variantg", + "agent_name": "John 'Van Healen' Kask | SWAT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4714.png", + "model": "ctm_swat/ctm_swat_varianth", + "agent_name": "Bio-Haz Specialist | SWAT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4715.png", + "model": "ctm_swat/ctm_swat_varianti", + "agent_name": "Sergeant Bombson | SWAT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4716.png", + "model": "ctm_swat/ctm_swat_variantj", + "agent_name": "Chem-Haz Specialist | SWAT" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4718.png", + "model": "tm_balkan/tm_balkan_variantk", + "agent_name": "Rezan the Redshirt | Sabre" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4726.png", + "model": "tm_professional/tm_professional_varf", + "agent_name": "Sir Bloody Miami Darryl | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4727.png", + "model": "tm_professional/tm_professional_varg", + "agent_name": "Safecracker Voltzmann | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4728.png", + "model": "tm_professional/tm_professional_varh", + "agent_name": "Little Kev | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4730.png", + "model": "tm_professional/tm_professional_varj", + "agent_name": "Getaway Sally | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4732.png", + "model": "tm_professional/tm_professional_vari", + "agent_name": "Number K | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4733.png", + "model": "tm_professional/tm_professional_varf1", + "agent_name": "Sir Bloody Silent Darryl | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4734.png", + "model": "tm_professional/tm_professional_varf2", + "agent_name": "Sir Bloody Skullhead Darryl | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4735.png", + "model": "tm_professional/tm_professional_varf3", + "agent_name": "Sir Bloody Darryl Royale | The Professionals" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4736.png", + "model": "tm_professional/tm_professional_varf4", + "agent_name": "Sir Bloody Loudmouth Darryl | The Professionals" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4749.png", + "model": "ctm_gendarmerie/ctm_gendarmerie_varianta", + "agent_name": "Sous-Lieutenant Medic | Gendarmerie Nationale" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4750.png", + "model": "ctm_gendarmerie/ctm_gendarmerie_variantb", + "agent_name": "Chem-Haz Capitaine | Gendarmerie Nationale" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4751.png", + "model": "ctm_gendarmerie/ctm_gendarmerie_variantc", + "agent_name": "Chef d'Escadron Rouchard | Gendarmerie Nationale" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4752.png", + "model": "ctm_gendarmerie/ctm_gendarmerie_variantd", + "agent_name": "Aspirant | Gendarmerie Nationale" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4753.png", + "model": "ctm_gendarmerie/ctm_gendarmerie_variante", + "agent_name": "Officer Jacques Beltram | Gendarmerie Nationale" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4756.png", + "model": "ctm_swat/ctm_swat_variantk", + "agent_name": "Lieutenant 'Tree Hugger' Farlow | SWAT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4757.png", + "model": "ctm_diver/ctm_diver_varianta", + "agent_name": "Cmdr. Davida 'Goggles' Fernandez | SEAL Frogman" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4771.png", + "model": "ctm_diver/ctm_diver_variantb", + "agent_name": "Cmdr. Frank 'Wet Sox' Baroud | SEAL Frogman" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4772.png", + "model": "ctm_diver/ctm_diver_variantc", + "agent_name": "Lieutenant Rex Krikey | SEAL Frogman" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4773.png", + "model": "tm_jungle_raider/tm_jungle_raider_varianta", + "agent_name": "Elite Trapper Solman | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4774.png", + "model": "tm_jungle_raider/tm_jungle_raider_variantb", + "agent_name": "Crasswater The Forgotten | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4775.png", + "model": "tm_jungle_raider/tm_jungle_raider_variantc", + "agent_name": "Arno The Overgrown | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4776.png", + "model": "tm_jungle_raider/tm_jungle_raider_variantd", + "agent_name": "Col. Mangos Dabisi | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4777.png", + "model": "tm_jungle_raider/tm_jungle_raider_variante", + "agent_name": "Vypa Sista of the Revolution | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4778.png", + "model": "tm_jungle_raider/tm_jungle_raider_variantf", + "agent_name": "Trapper Aggressor | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4780.png", + "model": "tm_jungle_raider/tm_jungle_raider_variantb2", + "agent_name": "'Medium Rare' Crasswater | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-4781.png", + "model": "tm_jungle_raider/tm_jungle_raider_variantf2", + "agent_name": "Trapper | Guerrilla Warfare" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5105.png", + "model": "tm_leet/tm_leet_variantg", + "agent_name": "Ground Rebel | Elite Crew" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5106.png", + "model": "tm_leet/tm_leet_varianth", + "agent_name": "Osiris | Elite Crew" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5107.png", + "model": "tm_leet/tm_leet_varianti", + "agent_name": "Prof. Shahmat | Elite Crew" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5108.png", + "model": "tm_leet/tm_leet_variantf", + "agent_name": "The Elite Mr. Muhlik | Elite Crew" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5109.png", + "model": "tm_leet/tm_leet_variantj", + "agent_name": "Jungle Rebel | Elite Crew" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5205.png", + "model": "tm_phoenix/tm_phoenix_varianth", + "agent_name": "Soldier | Phoenix" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5206.png", + "model": "tm_phoenix/tm_phoenix_variantf", + "agent_name": "Enforcer | Phoenix" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5207.png", + "model": "tm_phoenix/tm_phoenix_variantg", + "agent_name": "Slingshot | Phoenix" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5208.png", + "model": "tm_phoenix/tm_phoenix_varianti", + "agent_name": "Street Soldier | Phoenix" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5305.png", + "model": "ctm_fbi/ctm_fbi_variantf", + "agent_name": "Operator | FBI SWAT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5306.png", + "model": "ctm_fbi/ctm_fbi_variantg", + "agent_name": "Markus Delrow | FBI HRT" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5307.png", + "model": "ctm_fbi/ctm_fbi_varianth", + "agent_name": "Michael Syfers | FBI Sniper" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5308.png", + "model": "ctm_fbi/ctm_fbi_variantb", + "agent_name": "Special Agent Ava | FBI" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5400.png", + "model": "ctm_st6/ctm_st6_variantk", + "agent_name": "3rd Commando Company | KSK" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5401.png", + "model": "ctm_st6/ctm_st6_variante", + "agent_name": "Seal Team 6 Soldier | NSWC SEAL" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5402.png", + "model": "ctm_st6/ctm_st6_variantg", + "agent_name": "Buckshot | NSWC SEAL" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5403.png", + "model": "ctm_st6/ctm_st6_variantm", + "agent_name": "'Two Times' McCoy | USAF TACP" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5404.png", + "model": "ctm_st6/ctm_st6_varianti", + "agent_name": "Lt. Commander Ricksaw | NSWC SEAL" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5405.png", + "model": "ctm_st6/ctm_st6_variantn", + "agent_name": "Primeiro Tenente | Brazilian 1st Battalion" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5500.png", + "model": "tm_balkan/tm_balkan_variantf", + "agent_name": "Dragomir | Sabre" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5501.png", + "model": "tm_balkan/tm_balkan_varianti", + "agent_name": "Maximus | Sabre" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5502.png", + "model": "tm_balkan/tm_balkan_variantg", + "agent_name": "Rezan The Ready | Sabre" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5503.png", + "model": "tm_balkan/tm_balkan_variantj", + "agent_name": "Blackwolf | Sabre" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5504.png", + "model": "tm_balkan/tm_balkan_varianth", + "agent_name": "'The Doctor' Romanov | Sabre" + }, + { + "team": 2, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5505.png", + "model": "tm_balkan/tm_balkan_variantl", + "agent_name": "Dragomir | Sabre Footsoldier" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5601.png", + "model": "ctm_sas/ctm_sas_variantf", + "agent_name": "B Squadron Officer | SAS" + }, + { + "team": 3, + "image": "https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/agent-5602.png", + "model": "ctm_sas/ctm_sas_variantg", + "agent_name": "D Squadron Officer | NZSAS" } ] \ No newline at end of file