Author Topic: Shadow Mute  (Read 5415 times)

Small complaints:
(server.cs line 23) if(%time < 0)
should be:
if(%time <= 0)
to prevent muting for 0 seconds

It would also be best if you made it work across server restarts and added in a permanent mute.
(I didn't mention teamchat cuz someone else did)
I'll work on fixing these tomorrow, it's been a long day. Sorry that I haven't checked this topic in a while.
Instead of just having two arguments %target, %time you could have more arguments, combine the first as the target and use the last one as the time.

For example, if these people are on the server:

Johnny 5
Blockheadxxxxx
Blockheadyyyyy
Johnny Blockhead

Wouldn't it be nice if you can use /mute johnny blo 10 instead of /mute johnny 10 and hope it'll get the right one?
What about people with one word names? Like, for example:
/shadowmute Zeblote 10
The script couldn't be able to tell if the second argument, '10' is the mute time or if it's part of the name. Like, there could be someone out there named Chipotle 10. This couldn't work. Also, people with three word names? Super Flaming Ninja would like a word.

What about people with one word names? Like, for example:
/shadowmute Zeblote 10
The script couldn't be able to tell if the second argument, '10' is the mute time or if it's part of the name. Like, there could be someone out there named Chipotle 10. This couldn't work. Also, people with three word names? Super Flaming Ninja would like a word.

I don't think you understood the idea, it would work like this:

Code: mute.cs (23 lines)
function servercmdShadowMute(%client, %a0, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a10)
{
   %name = %a0;

   for(%i = 1; %a[%i + 1] !$= ""; %i++)
       %name = %name @ " " @ %a[%i];

   %time = %a[%i];

   if(!strLen(%name))
    {
       //No name
       return;
    }

   if(!strLen(%time) || %time + 0 !$= %time)
    {
       //No time or time is not a number (put only a name?)
       return;
    }

   //Continue with %name and %time
}


I didn't test the code, but as long as people type the command properly, the following should work:

/mute Blockhead 10
/mute Johnny Blo 10
/mute Some Idiot With a Long Name 10

If they just use /mute without any args you'll hit the first if, if they just put a name like /mute johnny block you'll hit the second if
« Last Edit: July 31, 2015, 05:47:07 AM by Zeblote »

Thanks for the explanation and help, Zeblote! I've updated the script to support multi-word names, and to block teamchat messages.


Isn't this already made?

I think the add-on is called hell ban or something

Isn't this already made?

I think the add-on is called hell ban or something
Read the topic.