Forums Index >> Modding >> Silence all script



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

Tuesday, February 08, 2005 at 4:48:56 PM

That is a bad thing for admins cuz then you wont be able to type in codes to unsilence lol 8o


Tuesday, February 08, 2005 at 5:23:21 PM

Silence admin problem....
no longer a problem

 

 

 

 

Last edited: Wednesday, February 09, 2005 at 8:45:19 AM

Tuesday, February 08, 2005 at 6:31:08 PM

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

Tuesday, February 08, 2005 at 8:24:23 PM

 

 

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!? :(

Wednesday, February 09, 2005 at 4:47:24 AM

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

Wednesday, February 09, 2005 at 5:10:57 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.

Wednesday, February 09, 2005 at 5:32:29 AM

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;
}
}

 

 


Wednesday, February 09, 2005 at 5:48:20 AM

Art yours seem to make more sense in what im reading ;)

Edger...

Last edited: Wednesday, February 09, 2005 at 7:28:00 AM

Wednesday, February 09, 2005 at 7:27:43 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...

 

 

 

 

Wednesday, February 09, 2005 at 8:40:39 AM

Hey art, could you possibly put some centerprint stuff in there so the players know what has happened?

 

 

 

 

Wednesday, February 09, 2005 at 8:49:31 AM

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

Wednesday, February 09, 2005 at 9:40:28 AM

Thx art

 

 

 

 

Wednesday, February 09, 2005 at 9:45:40 AM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald