Forums Index >> Modding >> Silence all script
Page : <1> :
That is a bad thing for admins cuz then you wont be able to type in codes to unsilence lol 8o
Silence admin problem....
no longer a problem
Last edited: Wednesday, February 09, 2005 at 8:45:19 AM
Ok, my script (before I fixed it) had some major problems, like not working, but it works like a charm now since art posted one, so what is up there is ready for use.
Last edited: Wednesday, February 09, 2005 at 8:46:54 AM
Ok, it had some major problems, like not working,
Rofl! XD Just problem...
And,
That is a bad thing for admins cuz then you wont be able to type in codes to unsilence lol
Another problem...
Why in heck you'll need to silence everyone!? :(
I fixed the admin problem with my code...
and if you have a server full of demos ( like I do most of the time ) then you can shut them all up instead of one at a time...
besides, its pretty handy, dont you think, never know when you might need it......
This is just like killing all players or healing them all...
Last edited: Wednesday, February 09, 2005 at 8:47:46 AM
Or in case the 3 on 3 teams come into your server and start trash talkin'.
/sa!
...On the other hand,it'd be fun to watch the trash talk.
I made a better command. It has both sides. It will just silence all players if u still didnt use the command wont unsilence the ones allready silenced , after silencing all using the same command will just unsilence the ones silenced and not silence the ones unsilenced and will take up less RAM (if u have small RAM this is for you)... See for yourself:
Function silenceall(%sender,%msg)
{
if(!IsAdmin(%sender,"You're not an admin"))
return;
If($SilencedAll !$= true && $SilencedAll !$= false) //Just for precaution
$SilencedAll = false;
If($SilencedAll $= true)
{
%len = clientgroup.getCount();
for(%i=0; %i<%len; %i++)
{
%client = clientgroup.getObject(%i);
if(%client != %sender && %client.silenced $= true)
{
%client.silenced = false;
}
}
$SilencedAll = false;
}
else if($SilencedAll $= false)
{
%len = clientgroup.getCount();
for(%i=0; %i<%len; %i++)
{
%client = clientgroup.getObject(%i);
if(%client != %sender && %client.silenced $= false)
{
%client.silenced = true;
}
}
$SilencedAll = true;
}
}
Art yours seem to make more sense in what im reading ;)
Edger...
Last edited: Wednesday, February 09, 2005 at 7:28:00 AM
His would make more sense, I only started scripting a week ago...
but thanks art, I have been trying to figure out how to silence and unsilence without switching those who are already are...
Lol, art comes to my thread and shows me up...
Hey art, could you possibly put some centerprint stuff in there so the players know what has happened?
Yes its possible:
Function silenceall(%sender,%msg)
{
if(!IsAdmin(%sender,"You're not an admin"))
return;
If($SilencedAll !$= true && $SilencedAll !$= false) //Just for precaution
$SilencedAll = false;
If($SilencedAll $= true)
{
%len = clientgroup.getCount();
for(%i=0; %i<%len; %i++)
{
%client = clientgroup.getObject(%i);
if(%client != %sender && %client.silenced $= true)
{
%client.silenced = false;
}
}
centerprintall("Everybody was silenced",4,4);
$SilencedAll = false;
}
else if($SilencedAll $= false)
{
%len = clientgroup.getCount();
for(%i=0; %i<%len; %i++)
{
%client = clientgroup.getObject(%i);
if(%client != %sender && %client.silenced $= false)
{
%client.silenced = true;
}
}
$SilencedAll = true;
centerprintall("Everybody was unsilenced",4,4);
}
}
Remember to make the F from function lower-case
Last edited: Wednesday, February 09, 2005 at 9:41:36 AM
Thx art
Page : <1> :
This is posted below by Art Crazyİ...
after we decided my code wasnt ideal...
Function silenceall(%sender,%msg)
{
if(!IsAdmin(%sender,"You're not an admin"))
return;
If($SilencedAll !$= true && $SilencedAll !$= false) //Just for precaution
$SilencedAll = false;
If($SilencedAll $= true)
{
%len = clientgroup.getCount();
for(%i=0; %i<%len; %i++)
{
%client = clientgroup.getObject(%i);
if(%client != %sender && %client.silenced $= true)
{
%client.silenced = false;
}
}
$SilencedAll = false;
}
else if($SilencedAll $= false)
{
%len = clientgroup.getCount();
for(%i=0; %i<%len; %i++)
{
%client = clientgroup.getObject(%i);
if(%client != %sender && %client.silenced $= false)
{
%client.silenced = true;
}
}
$SilencedAll = true;
}
}
Note: ALL THE FIRST LETTERS OF THE LINES ARE LOWERCASE
Last edited: Wednesday, February 09, 2005 at 8:44:32 AM