They need this line in the config.cpp under classCfgVehicles.
weaponSlots="1 + 16 + 10* 256 + 2* 4096 + 2 + 4* 32";
FYI, the weapon slots are as follows:
1 (primary weapons, rifles, mgs, etc)
16 (secondary weapons, LAW, RPG, etc)
256 (Magazine slots, in this case 10 of them which is default)
4096 Items (Binoculars, NVG)
2 (pistols)
32 (pistol magazines, in this case 4 of them which is default for resistance)
Those numbers match with the weapontype and magazinetype defined in classCfgWeapons (eg, pistols are weaponType=2; magazineType=32). While we're on the subject, you can use this line to customize your soldiers a bit more, similar to how the medics work, you can make it so certain soldiers can't carry secondary weapons or only let them carry a few magazines rather than 10. I wish more people used it, after all a combat soldier wearing web gear should be able to easily carry 10 magazines, but wouldn't you think the civilians would run out of pockets?
Anyway, hope that helps.