Forum

> > CS2D > Scripts > Mute Lua
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Mute Lua

11 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Mute Lua

Jhony
User Off Offline

Zitieren
Pls create the script

!mute
!unmute

help me D=

alt Re: Mute Lua

Apache uwu
User Off Offline

Zitieren
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
addhook("say","_say")
addhook("sayteam","_sayteam")

addhook("join","_join")

admins={89367}
muted={}

function is_admin(usgn)
	for _,id in pairs(admins) do
		if usgn==id then
			return true
		end
	end
	return false
end

function _say(id,message)
	if is_admin(player(id,"usgn")) then
		if string.sub(message,1,6)=="!mute " then
			local id2=tonumber(string.sub(message,7))
			if id2 and player(id2,"exists") then
				muted[id2]=true
				msg(string.char(169).."255000000"..player(id2,"name").." has been muted.")
				return 1
			end
		elseif string.sub(message,1,8)=="!unmute " then
			local id2=tonumber(string.sub(message,9))
			if id2 and player(id2,"exists") then
				muted[id2]=false
				msg(string.char(169).."255000000"..player(id2,"name").." has been unmuted.")
				return 1
			end
		end
	elseif muted[id]==true then
		return 1
	end
end

function _join(id)
	muted[id]=nil
end

function _sayteam(id)
	if muted[id]==true then
		return 1
	end
end

alt Re: Mute Lua

Jhony
User Off Offline

Zitieren
user Apache uwu hat geschrieben
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
addhook("say","_say")
addhook("sayteam","_sayteam")

addhook("join","_join")

admins={89367}
muted={}

function is_admin(usgn)
	for _,id in pairs(admins) do
		if usgn==id then
			return true
		end
	end
	return false
end

function _say(id,message)
	if is_admin(player(id,"usgn")) then
		if string.sub(message,1,6)=="!mute " then
			local id2=tonumber(string.sub(message,7))
			if id2 and player(id2,"exists") then
				muted[id2]=true
				msg(string.char(169).."255000000"..player(id2,"name").." has been muted.")
				return 1
			end
		elseif string.sub(message,1,8)=="!unmute " then
			local id2=tonumber(string.sub(message,9))
			if id2 and player(id2,"exists") then
				muted[id2]=false
				msg(string.char(169).."255000000"..player(id2,"name").." has been unmuted.")
				return 1
			end
		end
	elseif muted[id]==true then
		return 1
	end
end

function _join(id)
	muted[id]=nil
end

function _sayteam(id)
	if muted[id]==true then
		return 1
	end
end

works , but no mute the player
help pls

alt Re: Mute Lua

Apache uwu
User Off Offline

Zitieren
Well it works, and you haven't described any errors. The only problem with this is that you can just rejoin, regardless most mute scripts I've seen work that way.

To be more "advanced" you need to store a table of IPs or USIDs--however since you are a leecher I don't feel much like helping you. ×

alt Re: Mute Lua

Jhony
User Off Offline

Zitieren
user Apache uwu hat geschrieben
Well it works, and you haven't described any errors. The only problem with this is that you can just rejoin, regardless most mute scripts I've seen work that way.

To be more "advanced" you need to store a table of IPs or USIDs--however since you are a leecher I don't feel much like helping you. ×


no works
look:

http://imageshack.us/photo/my-images/441/nowork.png/

alt Re: Mute Lua

Jhony
User Off Offline

Zitieren
user J4x hat geschrieben
Maybe you can't mute yourself..


Yes, I Already Muted Other players, and does not work

alt Re: Mute Lua

Suprise
BANNED Off Offline

Zitieren
I tested it! And its work!
I play with 2 player! Me and me!
But the second me do not login to CS2D account! Its work

alt Re: Mute Lua

krabob
User Off Offline

Zitieren
@user Jhony: Well, maybe you're using another script which contains a function with say. Try to use this by itself or just try to implement it into your scripts other function with the say hook.

alt Re: Mute Lua

Jhony
User Off Offline

Zitieren
user krabob hat geschrieben
@user Jhony: Well, maybe you're using another script which contains a function with say. Try to use this by itself or just try to implement it into your scripts other function with the say hook.


So has this script in my "server.lua"
Do not have another script within

alt Re: Mute Lua

Jhony
User Off Offline

Zitieren
user Apache uwu hat geschrieben
You can't mute admins -.- duh


@user Apache uwu: nevertheless
Mute not without Admin
Do not nobody Mute
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@topic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ismuted={}
for id=1,32 do
ismuted[id]=false
end

addhook("say","muteply")
function muteply(id,t)
     if (t:sub(1,5)=="!mute") then
          local mid=tonumber(t:sub(6))
          ismuted[mid]=true
     end
     if (ismuted[id]) then
          return 1
     end
end

add "!nomute"
pls?
1× editiert, zuletzt 11.03.12 00:36:24
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht