Use this code to make a vehicleGroup. Place it in its own file in your mod.
if(isObject(vehicleGroup))
return; //we don't want the code to be executed again if somebody else already created a vehicleGroup
else
new simSet(vehicleGroup);
package vehicleGroup
{
function fxDtsBrick::spawnVehicle(%this,%a)
{
%parent = parent::spawnVehicle(%this,%a);
%vehicle = %this.vehicle;
if(isObject(%vehicle))
vehicleGroup.add(%vehicle);
return %parent;
}
};
activatePackage(vehicleGroup);