Jump to content
Sign in to follow this  
JacobJ

Help with arrays needed

Recommended Posts

Hey

Instead of making this line for every vehicle I have in my base, what can I do instead?

nul = [truck1,'all','all',FALSE,1,12,5] execVM "crateFiller.sqf"};

Can I maybe do this:

nul = [(truck1, truck2, truck3),'all','all',FALSE,1,12,5] execVM "crateFiller.sqf"};

Or how does this works?

/Jacob

Share this post


Link to post
Share on other sites

I have to see the script but u can do something like that:

{nul = [_x,"all","all",FALSE,1,12,5] execVM "crateFiller.sqf";} foreach [truck1,truck2,truck3];

It should work :)

Share this post


Link to post
Share on other sites

//Til våben
switch (paramsarray select 4) do {
 case 1: {nul = [mhq1_ammobox,'all','all',FALSE,15,50,15] execVM "crateFiller.sqf"; nul = [mhq1_ammobox1,'all','all',FALSE,15,50,15] execVM "crateFiller.sqf"};
 case 2: {nul = [mhq1_ammobox,'all','all',FALSE,5,12,10] execVM "crateFiller.sqf"; nul = [mhq1_ammobox1,'all','all',FALSE,5,12,10] execVM "crateFiller.sqf"};
 case 3: {nul = [mhq1_ammobox,'all','all',FALSE,1,12,5] execVM "crateFiller.sqf"; nul = [mhq1_ammobox1,'all','all',FALSE,1,12,5] execVM "crateFiller.sqf"};
 case 4: {nul = [mhq1_ammobox,'all','all',true,99,99,99] execVM "crateFiller.sqf"; nul = [mhq1_ammobox1,'all','all',true,99,99,99] execVM "crateFiller.sqf"};
 case 5: {nul = [mhq1_ammobox,'all','all',FALSE,1,12,5] execVM "crateFiller.sqf"; nul = [mhq1_ammobox1,'all','all',FALSE,1,12,5] execVM "crateFiller.sqf"; {nul = [_x,"all","all",FALSE,1,12,5] execVM "crateFiller.sqf";} foreach [we1,we2]};
 case 6: {nul = [mhq1_ammobox,'all','all',FALSE,5,12,10] execVM "crateFiller.sqf"; nul = [mhq1_ammobox1,'all','all',FALSE,5,12,10] execVM "crateFiller.sqf";
{nul = [_x,"all","all",FALSE,5,12,10] execVM "crateFiller.sqf";} foreach [we1,we2]};
};

Isnt that done right?

It doesnt work.

---------- Post added at 11:42 ---------- Previous post was at 11:16 ----------

Okay I found the problem.

It all worked just as it should, thank you very much!

The problem was, that I had a waitUntil at the start of description and I tried it out before the compiling got down to these weapons options. I moved the waituntil to the buttom and now it works as it should.

Edited by JacobJ

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  

×