Jump to content
Sign in to follow this  
spektre76

I need more magazines please!!!

Recommended Posts

Yes I have searched....

I am using the 'Pilot' model. I have changed the weapon to the MP5SD6 successfully. I have added ammunition successfully however -

My script:

removeallweapons this; this addweapon "MP5SD"; this addmagazine "30Rnd_9x19_MP5SD";

How do I add more than one magazine? I have tried addding a '5' in front of the class name for the magazine sparated by a comma. And even after the class name. I have also tried making more than one sting of the same class name example:

"30Rnd_9x19_MP5SD,30Rnd_9x19_MP5SD, 30Rnd_9x19_MP5SD";

Thanks,

SPEKTRE

Share this post


Link to post
Share on other sites

:respekt:

removeallweapons this; this addweapon "MP5SD"; this addmagazine "30Rnd_9x19_MP5SD"; this addmagazine "30Rnd_9x19_MP5SD"; this addmagazine "30Rnd_9x19_MP5SD"; this addmagazine "30Rnd_9x19_MP5SD"; this addmagazine "30Rnd_9x19_MP5SD";

;)

btw... read this...

Edited by Buliwyf

Share this post


Link to post
Share on other sites

Thanks but I already tried that. I just added the G36C_SD_eotech to my scout. I used the correct magazine class name. And I keep getting "Missing ;". But I am not missing the colon???

Disregard the above post. I didn't read your reply thorouly......=o)

Edited by SPEKTRE76

Share this post


Link to post
Share on other sites

:icon_ohmygod:

You have some options... you copy your fully not working code here or you copy my posted code excactly and put it exactly in your mission or you read the editing guide and learn how to script in Armed Assault... otherwise noone can help you...

:rolleyes:

Share this post


Link to post
Share on other sites

If you want the weapon to be reloaded at the startadd the magazines first.

removeallweapons this; for "_i" from 1 to 5 do {this addmagazine "30Rnd_9x19_MP5SD";}; this addweapon "MP5SD";

Share this post


Link to post
Share on other sites

{this addMagazine "className"} forEach [1,2,3,4,5,6,7];

Best way to add multiple magazines. This is off the top of my head and I'm nowhere near Arma, so sorry if it's wrong :p

To have the weapon loaded from the start, add the mags before adding the weapon.

Share this post


Link to post
Share on other sites

n/m I confused myself :)

Edited by AZCoder

Share this post


Link to post
Share on other sites

LOL

I figured it out. I kinda took the long way home on this one. Here's what I got below (works perfectly):

removeallweapons this; this addweapon "MP5SD"; this addmagazine "30rnd_9x19_MP5SD"; this addmagazine "30rnd_9x19_MP5SD"; this addmagazine "30rnd_9x19_MP5SD"; this addmagazine "30rnd_9x19_MP5SD"; this addmagazine "30rnd_9x19_MP5SD"; this addweapon "M9SD"; this addmagazine "15rnd_9x19_M9SD"; this addmagazine "15rnd_9x19_M9SD"; this addmagazine "15rnd_9x19_M9SD"; this addweapon "M136"; this addmagazine "M136"; this addmagazine "M136"; this addweapon "NVgoggles"; this addweapon "ItemGPS"; this addweapon "ItemRadio"; this addweapon "ItemWatch"; this addweapon "itemMap"; this addweapon "Binocular";

*You can use any character you wish ;o). Just hightlight the green text and Ctrl>C then Ctrl>V into the editor.

:yay:

Share this post


Link to post
Share on other sites

removeallWeapons this; {this addMagazine "30rnd_9x19_MP5SD"} forEach [1,2,3,4,5]; this addWeapon "MP5SD"; {this addMagazine "15rnd_9x19_M9SD"} forEach [1,2,3]; this addWeapon "M9SD"; this addMagazine "M136"; this addWeapon "M136"; this addWeapon "NVGoggles"; this addWeapon "Binocular";

Should do the same more or less, no need to copypasta so much ;)

Share this post


Link to post
Share on other sites

Hey man that is waaaay better! Thank you so much! I need to get back into coding again. It's been 4 years since I even spoke the language. LOL, the last thing I touched was VB.Net 2005, LOL.

I wish I can encompass that all into a function. You know like DIM it with a really simple name like 'LO1' (Load Out 1). That way all you type are three characters.

Edited by SPEKTRE76

Share this post


Link to post
Share on other sites

LO1 = {
 _unit = _this;
 removeallWeapons _unit;
 {
   _unit addMagazine "30rnd_9x19_MP5SD"
 } forEach [1,2,3,4,5];
 _unit addWeapon "MP5SD";
 {
   _unit addMagazine "15rnd_9x19_M9SD"
 } forEach [1,2,3]; 
 _unit addWeapon "M9SD";
 _unit addMagazine "M136";
 _unit addWeapon "M136";
 _unit addWeapon "NVGoggles";
 _unit addWeapon "Binocular";
};

Then you just do:

SomeUnit call LO1;

In init use 'this'

Share this post


Link to post
Share on other sites

Wow!!!!! THANK YOU SO MUCH!!!!! I will try this rightnow. It'll be much easier to set up my team in the editor now.

Share this post


Link to post
Share on other sites

You have to be careful with initilization process. Eg. you attempt to call the function before it is defined.

One way to get around this is to make a trigger, give it a timeout of 3s (min, mid max). Condition is true. Set it to BLUFOR PRESENT. In your on act

{_x call LO1;} forEach thisList;

Then you can be sure the function is defined when you call it.

Share this post


Link to post
Share on other sites

Before you add some magazines, you should remove all the old magazines with *{_unit removeMagazine _x} forEach magazines _unit;* otherwise the unit will have all the old and new magzines.

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  

×