diff --git a/Commands.cs b/Commands.cs index b5cef8b7..2895a984 100644 --- a/Commands.cs +++ b/Commands.cs @@ -96,6 +96,12 @@ private void OnCommandWS(CCSPlayerController? player, CommandInfo command) player!.Print(Localizer["wp_info_glove"]); } + if (Config.Additional.AgentEnabled) + if (!string.IsNullOrEmpty(Localizer["wp_info_agent"])) + { + player!.Print(Localizer["wp_info_agent"]); + } + if (Config.Additional.KnifeEnabled) if (!string.IsNullOrEmpty(Localizer["wp_info_knife"])) { diff --git a/Events.cs b/Events.cs index 3a7aae47..237eb30a 100644 --- a/Events.cs +++ b/Events.cs @@ -1,8 +1,6 @@ using CounterStrikeSharp.API; using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Core.Attributes.Registration; -using CounterStrikeSharp.API.Modules.Memory; -using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions; namespace WeaponPaints { @@ -243,6 +241,7 @@ private HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info) return HookResult.Continue; } + /* public HookResult OnGiveNamedItemPost(DynamicHook hook) { var itemServices = hook.GetParam(0); @@ -256,6 +255,7 @@ public HookResult OnGiveNamedItemPost(DynamicHook hook) return HookResult.Continue; } + */ public void OnEntitySpawned(CEntityInstance entity) { @@ -301,7 +301,7 @@ private void RegisterListeners() RegisterEventHandler(OnRoundEnd); RegisterListener(OnEntitySpawned); RegisterListener(OnTick); - VirtualFunctions.GiveNamedItemFunc.Hook(OnGiveNamedItemPost, HookMode.Post); + //VirtualFunctions.GiveNamedItemFunc.Hook(OnGiveNamedItemPost, HookMode.Post); } } } \ No newline at end of file diff --git a/Utility.cs b/Utility.cs index 5dc86957..e3564a41 100644 --- a/Utility.cs +++ b/Utility.cs @@ -44,24 +44,24 @@ internal static async Task CheckDatabaseTables() string[] createTableQueries = new[] { @"CREATE TABLE IF NOT EXISTS `wp_player_skins` ( - `steamid` varchar(64) NOT NULL, + `steamid` varchar(18) NOT NULL, `weapon_defindex` int(6) NOT NULL, `weapon_paint_id` int(6) NOT NULL, `weapon_wear` float NOT NULL DEFAULT 0.000001, `weapon_seed` int(16) NOT NULL DEFAULT 0 ) ENGINE=InnoDB", @"CREATE TABLE IF NOT EXISTS `wp_player_knife` ( - `steamid` varchar(64) NOT NULL, + `steamid` varchar(18) NOT NULL, `knife` varchar(64) NOT NULL, UNIQUE (`steamid`) ) ENGINE = InnoDB", @"CREATE TABLE IF NOT EXISTS `wp_player_gloves` ( - `steamid` varchar(64) NOT NULL, + `steamid` varchar(18) NOT NULL, `weapon_defindex` int(11) NOT NULL, UNIQUE (`steamid`) ) ENGINE=InnoDB", @"CREATE TABLE `wp_player_agents` ( - `steamid` varchar(64) NOT NULL, + `steamid` varchar(18) NOT NULL, `agent_ct` varchar(64) DEFAULT NULL, `agent_t` varchar(64) DEFAULT NULL, UNIQUE KEY `steamid` (`steamid`) diff --git a/VERSION b/VERSION index bac91872..535769df 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2b \ No newline at end of file +2.2c \ No newline at end of file diff --git a/WeaponAction.cs b/WeaponAction.cs index 64120557..81e30672 100644 --- a/WeaponAction.cs +++ b/WeaponAction.cs @@ -305,7 +305,7 @@ public static void GivePlayerAgent(CCSPlayerController player) Server.NextFrame(() => { string? model = player.TeamNum == 3 ? g_playersAgent[player.Slot].CT : g_playersAgent[player.Slot].T; - if (model == null) return; + if (string.IsNullOrEmpty(model)) return; player.PlayerPawn.Value!.SetModel( $"characters/models/{model}.vmdl" diff --git a/WeaponPaints.cs b/WeaponPaints.cs index 5217f07e..8020df1f 100644 --- a/WeaponPaints.cs +++ b/WeaponPaints.cs @@ -10,7 +10,7 @@ namespace WeaponPaints; -[MinimumApiVersion(178)] +[MinimumApiVersion(191)] public partial class WeaponPaints : BasePlugin, IPluginConfig { internal static WeaponPaints Instance { get; private set; } = new(); @@ -158,7 +158,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 => "2.2b"; + public override string ModuleVersion => "2.2c"; public static WeaponPaintsConfig GetWeaponPaintsConfig() { diff --git a/WeaponPaints.csproj b/WeaponPaints.csproj index d5a83a91..a3fbf5e7 100644 --- a/WeaponPaints.csproj +++ b/WeaponPaints.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/lang/en.json b/lang/en.json index 4612605b..34eebeba 100644 --- a/lang/en.json +++ b/lang/en.json @@ -4,6 +4,7 @@ "wp_info_refresh": "Type {lime}!wp{default} to synchronize chosen skins", "wp_info_knife": "Type {lime}!knife{default} to open knife menu", "wp_info_glove": "Type {lime}!gloves{default} to open gloves menu", + "wp_info_agent": "Type {lime}!agents{default} to open agents menu", "wp_command_cooldown": "{lightred}You can't refresh weapon paints right now", "wp_command_refresh_done": "{lime}Refreshing weapon paints", "wp_knife_menu_select": "You have chosen {lime}{0}{default} as your knife", diff --git a/lang/lv.json b/lang/lv.json index b4c0b30f..96fbeeca 100644 --- a/lang/lv.json +++ b/lang/lv.json @@ -4,6 +4,7 @@ "wp_info_refresh": "Ievadiet {lime}!wp{default}, lai sinhronizētu izvēlētās ādas", "wp_info_knife": "Ievadiet {lime}!knife{default}, lai atvērtu nazis izvēlni", "wp_info_glove": "Ievadiet {lime}!gloves{default}, lai atvērtu cimdi izvēlni", + "wp_info_agent": "Ierakstiet {lime}!agents{default}, lai atvērtu aģentu izvēlni", "wp_command_cooldown": "{lightred}Šobrīd jūs nevarat atjaunot ieroču ādas", "wp_command_refresh_done": "{lime}Atjauno ieroču ādas", "wp_knife_menu_select": "Jūs esat izvēlējies {lime}{0}{default} kā savu nazi", diff --git a/lang/pl.json b/lang/pl.json index 608753d0..cd3ff681 100644 --- a/lang/pl.json +++ b/lang/pl.json @@ -4,6 +4,7 @@ "wp_info_refresh": "Wpisz {lime}!wp{default}, aby zsynchronizować wybrane skórki", "wp_info_knife": "Wpisz {lime}!knife{default}, aby otworzyć menu noży", "wp_info_glove": "Wpisz {lime}!gloves{default}, aby otworzyć menu rękawiczek", + "wp_info_agent": "Wpisz {lime}!agents{default}, aby otworzyć menu agentów", "wp_command_cooldown": "{lightred}Nie możesz teraz odświeżyć skórek broni", "wp_command_refresh_done": "{lime}Odświeżanie skórek broni", "wp_knife_menu_select": "Wybrałeś {lime}{0}{default} jako swój nóż", diff --git a/lang/pt-BR.json b/lang/pt-BR.json index c3590acb..98926304 100644 --- a/lang/pt-BR.json +++ b/lang/pt-BR.json @@ -4,6 +4,7 @@ "wp_info_refresh": "Digite {lime}!wp{default} para sincronizar as skins selecionadas", "wp_info_knife": "Digite {lime}!knife{default} para abrir o menu de facas", "wp_info_glove": "Digite {lime}!gloves{default} para abrir o menu de luvas", + "wp_info_agent": "Digite {lime}!agents{default} para abrir o menu de agentes", "wp_command_cooldown": "{lightred}Você não pode atualizar as skins de arma agora", "wp_command_refresh_done": "{lime}Atualizando as skins de arma", "wp_knife_menu_select": "Você escolheu {lime}{0}{default} como sua faca", diff --git a/lang/pt-PT.json b/lang/pt-PT.json index a00250f8..fa32a676 100644 --- a/lang/pt-PT.json +++ b/lang/pt-PT.json @@ -4,6 +4,7 @@ "wp_info_refresh": "Digite {lime}!wp{default} para sincronizar as skins selecionadas", "wp_info_knife": "Digite {lime}!knife{default} para abrir o menu de facas", "wp_info_glove": "Digite {lime}!gloves{default} para abrir o menu de luvas", + "wp_info_agent": "Digite {lime}!agents{default} para abrir o menu de agentes", "wp_command_cooldown": "{lightred}Você não pode atualizar as skins de arma agora", "wp_command_refresh_done": "{lime}Atualizando as skins de arma", "wp_knife_menu_select": "Você escolheu {lime}{0}{default} como sua faca", diff --git a/lang/ru.json b/lang/ru.json index bbd7e87b..d2f91a71 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -4,6 +4,7 @@ "wp_info_refresh": "Введите {lime}!wp{default}, чтобы синхронизировать выбранные скины", "wp_info_knife": "Введите {lime}!knife{default}, чтобы открыть меню ножей", "wp_info_glove": "Введите {lime}!gloves{default}, чтобы открыть меню перчаток", + "wp_info_agent": "Введите {lime}!agents{default}, чтобы открыть меню агентов", "wp_command_cooldown": "{lightred}Вы не можете обновить скины оружия сейчас", "wp_command_refresh_done": "{lime}Обновление скинов оружия", "wp_knife_menu_select": "Вы выбрали {lime}{0}{default} в качестве вашего ножа", diff --git a/lang/tr.json b/lang/tr.json index 583ff378..b88be7c7 100644 --- a/lang/tr.json +++ b/lang/tr.json @@ -4,6 +4,7 @@ "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_glove": "Eldiven menüsünü açmak için {lime}!gloves{default} yazın", + "wp_info_agent": "Ajanlar menüsünü açmak için {lime}!agents{default} yazın", "wp_command_cooldown": "{lightred}Şu anda silah skinlerini yenileyemezsiniz", "wp_command_refresh_done": "{lime}Silah skinleri yenileniyor", "wp_knife_menu_select": "{lime}{0}{default} olarak bıçağınızı seçtiniz", diff --git a/lang/ua.json b/lang/ua.json index a7a3546f..5c5f4f51 100644 --- a/lang/ua.json +++ b/lang/ua.json @@ -4,6 +4,7 @@ "wp_info_refresh": "Введіть {lime}!wp{default}, щоб синхронізувати обрані шкури", "wp_info_knife": "Введіть {lime}!knife{default}, щоб відкрити меню ножів", "wp_info_glove": "Введіть {lime}!gloves{default}, щоб відкрити меню рукавичок", + "wp_info_agent": "Введіть {lime}!агенти{default}, щоб відкрити меню агентів", "wp_command_cooldown": "{lightred}Наразі ви не можете оновлювати шкіри зброї", "wp_command_refresh_done": "{lime}Оновлення шкірок зброї", "wp_knife_menu_select": "Ви вибрали {lime}{0}{default} як ваш ніж", diff --git a/lang/zh-cn.json b/lang/zh-cn.json index 633eb71e..dd6ce336 100644 --- a/lang/zh-cn.json +++ b/lang/zh-cn.json @@ -4,6 +4,7 @@ "wp_info_refresh": "输入 {lime}!wp{default} 同步已选择的皮肤", "wp_info_knife": "输入 {lime}!knife{default} 打开刀具菜单", "wp_info_glove": "输入 {lime}!gloves{default} 打开手套菜单", + "wp_info_agent": "键入 {lime}!agents{default} 打开代理菜单", "wp_command_cooldown": "{lightred}您现在无法刷新武器皮肤", "wp_command_refresh_done": "{lime}刷新武器皮肤", "wp_knife_menu_select": "您已选择 {lime}{0}{default} 作为您的刀具",