[T1 Request] Filter.cs

-kllr2001-

Veteran X
I need a script that will block out the words like "Station Access OFF" "Auto-Buying Energy Pack" etc... That's compatible with VikingPack kthnx!
 
This should work for viking now.

Code:
$Filter::Msg[0] = "You couldn't buy ";
$Filter::Msg[1] = "Repairing ";
$Filter::Msg[2] = "Station Access ";
$Filter::Msg[3] = "Repair Done";
$Filter::Msg[4] = "AutoRepair ";
$Filter::Msg[5] = " deployed";
$Filter::Msg[6] = "Repair Stopped";
$Filter::Msg[7] = "Unit is disabled";
$Filter::Msg[8] = "Nothing in range";
$Filter::Msg[9] = "Bought Laser Rifle - Auto buying Energy Pack";
$Filter::Msg[10] = "SOLD ";
$Filter::Msg[11] = " has no ammo";

function Filter::Check(%client, %msg) {
    if(%client)
        return;
    for(%i = 0; $Filter::Msg[%i] != ""; %i++)
        if(String::findSubStr(%msg, $Filter::Msg[%i]) != -1)
            return false;
    return true;
}

Event::Attach(eventClientMessage, Filter::Check);
 
Last edited:
Is there something I'm doing wrong?

I copied the code, pasted it into a clean .cs file named Filter, and added exec("Filter.cs"); into my autoexec...

yet i still see messages going in and out of invo etc
 
ive tried both.
im using z0dd hud, and they dont filter stuff, and i used that code to still with no luck, what am i doing wrong?
 
random, have you ever considered there's a reason why it doesn't filter those messages?

edit: removed stupid insult, soz.
 
Last edited:
Code:
$Filter::Part[0] = "You couldn't buy ";
$Filter::Part[1] = "Repairing ";
$Filter::Part[2] = "Station Access ";
$Filter::Part[3] = "AutoRepair ";
$Filter::Part[4] = " deployed";
$Filter::Part[5] = "SOLD ";
$Filter::Part[6] = " has no ammo";
$Filter::Full[0] = "Repair Done";
$Filter::Full[1] = "Repair Stopped";
$Filter::Full[2] = "Unit is disabled";
$Filter::Full[3] = "Nothing in range";
$Filter::Full[4] = "Bought Laser Rifle - Auto buying Energy Pack";

function Filter::Check(%client, %msg)
{
   if(!%client)
      return;
   for(%i = 0; $Filter::Part[%i] != ""; %i++)
   {
      if(String::findSubStr(%msg, $Filter::Part[%i]) != -1)
         return mute;
   }
   for(%j = 0; $Filter::Full[%j]; j++)
   {
      if(%msg == $Filter::Full[%j])
         return mute;
   }
}

Event::Attach(eventClientMessage, Filter::Check);

Code not checked, but this _might_ work
 
Back
Top