-
Notifications
You must be signed in to change notification settings - Fork 0
/
muteplayer.lua
75 lines (57 loc) · 1.97 KB
/
muteplayer.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
local PLUGIN = PLUGIN
PLUGIN.name = "Mute players"
PLUGIN.author = "cmaul github.com/CMAULTOP"
PLUGIN.description = "A plugin that allows you to hook up a player through a scoreboard or all at once."
--[[
ВСТАВИТЬ В helix\gamemode\core\derma\cl_scoreboard.lua в 129 строку с заменой
INSERT INTO helix\gamemode\core\derma\cl_scoreboard.lua in line 129 with replacement
self.icon.DoRightClick = function()
local client = self.player
if (!IsValid(client)) then
return
end
local menu = DermaMenu()
menu:AddOption(L("viewProfile"), function()
client:ShowProfile()
end):SetImage("icon16/user_suit.png")
menu:AddOption(L("copySteamID"), function()
SetClipboardText(client:IsBot() and client:EntIndex() or client:SteamID())
end):SetImage("icon16/link.png")
if !(self.player == LocalPlayer()) then
menu:AddOption(client:IsMuted() and "Размутить" or "Замутить", function()
if client:IsMuted() then
client:SetMuted( false )
else
client:SetMuted( true )
end
end):SetImage(client:IsMuted() and "icon16/sound_mute.png" or "icon16/sound.png")
end
hook.Run("PopulateScoreboardPlayerMenu", client, menu)
menu:Open()
end
]]--
ix.option.Add("VoiceEnable", ix.type.bool, false, {
category = "chat",
OnChanged = function()
if (ix.option.Get("VoiceEnable", true)) then
for i, ply in ipairs( player.GetAll() ) do
ply:SetMuted( true )
end
else
for i, ply in ipairs( player.GetAll() ) do
ply:SetMuted( false )
end
end
end
})
ix.lang.AddTable("russian", {
optVoiceEnable = "Выключить голосовой чат",
optdVoiceEnable = "Включает или выключает голосовой чат. Мутит всех игроков на сервере."
})
function Schema:PlayerLoadedCharacter()
if (ix.option.Get("VoiceEnable", true)) then
for i, ply in ipairs( player.GetAll() ) do
ply:SetMuted( true )
end
end
end