This should fix your syntax errors:
registerInputEvent(fxDtsBrick,"OnBrick","tBrickMessage BrickMessage");
registerOutputEvent(Brick,"setShapeName","string 25 50",0);
registerOutputEvent(Brick,"setShapeNameColor","paintColor 1",0);
registerOutputEvent(Brick,"setShapeNameDistance","int 0 3000 300",0);
package Event_BrickMessage
function fxDtsBrick::setShapeName(%this)
{
Parent::setShapeName(%this);
$inputTarget_Brick = %this;
%this.processInputEvent("OnBrick",%this);
}
function Brick::setShapeNameColor(%Brick,%color,%client)
{
if(getWordCount(%color) == 1)
{
Parent::setShapeNameColor(%Brick,getColorIDTable(%color));
}
else
{
Parent::setShapeNameColor(%Brick,%color);
}
}
but then listen to the others about how to accomplish what you really want to do.