Minon 0 Posted October 7, 2007 Have a *little*problem. I need to add 10 magazines for primary wepon and 8 for support weapon (handgun) - like this - this addmagazine "M16",10; I other words - i need add 10 magazines in ONE command,compact Not - this addmagazine "M16";this addmagazine "M16";this addmagazine "M16";this addmagazine "M16" ... Can anyone tell me right command for adding few magazines to unit by one addmagazine ? Share this post Link to post Share on other sites
Linker Split 0 Posted October 7, 2007 you should make a script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_soldier = _this select 0 _num = _this select 1 _num2 = _this select 2 _type1 = _this select 3 _type2 = _this select 4 _n = 0 _t = 0 #TYPE1 _soldier addMagazine _type1 ? (_num >= _n) : goto "TYPE2" _n = _n + 1 goto "TYPE1" #TYPE2 _soldier addMagazine _type2 ? (_num2 >= _t) : goto "END" _t = _t + 1 goto "TYPE2" #END exit save it as "addmag.sqs" in the init of the soldier write: [this,numofprimMags,numofSecMags,"nameofprimMag","nameofsecMag"] exec "addmag.sqs" Share this post Link to post Share on other sites
Minon 0 Posted October 7, 2007 well,thanks for a script it's easy way,but i DONT save my mission - just chek on clear area some stuff,and dont want to save this mission for just one script ... any other ways ? Share this post Link to post Share on other sites
the unknown 0 Posted October 7, 2007 try the addmagazinecargo one. Unitname Addmagazinecargo ["m16",10] Share this post Link to post Share on other sites
Minon 0 Posted October 7, 2007 cargo do not work with units ... damn Share this post Link to post Share on other sites
vova _fox 0 Posted October 7, 2007 {unit addmagazine "m16"} foreach [0,0,0,0,0,0,0,0,0,0]; Share this post Link to post Share on other sites
Minon 0 Posted October 7, 2007 {unit addmagazine "m16"} foreach [0,0,0,0,0,0,0,0,0,0]; thaaaanks Share this post Link to post Share on other sites
CarlGustaffa 4 Posted October 8, 2007 Lol!!! Awesome "code" ...But I like it.. Have to keep that one in mind. I'm sooooo sick of insanely long init strings... Share this post Link to post Share on other sites