Author Topic: Client Side Mute  (Read 6321 times)

0 Members and 1 Guest are viewing this topic.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Client Side Mute
« on: March 30, 2013, 05:51:45 PM »
I got tired of having to rely on an admin to mute some one because they are mic spamming so I made this little script...

Code: [Select]
-- Client Side Player Muting --
concommand.Add( "mute", function(ply,_,args)
for _,v in pairs(player.GetAll()) do
if( (string.find( string.lower(v:Nick()), string.lower(tostring(args[1]))) ~= nil and args[1] != "_") or tostring(v:SteamID()) == tostring(args[2]) ) then
v:SetMuted(true)
                        chat.AddText(Color(0,0,0), "", Color(168,168,168), v:Nick() .. " has been muted!")
end
end
end)
concommand.Add( "unmute", function(ply,_,args)
for _,v in pairs(player.GetAll()) do
if( (string.find( string.lower(v:Nick()), string.lower(tostring(args[1]))) ~= nil and args[1] != "_") or tostring(v:SteamID()) == tostring(args[2]) ) then
v:SetMuted(false)
chat.AddText(Color(0,0,0), "", Color(168,168,168), v:Nick() .. " has been unmuted!")
end
end
end)

I guess I should now work on a command that lets you list who is currently muted or not. :P
I cry every time I see that I am not a respected member of this community.

Offline Bizzclaw

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • Frostburnt Foundation
Re: Client Side Mute
« Reply #1 on: April 13, 2013, 05:11:55 PM »
It would be nice if it wouldn't let you mute admins. Just return false if target.isadmin?

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Re: Client Side Mute
« Reply #2 on: August 23, 2014, 08:06:44 PM »
I really hate Reviving old topics especially being so new to the forum but I have to express my appreciation, +1 karma cause my script is broken, however muting admins IS a good idea.

may want to edit OP in regards to where to place the script for those who don't know.
now that its kind of sorta unintentionally been bumped. its going to get somebody's attention. let's face it old scripts might need a good bump now and then cause who really goes through all the script pages just to browse.
« Last Edit: August 23, 2014, 08:10:03 PM by chaoswolf »
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Client Side Mute
« Reply #3 on: August 24, 2014, 12:03:02 AM »
Considering there's only a few pages of Release topics, it's not that difficult.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Re: Client Side Mute
« Reply #4 on: August 24, 2014, 01:35:43 AM »
refer to your statement once more when considering how many people even look at page 2 of google searches.
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer