Forum

> > CS2D > Scripts > Mute and Unmute script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Mute and Unmute script

2 replies
To the start Previous 1 Next To the start

old Mute and Unmute script

Talented Doge
User Off Offline

Quote
I've been working on the Mutee/Unmute script today, but it just won't work -- although the messages are shown properly.

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
mutet = {}

addhook("say", "os.say")
function os.say(aser, txt)
for _, usgn in ipairs(Admins) do
	...
	...
	...
	elseif txt:sub(1,5) == "!mute" and player(aser, "usgn") == usgn then
		local muter = tonumber(txt:sub(7,8))
		if mutet[muter] == 0 then
			mutet[muter] = 1
			msg ("©000255255Player "..player(muter, "name").." is muted!")
		else
			msg2 (aser, "©000255255Player "..player(muter, "name").." is already muted!")
		end
		return 1
	elseif txt:sub(1,7) == "!unmute" and player(aser, "usgn") == usgn then
		local muterx = tonumber(txt:sub(9,10))
		if mutet[muterx] == 1 then
			mutet[muterx] = 0
			msg ("©000255255Player "..player(muterx, "name").." is no longer muted!")
		else
			msg2 (aser, "©000255255Player "..player(muterx, "name").." is not muted!")
		end
		return 1
	elseif mutet[aser] == 1 then
		msg2 ("©255000000You are muted!")
		return 1
	end
	end
end

...
...
...

addhook("join", "os.join")
function os.join(id)
	for _, usgn in ipairs(Admins) do
	...
	...
	...
	end
	mutet[id] = 0
	end
end

old Re: Mute and Unmute script

VADemon
User Off Offline

Quote
lines 27-29 are inside the only-admin-commands part. Move it either before, after it or into a new say hook.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview