Jump to content
Sign in to follow this  
limmy3

Remove Magarines from AmmoBox

Recommended Posts

Hello there,

I think I could spend some nother hours but wouldn't find what I'm looking for.

I know that someone made some emty Ammo crates which can be filled with your ammo.

The command 'Ammo RemoveAllMagazine "Handgrenade" ' will not remove the magazines from the OFP boxes. sad_o.gif

I have a black ops unit with a HK SD and Glock silinced.

The units shall not use Handgrenades and satches charges from the ABoxes but only HKMags or GlockMags.

From killed units with GlockMags it is not possible to take the GlockMags. Why not ??  

What do I have to do to emty the ABox and put some other ammo in.??

Regards limmy3

Share this post


Link to post
Share on other sites

The commands you're looking for:

Quote[/b] ]clearWeaponCargo unit

Operand types:

unit: Object

Type of returned value:

Nothing

Description:

Remove all weapons from the vehicle cargo space.

Example:

clearWeaponCargo jeepOne

Quote[/b] ]

unit addMagazineCargo magazines

Operand types:

unit: Object

magazines: Array

Type of returned value:

Nothing

Description:

Add magazines to weapon cargo space. Used for infantry weapons. Format of magazines is [magazineName, count]. For magazineName values see CfgWeapons.

Example:

rearmTruckOne addMagazineCargo ["M16", 10]

There'll be something wrong with the killed units. Probably they're not carrying Glock mags because of a wrong magazine name or they're carrying Glock mags and your weapon needs silenced Glock mags.

Magazine names are GlockMag and GlockSMag.

Share this post


Link to post
Share on other sites

Hello Trapper,

thank you for your help.

I tried this in the description.ext

//Choose Magazine from list

class Magazines

{

class M21 { count = 10;};

class M16 { count = 10;};

class HK { count = 10;};

class M60 { count = 10;};

class Glockmag { count = 10;};

// Remove all weapons from Ammo boxes cargo space.

clearMagazineCargo Ammo_1;

clearMagazineCargo Ammo_2;

clearMagazineCargo Ammo_3;

clearMagazineCargo Ammo_4;

// Rearme weapons to Ammo boxes cargo space.

Ammo_1 addMagazineCargo ["HKMag", 10]; Ammo_1 addMagazineCargo ["GlockSMag", 10;

Ammo_2 addMagazineCargo ["HKMag", 10]; Ammo_2 addMagazineCargo ["GlockSMag", 10;

Ammo_3 addMagazineCargo ["HKMag", 10]; Ammo_3 addMagazineCargo ["GlockSMag", 10;

Ammo_4 addMagazineCargo ["HKMag", 10]; Ammo_4 addMagazineCargo ["GlockSMag", 10;

};

But it won't work. The game wroke down.

What's wrong ?  huh.gif

Regards limmy3

Share this post


Link to post
Share on other sites

Unfortunately you cannot use those commands in the description.ext.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// Remove all weapons from Ammo boxes cargo space.

clearMagazineCargo Ammo_1;

clearMagazineCargo Ammo_2;

clearMagazineCargo Ammo_3;

clearMagazineCargo Ammo_4;

// Rearme weapons to Ammo boxes cargo space.

Ammo_1 addMagazineCargo ["HKMag", 10]; Ammo_1 addMagazineCargo ["GlockSMag", 10;

Ammo_2 addMagazineCargo ["HKMag", 10]; Ammo_2 addMagazineCargo ["GlockSMag", 10;

Ammo_3 addMagazineCargo ["HKMag", 10]; Ammo_3 addMagazineCargo ["GlockSMag", 10;

Ammo_4 addMagazineCargo ["HKMag", 10]; Ammo_4 addMagazineCargo ["GlockSMag", 10;

Instead of the description.ext, create a new script called init.sqs and move that bit of code from the description into the init then remove it from the description.  

Hope that helped smile_o.gif

sim

Share this post


Link to post
Share on other sites

Yes you have to call all this anywhere else but not in the description.ext. That file is only for the weapons in gear selection.

And don't forget to correct these lines with "]" at the end:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Ammo_1 addMagazineCargo ["HKMag", 10]; Ammo_1 addMagazineCargo ["GlockSMag", 10;

Ammo_2 addMagazineCargo ["HKMag", 10]; Ammo_2 addMagazineCargo ["GlockSMag", 10;

Ammo_3 addMagazineCargo ["HKMag", 10]; Ammo_3 addMagazineCargo ["GlockSMag", 10;

Ammo_4 addMagazineCargo ["HKMag", 10]; Ammo_4 addMagazineCargo ["GlockSMag", 10;

Share this post


Link to post
Share on other sites

Hi,

now everything works the way I intended it.

Thank you, you two.

Regards limmy3  biggrin_o.gif

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  

×