Forum
CS2D Scripts !Mute Command!Mute Command
6 replies 1
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
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
function initArray(a,v) 	local array = {} 	for i = 1, a do 		array[i] = v 	end 	return array end mute = initArray(32,false) admintable = {70919} function checkadmin(id) 	for _, u in ipairs(admintable) do 		if player(id,"usgn") == u then 			return true 		end 	end 	return false end addhook("say","muted") function muted(id,msg) 	if checkadmin(id) then 		if msg:sub(1,5) == "!mute" then 			local victim = tonumber(msg:sub(7)) 			if mute[victim] == false then 				mute[victim] = true 				msg2(id,"©000255000You muted "..player(victim,"name").."!") 				msg2(victim,"©255000000You been muted by "..player(id,"name").."!") 			elseif mute[victim] == true then 				mute[victim] = false 				msg2(id,"©255000000You unmuted "..player(victim,"name").."!") 				msg2(victim,"©000255000You been unmuted by "..player(id,"name").."!") 			end 			return 1 		end 	else 		if mute[id] == true then 			msg2(id,"©255000000You are muted, so you can't say anything!") 			return 1 		end 	end 	return 0 end
edited 1×, last 17.08.11 01:39:40 pm
Cure Pikachu has written
Here you go.
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
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
function initArray(a,v) 	local array = {} 	for i = 1, a do 		array[i] = v 	end 	return array end mute = initArray(32,false) admintable = {70919} function checkadmin(id) 	for _, u in ipairs(admintable) do 		if player(id,"usgn") == u then 			return true 		end 	end 	return false end addhook("say","muted") function muted(id,msg) 	if checkadmin(id) then 		if msg:sub(1,5) == "!mute" then 			local victim = tonumber(msg:sub(7)) 			if mute[victim] == false then 				mute[victim] = true 				msg2(id,"©000255000You muted "..player(victim,"name").."!") 				msg2(victim,"©255000000You been muted by "..player(id,"name").."!") 			elseif mute[victim] == true then 				mute[victim] = false 				msg2(id,"©255000000You unmuted "..player(victim,"name").."!") 				msg2(victim,"©000255000You been unmuted by "..player(id,"name").."!") 			end 			return 1 		end 	else 		if mute[id] == true then 			msg2(id,"©255000000You are muted, so you can't say anything!) 			return 1 		end 	end 	return 0 end
great! its better then writeable only console mute lua. THANKS!
1
2
3
4
5
6
7
2
3
4
5
6
7
if mute[id] == true then msg2(id,"©255000000You are muted, so you can't say anything!) <----- Put " return 1 end end return 0 end
it should be
1
2
3
4
5
6
7
2
3
4
5
6
7
if mute[id] == true then msg2(id,"©255000000You are muted, so you can't say anything!") return 1 end end return 0 end
Thanks for pointing that out for me. Careless mistake, they say.
1