【CSGO】[demo]實現(xiàn)一鍵將語音音量調(diào)整為零(不是關閉語音)
前言
靜音某個玩家的指令為
(這個指令不能使用toggle前綴實現(xiàn)一鍵切換狀態(tài),原因我也不道)
voice_player_volume 0 0
取消靜音為
voice_player_volume 0?1
末尾的0/1為開關,中間的0代表玩家編號
基于上述內(nèi)容我們可以實現(xiàn)一鍵靜音以及一鍵解除靜音

進入CSGO安裝目錄

打開“csgo”文件夾再打開"cfg"文件夾

創(chuàng)建兩個cfg文件,名稱全英文,自定義即可,最好自己能認識,用拼音也可以,兩個文件的作用分別為一鍵靜音和取消靜音
(也可以使用alias命令在一個文件內(nèi)編輯,比如autoexec文件,但是我覺得太麻煩了,不如直接兩個文件來得方便)

用記事本或者任意編輯器打開第一個cfg文件(我使用vscode)
在一鍵靜音文件內(nèi)輸入以下內(nèi)容,一行一條就行
voice_player_volume 0 0
voice_player_volume 1 0
voice_player_volume 2 0
voice_player_volume 3 0
voice_player_volume 4 0
voice_player_volume 5 0
voice_player_volume 6 0
voice_player_volume 7 0
voice_player_volume 8 0
voice_player_volume 9 0
voice_player_volume 10 0
voice_player_volume 11 0
voice_player_volume 12 0
voice_player_volume 13 0
voice_player_volume 14 0
上屏后如圖

另一個文件輸入以下內(nèi)容,格式同上
voice_player_volume 0 1
voice_player_volume 1 1
voice_player_volume 2 1
voice_player_volume 3 1
voice_player_volume 4 1
voice_player_volume 5 1
voice_player_volume 6 1
voice_player_volume 7 1
voice_player_volume 8 1
voice_player_volume 9 1
voice_player_volume 10 1
voice_player_volume 11 1
voice_player_volume 12 1
voice_player_volume 13 1
voice_player_volume 14 1
接著直接在控制臺輸入以下兩個指令即可
bind X?"exec xxxxx"
bind X?"exec xxxxx"
兩條命令對應兩個文件兩個按鍵,紅色的X替換為自己想要的按鍵,按鍵列表可以看評論我發(fā)的鏈接,綠色的一串代表文件名,注意要去掉.cfg的后綴,例如文件名為mute.cfg,那對應的命令應為exec mute

注意事項
如果按下按鍵后控制臺有如下提示

Player# is invalid. Use voice_player_volume to find a list of players
就是告訴你找不到編號為這個數(shù)字的玩家,叫你用“voice_player_volume”命令查看玩家對應的編號,因為這個編號每局都不同,且如果有人掛機,退出重進之類的會有變動,所以我直接打到了0-14,在按下按鍵之后可以看到控制臺輸出以下內(nèi)容“set volume for xxxx to 0.00”一局十個玩家,都靜音了就會像圖上一樣輸出十條

如果少了一個或幾個就用“voice_player_volume”命令看,然后“voice_player_volume x?0”
以上只是一種思路,還有很多方法實現(xiàn),自行探索