ramiroxd1 47 Posted June 13, 2015 How to attach accessories to the weapon loadout in a unit that I am creating in the config.cpp? I want to create a unit by a config.cpp, but I do not know what code to use to place the weapon accessories, please help me! class CfgVehicles { class I_soldier_TL_F; // class ExampleUnit : I_Soldier_TL_F //Unit Class name: Class getting info from { side = 2; // faction = "exampefaction"; //Your Faction backpack = "-"; //Backpack vehicleclass = "examplegroup"; //Unit Group _generalMacro = "I_Soldier_TL_F"; //Class Name scope = 2; displayName = "ExampleUnit"; //In-Game Name weapons[] = {"hlc_rifle_Bushmaster300","hgun_Rook40_F","Throw","Put","Binocular"}; respawnWeapons[] = {"hlc_rifle_Bushmaster300","hgun_Rook40_F","Throw","Put","Binocular"}; magazines[] = {"29rnd_300BLK_STANAG","29rnd_300BLK_STANAG"}; respawnMagazines[] = {"29rnd_300BLK_STANAG","29rnd_300BLK_STANAG"}; cost = 300000; threat[] = {1,0.7,0.3}; items[] = {"FirstAidKit"}; linkedItems[] = {"V_I_G_resistanceLeader_F","rhsusf_mich_bare_alt","ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS"}; respawnLinkedItems[] = {"V_I_G_resistanceLeader_F","rhsusf_mich_bare_alt","ItemMap","ItemCompass","ItemWatch","ItemRadio","ItemGPS"}; uniformClass = "exampeuniform"; //uniform you are using camouflage = 1.6; }; Share this post Link to post Share on other sites
BadHabitz 235 Posted June 13, 2015 You have to create a new weapon, with the code listed below, using the accessories that you want, and then give that weapon to the unit. Given my example, your new code would be: weapons[] = {"myNewWeapon","hgun_Rook40_F","Throw" ,"Put","Binocular"}; respawnWeapons[] = {"myNewWeapon","hgun_Rook40_F","Throw" ,"Put","Binocular"}; class cfgWeapons { class hlc_rifle_Bushmaster300; class myNewWeapon : hlc_rifle_Bushmaster300 { scope = 1; class LinkedItems { class LinkedItemsOptic { slot = "CowsSlot"; item = "opticClassName"; }; class LinkedItemsAcc { slot = "PointerSlot"; item = "pointerClassName"; }; class LinkedItemsMuzzle { slot = "MuzzleSlot"; item = "muzzleClassName"; }; class LinkedItemsUnder { slot = "UnderBarrelSlot"; item = "bipodClassName"; }; }; }; } 1 1 Share this post Link to post Share on other sites
ramiroxd1 47 Posted June 13, 2015 Thanks man, works perfect!!, Do you know how I can add items, magazines, etc., to the backpack? because its forever empty, Greetings Share this post Link to post Share on other sites
BadHabitz 235 Posted June 14, 2015 (edited) Backpacks work almost the same way, in that you have to create a 'new' backpack class name, and give it whichever items you need. class base_backpack_class; class new_backpack : base_backpack_class { scope = 1; class TransportItems { class _xx_medikit { name = "medikit"; count = 1; }; class _xx_toolkit { name = "toolkit"; count = 1; }; }; class TransportMagazines { class _xx_myMagazine { magazine = "myMagazine"; count = 1; }; }; }; The medikit and toolkit code I copied from an old post I made. The Transportmagazines portion I did from memory (since I'm not at home to verify) so it could have an error. I think there's also a TransportWeapons, and a TransportBackpacks (which would be used for ammo crates). The same method is used to add inventory to ammo boxes, backpacks and vehicles. Edited June 14, 2015 by BadHabitz 1 Share this post Link to post Share on other sites