mIRC Homepage
Posted By: rOglrah Only ops can write in color - 05/12/05 07:02 PM
I don't know if this topic is related to the scripts forum, because maybe there's a way threw the channel options. Anyway, I don't know about such thing.
Is there any way to allow ops only to write in color in my channel?

Thanks in advanced.
Posted By: schaefer31 Re: Only ops can write in color - 05/12/05 07:10 PM
As far as I know, there is no way to do that other than possibly kick users who uses colors. In that case...

Code:
on @*:text:*:[color:red]#YourChannel[/color]:{
  if ($chr(3) isin $1- && $nick !isop #) { kick # $nick }
}
Posted By: SladeKraven Re: Only ops can write in color - 05/12/05 08:41 PM
Code:
On ^@*:Text:*:#: {
  if ($chr(3) isin $1- || $chr(3) !isin $1-) {
    var %ct = $chan, %dt = echo -t %ct $+(<,$nick,>) $1-
    if ($nick isop %ct) %dt
    else {
      $replace(%dt,$1-,$strip($1-))
    }
  }
  haltdef
}


Or schaefer31's way if you want to kick the users. smile

-Andy
Posted By: genius_at_work Re: Only ops can write in color - 06/12/05 02:52 AM
To do this the way I think you want it, you'd have to edit the ircd (server) code. There would need to be a channel mode that only allows ops to use colors.

The server I'm on has 2 modes to deal with colors in channels. Channel mode +S strips all color codes from incoming text and then displays the uncolored message. Channel mode +c completely blocks any text that has colors in it.

-genius_at_work
Posted By: Kelder Re: Only ops can write in color - 06/12/05 10:25 AM
(A || not A) is just the same as $true, so I hope you meant something else smile
Posted By: genius_at_work Re: Only ops can write in color - 06/12/05 08:48 PM
Kelder is correct, the first if-statement always evaluates to $true, and it is also unnecessary. If there is a color code present, it will be stripped out by $strip, otherwise nothing will be removed. I altered the $strip command in the example to only remove color codes (that's all that was asked).

Code:
on ^*:TEXT:*:#: {
  echo -t $chan $+(<,$nick,>) $iif($nick isop $chan,$1-,$strip($1-,[color:red]c[/color]))
  haltdef
}
}


-genius_at_work
© mIRC Discussion Forums