Jump to content
Sign in to follow this  
Minon

Question about addmagazine

Recommended Posts

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 smile_o.gif

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

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"

smile_o.gif

Share this post


Link to post
Share on other sites

well,thanks for a script smile_o.gif 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

cargo do not work with units ... damn smile_o.gif

Share this post


Link to post
Share on other sites
{unit addmagazine "m16"} foreach [0,0,0,0,0,0,0,0,0,0];

notworthy.gifnotworthy.gifnotworthy.gif

thaaaanks smile_o.gif

Share this post


Link to post
Share on other sites

Lol!!! Awesome "code" smile_o.gif

...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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×