zagor64bz 1225 Posted April 9, 2018 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
stanhope 412 Posted April 9, 2018 { 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
zagor64bz 1225 Posted April 9, 2018 On 4/9/2018 at 3:41 PM, 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
zagor64bz 1225 Posted April 9, 2018 On 4/9/2018 at 3:41 PM, 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
stanhope 412 Posted April 9, 2018 On 4/9/2018 at 3:43 PM, 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
zagor64bz 1225 Posted April 9, 2018 On 4/9/2018 at 3:46 PM, 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. Share this post Link to post Share on other sites
Grumpy Old Man 3550 Posted April 9, 2018 On 4/9/2018 at 3:34 PM, 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
zagor64bz 1225 Posted April 9, 2018 On 4/9/2018 at 5:06 PM, 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! Share this post Link to post Share on other sites