Forum

> > CS2D > Scripts > mute is not working
Forums overviewCS2D overview Scripts overviewLog in to reply

English mute is not working

2 replies
To the start Previous 1 Next To the start

old mute is not working

StrikerD2000
BANNED Off Offline

Quote
idk why. before you say don't do anything for him
i am working on admin commands
i finished all thing
kick & ban & freeze & unfreeze & slap & equip & all thing
but idk how to do mute
before you say anything
i searched on unrealsoftware.de about mute
i founded 2 files
but they are not working for me, idk why
just... need mute script
and if you are going to send the code, do NOT add admin for the mute

( the error was: if i muted the player he still can talk, and i can't add 2 admins in mute )
edited 1×, last 03.02.17 07:37:43 am

old Re: mute is not working

Baloon
GAME BANNED Off Offline

Quote
You don't need to make thread each you get a simple problem like this, you can post in your another thread,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
muted={}
for id = 1, 32 do
	muted[id] = false
end

addhook("say","sayhook")
function sayhook(id,txt)
	if not muted[id] then
		if txt:sub(1,5)=="!mute" then
			muted[id]=true
			return 1
		elseif txt:sub(1,7)=="!unmute" then
			muted[id]=false
			return 1
		end
	else
		return 1
	end
end

Error? Post the error here (with image or with the log) and post the entire code you have done.

I also recommend you to use command table for this, like this one:

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
cmds = {
	[1]={
		cmd="!kick";
		action=function(me,target)
				if admin[me] and player(target,"exists") then
					msg(player(me,"name").." kicked "..player(target,"name"))
					parse("kick "..target)
				end
			end;
	};
	[2]={
		cmd="!kill";
		action=function(me,target)
				if admin[me] and player(target,"exists") then
					msg(player(me,"name").." killed "..player(target,"name"))
					parse("killplayer "..target)
				end
			end;
	};
}

addhook("say","sayhook2")
function sayhook2(id,txt)
	for cs = 1, #cmds do
		if txt:sub(1,1)=="!" then
			if txt:sub(1,txt:len(cmds[cs].cmd)) == cmds[cs].cmd then
				cmds[cs].action(id,txt:sub(txt:len(cmds[cs].cmd)+2))
			end
		end
	end
end
edited 1×, last 03.02.17 06:56:10 am

old Re: mute is not working

StrikerD2000
BANNED Off Offline

Quote
@user Baloon:

enough i don't need help any more
i am very f**king stupid
after i finish the admin script
I've deleted by mistake
just if the mod see this comment
delete the thread
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview