Jump to content

Recommended Posts

Hi I have this:

{_x forceAddUniform "U_B_Wetsuit"} forEach Units player;

works ok.

..this doesn't: 

for "_i" from 1 to 3 do {_x addItemToUniform  "11Rnd_45ACP_Mag";} forEach Units player;

Where's the mistake?

Thank you all.

Share this post


Link to post
Share on other sites
{
	for "_i" from 1 to 3 do {
		_x addItemToUniform "11Rnd_45ACP_Mag";
	}
} forEach Units player;

Didn't test, no guarantees.  Why would you even do 'units player'?

Share this post


Link to post
Share on other sites
Just now, stanhope said:

{
	for "_i" from 1 to 3 do {
	_x addItemToUniform "11Rnd_45ACP_Mag";
	}
} forEach Units player;

Didn't test, no guarantees.  Why would you even do 'units player'?

Need to change gear on player team, which is not defined at mission start, but by player selecting teammates in game.Any other way you'll suggest?

Share this post


Link to post
Share on other sites
3 minutes ago, stanhope said:

{
	for "_i" from 1 to 3 do {
		_x addItemToUniform "11Rnd_45ACP_Mag";
	}
} forEach Units player;

Didn't test, no guarantees.  Why would you even do 'units player'?

IT WORKS OK!!!

Thank you!

Share this post


Link to post
Share on other sites
2 minutes ago, zagor64bz said:

Any other way you'll suggest?

Yea no, never mind, I'm used to writing 'units (group player)' just because I think it's clearer but 'units' also accepts objects.

 

 

 

Share this post


Link to post
Share on other sites
3 minutes ago, stanhope said:

Yea no, never mind, I'm used to writing 'units (group player)' just because I think it's clearer but 'units' also accepts objects.

 

 

 

:drinking2:

Share this post


Link to post
Share on other sites
1 hour ago, zagor64bz said:

Hi I have this:


{_x forceAddUniform "U_B_Wetsuit"} forEach Units player;

works ok.

..this doesn't: 


for "_i" from 1 to 3 do {_x addItemToUniform  "11Rnd_45ACP_Mag";} forEach Units player;

Where's the mistake?

Thank you all.

 

You're missing an opening and closing bracket for the "from to do" loop:

//missing brackets
for "_i" from 1 to 3 do {_x addItemToUniform  "11Rnd_45ACP_Mag";} forEach Units player;

//fixed brackets
for "_i" from 1 to 3 do {{_x addItemToUniform  "11Rnd_45ACP_Mag";} forEach Units player};

//fixed brackets with indentation for better readability
for "_i" from 1 to 3 do {
	{
		_x addItemToUniform  "11Rnd_45ACP_Mag";
	} forEach Units player
};

Get an editor that supports .sqf syntax to easily find errors like that.

Poseidon is a decent choice, made by @Tom_48_97.

Free to use, only has a text box pop up once in a while.

 

Cheers

Share this post


Link to post
Share on other sites
22 minutes ago, Grumpy Old Man said:

 

You're missing an opening and closing bracket for the "from to do" loop:


//missing brackets
for "_i" from 1 to 3 do {_x addItemToUniform  "11Rnd_45ACP_Mag";} forEach Units player;

//fixed brackets
for "_i" from 1 to 3 do {{_x addItemToUniform  "11Rnd_45ACP_Mag";} forEach Units player};

//fixed brackets with indentation for better readability
for "_i" from 1 to 3 do {
	{
		_x addItemToUniform  "11Rnd_45ACP_Mag";
	} forEach Units player
};

Get an editor that supports .sqf syntax to easily find errors like that.

Poseidon is a decent choice, made by @Tom_48_97.

Free to use, only has a text box pop up once in a while.

 

Cheers

Thank you mate!

:drinking2:

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

×