spawning guns with all attachments

Nitrado now has an official Discord server to bring communities, friends and other gamers together!
Join the Nitrado Community Discord now and share your experiences and knowledge with others!

Click here to go to the Discord Server!
  • ok i've looked everywhere and can't find annything on this. I want to spawn in weapons with the attachments on, or a tactical helmet with nvg and universal light both with batteries in them. I want these to spawn on an npc at certain coordinates. I've watched some videos to no avail. Any help will be greatly appreciated.


    side not if i end up figuring this out before anyone comments i will be sure to add to this thread how its done.

  • The file cfgspawnabletypes.xml controls the items an attachments. Simply add the attachment to the item. In your case you would add the nvg to the tactical helmet like so. This can be used for anything that uses attachments such as flashlights, optics, rangefinder, ect...


    <type name="Mich2001Helmet">

    <attachments>

    <item name="NVGoggles" />

    </attachments>

    <attachments>

    <item name="Battery9V" />

    </attachments>

    </type>


    Now this does not work the same when adding items to npc's. You have to add the items individually as no attachments will spawn on items with npc's. Here is one of my npc's. You will notice item placement does matter sometimes for certain items. I played around with the placement of the deagle and knife and in doing so got the mag to go in the gun and the gun to go into the holster. same for the knife. I have not been able to get them to attach to the belt though. The idea here is play with the attachments location in the file to get it to go where you want. Also take note of the space each item has. anything over the available space wont spawn. To spawn an npc we need 3 files, cfgeventspawn.xml, events.xml and cfgspawnabletypes.xml. The cfgspawnabletypes tells the server what items to spawn on the npc, events.xml tells the server what the event is and cfgeventspawns.xml says where to spawn it.


    cfgspanabletypes.xml (add to your file)


    <type name="SurvivorF_Keiko">

    <attachments>

    <item name="HuntingJacket_Summer" />

    </attachments>

    <attachments>

    <item name="HunterPants_Summer" />

    </attachments>

    <attachments>

    <item name="SmershVest" />

    </attachments>

    <attachments>

    <item name="GhillieHood_Woodland" />

    </attachments>

    <attachments>

    <item name="GhillieHood_Woodland" />

    </attachments>

    <attachments>

    <item name="GhillieSuit_Woodland" />

    </attachments>

    <attachments>

    <item name="CombatBoots_Green" />

    </attachments>

    <attachments>

    <item name="TacticalGloves_Green" />

    </attachments>

    <attachments>

    <item name="BandanaMask_CamoPattern" />

    </attachments>

    <attachments>

    <item name="BandanaMask_CamoPattern" />

    </attachments>

    <attachments>

    <item name="NVGHeadstrap" />

    </attachments>

    <attachments>

    <item name="NVGoggles" />

    </attachments>

    <attachments>

    <item name="MilitaryBelt" />

    </attachments>

    <attachments>

    <item name="PlateCarrierHolster" />

    </attachments>

    <attachments>

    <item name="NylonKnifeSheath" />

    </attachments>

    <attachments>

    <item name="AKM" />

    </attachments>

    <attachments>

    <item name="Mag_AKM_Drum_TEST" />

    </attachments>

    <attachments>

    <item name="PSO11Optic" />

    </attachments>

    <attachments>

    <item name="UniversalLight" />

    </attachments>

    <attachments>

    <item name="AK_RailHndgrd_Black" />

    </attachments>

    <attachments>

    <item name="AK_PlasticBttstck_Black" />

    </attachments>

    <attachments>

    <item name="ASVAL" />

    </attachments>

    <attachments>

    <item name="Deagle_Gold" />

    </attachments>

    <attachments>

    <item name="Mag_Deagle_9rnd" />

    </attachments>

    <attachments>

    <item name="CombatKnife" />

    </attachments>

    <attachments>

    <item name="Mag_VAL_20Rnd" />

    </attachments>

    <attachments>

    <item name="ACOGOptic" />

    </attachments>

    <attachments>

    <item name="SmershBag" />

    </attachments>

    <attachments>

    <item name="AmmoBox_357_20Rnd" />

    </attachments>

    <attachments>

    <item name="Ammo_9x39AP" />

    </attachments>

    <attachments>

    <item name="Ammo_9x39AP" />

    </attachments>

    <attachments>

    <item name="BandageDressing" />

    </attachments>

    <attachments>

    <item name="BandageDressing" />

    </attachments>

    <attachments>

    <item name="SalineBagIV" />

    </attachments>

    <attachments>

    <item name="Battery9V" />

    </attachments>

    <attachments>

    <item name="Battery9V" />

    </attachments>

    <attachments>

    <item name="Battery9V" />

    </attachments>

    </type>


    Events.xml (add to your file)


    <event name="ItemGuard1">

    <nominal>1</nominal>

    <min>1</min>

    <max>1</max>

    <lifetime>120</lifetime>

    <restock>0</restock>

    <saferadius>0</saferadius>

    <distanceradius>0</distanceradius>

    <cleanupradius>0</cleanupradius>

    <flags deletable="0" init_random="0" remove_damaged="1"/>

    <position>fixed</position>

    <limit>child</limit>

    <active>1</active>

    <children>

    <child lootmax="0" lootmin="0" max="1" min="1" type="SurvivorF_Keiko"/>

    </children>

    </event>


    cfgeventspawns.xml (add to your file adjust the coords to where you want it to spawn)


    <event name="ItemGuard1">

    <pos x="2748.6" z="9468.0" a="90.0" />

    </event>