Aircraft Chaff and Flares

ArmA 2 how to setup chaff and flares in config.cpp

config.cpp

flareVelocity = 100;
memoryPointCM[] = {"flare_launcher1","flare_launcher2"};
memoryPointCMDir[] = {"flare_launcher1_dir","flare_launcher2_dir"};
weapons[] = {"CMFlareLauncher"};
magazines[] = {"120Rnd_CMFlareMagazine"};
LockDetectionSystem = 8;
IncommingMisslieDetectionSystem = 16;

Then on surface to air missiles like SA-2, SA-7 Strela launcher add:

weaponLockSystem = "16 + 2";
cmImmunity = 0.8;

Your aircraft needs memory points in the p3d model to indicate where flares and chaff is launched.