English Mute Lua

11 replies
Goto Page
To the start Previous 1 Next To the start
09.03.12 09:52:38 pm
Up
Jhony
User
Offline Off
Pls create the script

!mute
!unmute

help me D=
10.03.12 12:15:26 am
Up
PyKemis
User
Offline Off
Code:
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
10.03.12 03:27:43 am
Up
Jhony
User
Offline Off
user PyKemis has written:
Code:
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
10.03.12 05:52:45 am
Up
PyKemis
User
Offline Off
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. ×
10.03.12 05:56:23 pm
Up
Jhony
User
Offline Off
user PyKemis has written:
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/
10.03.12 06:21:57 pm
Up
J4x
User
Offline Off
Maybe you can't mute yourself..
10.03.12 06:40:56 pm
Up
Jhony
User
Offline Off
user J4x has written:
Maybe you can't mute yourself..


Yes, I Already Muted Other players, and does not work
10.03.12 07:14:55 pm
Up
Suprise
BANNED
Offline Off
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
10.03.12 08:46:22 pm
Up
krabob
User
Offline Off
@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.
People help the people
10.03.12 08:56:27 pm
Up
Jhony
User
Offline Off
user krabob has written:
@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
10.03.12 10:45:20 pm
Up
PyKemis
User
Offline Off
You can't mute admins -.- duh
10.03.12 11:37:20 pm
Up
Jhony
User
Offline Off
user PyKemis has written:
You can't mute admins -.- duh


@user PyKemis: nevertheless
Mute not without Admin
Do not nobody Mute
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@topic
Code:
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?
edited 1×, last 11.03.12 12:36:24 am
To the start Previous 1 Next To the start