Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Array expected Object

  1. #1
    I keep getting the error "Array expected Object" with this line. Do I have a typo or can you not do this with these commands?

    [i1,i2,i3,i4,i5] addweapon ["ak74"]]#;[i1,i2,i3,i4,i5] addmagazinepool ["30Rnd_545x39_AK",[8]]

    I have tried it 50 differant ways and cant get this to work.

    With what I have up top I get missing ; at the # sign?



    When you kill a man you're a murderer.....Kill many and you're a conqueror....Killem all and you're a GOD!

  2. #2
    Try

    {_x addmagazine "30Rnd_545x39_AK"}ForEach [i1,i2,i3,i4,i5]

    {_x addweapon "ak74"}ForEach [i1,i2,i3,i4,i5]
    ECL Mapping Muppet

  3. #3
    Gunnery Sergeant
    Join Date
    Mar 31 2007
    Location
    Maine, USA
    Posts
    401
    Author of the Thread
    That worked thanx, but you cant use the "addmagazinepool" command with the quantity?

  4. #4
    Master Gunnery Sergeant
    Join Date
    Dec 18 2005
    Location
    Adelaide, Australia
    Posts
    1,306
    see the wiki : addMagazinePool



    [self-promotion]
    OFP:R Island : Rezina
    [/self-promotion]

  5. #5
    Gunnery Sergeant
    Join Date
    Mar 31 2007
    Location
    Maine, USA
    Posts
    401
    Author of the Thread
    Yes I have that and have read it. This is using the same command in a differant context.

    This works: {_x addmagazine "30Rnd_545x39_AK"}ForEach{i1,i2,i3,i4,i5]


    This doesn't: {_x addmagazinepool ["30Rnd_545x39_AK"[,8]}ForEach [i1,i2,i3,i4,i5]

    It works with AddWeapon" but I want to use it to add mags to multiple units and I cant get it to work. So I wanted to know if Im typing it wrong or if it cant be used this way and you need to type it 8 times for each unit with the "AddMagazine" command.

    Thanx for the pointer though.




  6. #6
    Master Gunnery Sergeant
    Join Date
    Dec 18 2005
    Location
    Adelaide, Australia
    Posts
    1,306
    You can't use the addMagazinePool command in any context other than it's purpose - adding magazines to the campaign magazine pool, not to individual units.

    It's unfortunate, but there is no addMagazine [type,number] command. You need to repeat addMagazine type x times. It's a bit ugly but has no other negative impact.

  7. #7
    Quote Originally Posted by (Op4 BuhBye @ April 19 2007,00:08)
    {_x addmagazinepool ["30Rnd_545x39_AK"[,8]}ForEach [i1,i2,i3,i4,i5]
    Aside from what fasad said, your syntax there is messed up, it should simply look like this:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">addmagazinepool &#91;&#34;30Rnd_545x39_AK&#34;,8&#93;[/QUOTE]

    And you can&#39;t try to change the sytnax if it&#39;s not listed as a proper one on the Biki, each command has it&#39;s own syntax so don&#39;t try to be creative with the syntax you use.
    VBS2 Designer

    Quote Originally Posted by Armored_Sheep View Post
    I like to call Arma a sandbox game that works pretty much like LEGO - you buy it not just because you want to have a nice car from the main picture on its box, do you?

  8. #8
    Gunnery Sergeant
    Join Date
    Mar 31 2007
    Location
    Maine, USA
    Posts
    401
    Author of the Thread
    If I dont put the L/R brackets around the quanity I get an error. It only works with them.

    And thanx Fasad




  9. #9
    Quote Originally Posted by (Op4 BuhBye @ April 19 2007,01:42)
    If I dont put the L/R brackets around the quanity I get an error. It only works with them.

    And thanx Fasad
    You&#39;re probably getting an error from something else, because putting brackets around it turns it into an array, where it should be a number.

  10. #10
    Gunnery Sergeant
    Join Date
    Mar 31 2007
    Location
    Maine, USA
    Posts
    401
    Author of the Thread
    w1 addmagazinepool ["30Rnd_545x39_AK",8]

    I got this to work screwing around with the syntax and I cant figure out how I did it. If I do it again Ill post it here.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •