vehicle player setVehicleAmmo 0; - removes all ammo from all weapons on vehicle (inc. flares too)
vehicle player setVehicleAmmo 1; - fill up all vehicle weapons with ammo (inc. flares too)
but if u can't use this because you want fill up only the flares then follow this 4 step:
vehicle player removeMagazinesTurret ["SmokeLauncherMag",[0,0]]; - remove ALL smokelauncher magazines (important: removemagazinesturret and not removemagazineturret) from tank commander path [0,0]
vehicle player removeWeaponTurret ["SmokeLauncher",[0,0]]; - remove smokelauncher
vehicle player addMagazineTurret ["SmokeLauncherMag",[0,0]]; - add 1 smokelauncher magazine (important: add magazine before you add the weapon and then not need rearm when you get the weapon back)
vehicle player addWeaponTurret ["SmokeLauncher",[0,0]]; - add smokelauncher back to commander path
[-1] - driver ifrit/strider (hunter not have flares but you can add)
[0,0] - tank commander