From 1b0249f26b60464de830f3dc59d4fe489b1bea90 Mon Sep 17 00:00:00 2001 From: e2ectronic <3356207189@qq.com> Date: Sat, 27 May 2023 08:20:39 +0800 Subject: [PATCH] small fix --- addons/sourcemod/scripting/weapons.sp | 21 ++++++++++++------- .../translations/chi/weapons.phrases.txt | 4 ++++ .../translations/weapons.phrases.txt | 4 ++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/addons/sourcemod/scripting/weapons.sp b/addons/sourcemod/scripting/weapons.sp index 7ab1812..b1fce13 100644 --- a/addons/sourcemod/scripting/weapons.sp +++ b/addons/sourcemod/scripting/weapons.sp @@ -206,14 +206,21 @@ public Action CommandWeaponSkins(int client, int args) { if (args > 0) { - char searchSkinName[32]; - GetCmdArgString(searchSkinName, sizeof(searchSkinName)); - - Menu resultMenu = SearchSkins(client, searchSkinName); - menuPlayerSearchTemp[client] = resultMenu; - resultMenu.Display(client, menuTime); - + if (g_bEnableSearch) + { + char searchSkinName[32]; + GetCmdArgString(searchSkinName, sizeof(searchSkinName)); + + Menu resultMenu = SearchSkins(client, searchSkinName); + menuPlayerSearchTemp[client] = resultMenu; + resultMenu.Display(client, menuTime); + } + else + { + PrintToChat(client, " %s \x02%T", g_ChatPrefix, "SearchDisabled"); + } return Plugin_Handled; + } CreateMainMenu(client).Display(client, menuTime); diff --git a/addons/sourcemod/translations/chi/weapons.phrases.txt b/addons/sourcemod/translations/chi/weapons.phrases.txt index 2fa8da2..b90be3a 100644 --- a/addons/sourcemod/translations/chi/weapons.phrases.txt +++ b/addons/sourcemod/translations/chi/weapons.phrases.txt @@ -56,6 +56,10 @@ { "chi" "名称标签已禁用" } + "SearchDisabled" + { + "chi" "搜索功能已禁用" + } "SearchApplyAll" { "chi" "应用所有皮肤" diff --git a/addons/sourcemod/translations/weapons.phrases.txt b/addons/sourcemod/translations/weapons.phrases.txt index fcf9b7d..c8ba327 100644 --- a/addons/sourcemod/translations/weapons.phrases.txt +++ b/addons/sourcemod/translations/weapons.phrases.txt @@ -68,6 +68,10 @@ { "en" "Use: !nametag " } + "SearchDisabled" + { + "en" "Skin search is disabled at the moment." + } "SearchApplyAll" { "en" "Apply to all"