Jump to content
Sign in to follow this  
schadler17

Having multiple addItem commands

Recommended Posts

Basically, I want a medical class to spawn with 10 First Aid Kits and a Medikit. Only I don't want my units init code to look uglier than shit with _unit addItem "firstaidkit" 10 times. I'm OCD as hell and everything has to look perfect for me or it messes with me lol.

 

Is there any way to add multiple items of the same type in a neater fashion? Kinda like addMagazines ["x", 10] or something neater?

Share this post


Link to post
Share on other sites

Fixed using forEach.

 

I always find a solution right when I post. -.-

I should start clicking Preview Post beforehand, think for 10 seconds, then decide to post or not lol.

 

EDIT: Even better solution below.

(unitbackpack _unit) addItemCargoGlobal ["FirstAidKit", 15];

Share this post


Link to post
Share on other sites


for "_i" from 1 to 10 do { this addItems "itemClassName"};

Share this post


Link to post
Share on other sites


for "_i" from 1 to 10 do { this addItems "itemClassName"};

Share this post


Link to post
Share on other sites
for "_i" from 1 to 10 do { this addItems "itemClassName"};

Sorry for triple post, no clue what went wrong :huh:

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  

×