Jump to content
Sign in to follow this  
Powerful

Putting all guns in crate?

Recommended Posts

How do I put every gun currently available in a crate? I want to include guns from mods installed. Do I have to go through the trouble of going through the mods and such?

Sorry for being a noob...

Share this post


Link to post
Share on other sites

Hello,

Most guns currently availiable are already in crates under empty, under ammo, you would just have multiple ammo boxes whihc is a clutter ingame.

If you wanted to condense all the weapons to one box then you will need to create a script,

and get the classnames of the guns from the mods you wish to use.

If you want all the guns that are in the vanilla game you will need thier classnames, here is a sticky topic with all the classnames:

http://forums.bistudio.com/showthread.php?73241-ArmA-II-amp-OA-Classnames-No-questions-no-discussion-here!

here is an example script:

if isnull _this exitwith {};
clearweaponcargo _this;
clearmagazinecargo _this;

_this addweaponcargo ["MP5SD", 1];
_this addweaponcargo ["M9", 1];
_this addweaponcargo ["M9SD", 1];
_this addmagazinecargo ["15Rnd_9x19_M9", 5];
_this addmagazinecargo ["15Rnd_9x19_M9SD", 5];
_this addmagazinecargo ["30Rnd_9x19_MP5SD", 5];

Heres the breakdown of the codes:

_this addweaponcargo ["MP5SD", 1];

this adds the weapon in the ammo box, the MP5SD is the gun, and the 2nd number after it is how many of those guns are to be added.

for every weapon class you add you will need to add the magazine class for it or the gun you add wont have any ammo, so for this you add:

_this addmagazinecargo ["30Rnd_9x19_MP5SD", 5]

this adds the magaize (ammo) for the gun specific to the classname so for the gun above it is an MP5SD (SD=Silenced),

the number after is the number of clips/magazines to be added to the box.

Tools

to create a script you'll want to use either notepad or my favorite Armaedit http://www.armaholic.com/page.php?id=1455&highlight=ARMAEDIT

you'll want to create a new SFQ file.

then name your script for example guns, or ammo.

so then it would look like this Ammo.sqf or Guns.sqf, name can be whatever you want.

to use it ingame

place an ammo box, and then put the following code in the init line of the ammo box:

_dummy = this execvm "ammo.sqf";

also make sure that your script is in the same folder of the mission you built where you have the ammo box.

hope that helps.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×