dan3ko 10 Posted February 21, 2015 Hello. I need some help. What is wrong in this code? [color="#FF8040"] [color="#191970"][b]private[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"_guard"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_tropa"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_mecan"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_all"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"sold1"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold2"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold3"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold4"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold5"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold6"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_tropa[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"sold8"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold9"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold10"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold11"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold12"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold13"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold14"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_mecan[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"sold15"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold16"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold17"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_all[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_tropa[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_mecan[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"oficial1"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold7"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]removeAllWeapons[/b][/color] [color="#1874CD"]_all[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeVest[/b][/color] [color="#1874CD"]_all[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeUniform[/b][/color] [color="#1874CD"]_all[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeHeadgear[/b][/color] [color="#1874CD"]_all[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_all[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_guard[/color] [color="#191970"][b]unassignItem[/b][/color] [color="#7A7A7A"]"NVGoggles"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_guard[/color] [color="#191970"][b]removeItem[/b][/color] [color="#7A7A7A"]"NVGoggles"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_guard[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform_tshirt"[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]addVest[/b][/color] [color="#7A7A7A"]"V_Rangemaster_belt"[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]addHeadgear[/b][/color] [color="#7A7A7A"]"H_MilCap_dgtl"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_tropa[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold7"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_tropa[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold7"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]addVest[/b][/color] [color="#7A7A7A"]"V_TacVest_oli"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_tropa[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold7"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]addHeadgear[/b][/color] [color="#7A7A7A"]"H_Booniehat_indp"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_tropa[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold7"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_mecan[/color] [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform_shortsleeve"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_mecan[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]![/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]daytime[/b][/color] [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]5[/color] [color="#8B3E2F"][b]&[/b][/color][color="#8B3E2F"][b]&[/b][/color] [color="#191970"][b]daytime[/b][/color] [color="#8B3E2F"][b]>[/b][/color] [color="#FF0000"]19[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b]{[/b][/color] this [color="#191970"][b]addItem[/b][/color] [color="#7A7A7A"]"NVGoggles_INDEP"[/color][color="#8B3E2F"][b];[/b][/color] this [color="#191970"][b]assignItem[/b][/color] [color="#7A7A7A"]"NVGoggles_INDEP"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_guard[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addWeaponGlobal[/b][/color] [color="#7A7A7A"]"srifle_EBR_ARCO_pointer_F"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"sold7"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [/color] Made with KK's SQF to BBCode Converter Share this post Link to post Share on other sites
jshock 513 Posted February 21, 2015 (edited) Your "_all" array looks like this currently: _all = [["sold1","sold2","sold3","sold4","sold5","sold6"],["sold8","sold9","sold10","sold11","sold12","sold13","sold14"],["sold15","sold16","sold17"],"oficial1","sold7"]; You need to make it like this: _all = _guard + _tropa + _mecan + ["oficial1","sold7"]; But since you didn't say what wasn't working, I don't have any other helpful information. And within the forEach scope you use "_x", not the name of the array your filtering through: private ["_guard","_tropa","_mecan","_all"]; _guard = ["sold1","sold2","sold3","sold4","sold5","sold6"]; _tropa = ["sold8","sold9","sold10","sold11","sold12","sold13","sold14"]; _mecan = ["sold15","sold16","sold17"]; _all = _guard + _tropa + _mecan + ["oficial1","sold7"]; { removeAllWeapons _x; removeVest _x; removeUniform _x; removeHeadgear _x; } forEach _all; { _x unassignItem "NVGoggles"; _x removeItem "NVGoggles"; } forEach _guard; oficial1 forceAddUniform "U_I_CombatUniform_tshirt"; oficial1 addVest "V_Rangemaster_belt"; oficial1 addHeadgear "H_MilCap_dgtl"; { _x forceAddUniform "U_I_CombatUniform"; _x addVest "V_TacVest_oli"; _x addHeadgear "H_Booniehat_indp"; } forEach [_guard,_tropa,"sold7"]; { _x forceAddUniform "U_I_CombatUniform_shortsleeve"; } forEach _mecan; if (!(daytime < 5 && daytime > 19)) then { { _x addItem "NVGoggles_INDEP"; _x assignItem "NVGoggles_INDEP"; } forEach _guard; }; { _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addWeaponGlobal "srifle_EBR_ARCO_pointer_F"; } forEach [_guard,"sold7"]; And you had a syntax error in the adding NVGs portion of the code, fixed above. And if each of those name in those arrays are editor placed units, you don't need the names in quotes, as they are variable names, not strings. Edited February 21, 2015 by JShock Share this post Link to post Share on other sites
654wak654 25 Posted February 21, 2015 (edited) That's not how the forEach loop works, that's probably why almost none of this code is working. Every other section should be the same as the magazine one in the bottom, using the special variable "_x" instead of the array it self inside the forEach loop again. JShock seems to be writing everything as I'm still thinking them so my job here is done I guess :P Edited February 21, 2015 by 654wak654 Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 21, 2015 _all = [_guard,_tropa,_mecan,[color="#FF0000"]"oficial1"[/color],[color="#FF0000"]"sold7"[/color]]; _all = [_guard,_tropa,_mecan,[color="#008000"]oficial1[/color],[color="#008000"]sold7[/color]]; looks like you are referring to objects as strings in the array. If they are objects then do not put "" around their variable names. Share this post Link to post Share on other sites
jshock 513 Posted February 21, 2015 _all = [_guard,_tropa,_mecan,[color="#FF0000"]"oficial1"[/color],[color="#FF0000"]"sold7"[/color]]; _all = [_guard,_tropa,_mecan,[color="#008000"]oficial1[/color],[color="#008000"]sold7[/color]]; looks like you are referring to objects as strings in the array. If they are objects then do not put "" around their variable names. Yea, I'm assuming he will be changing all of those elements in each of his arrays that's why I made the point of: And if each of those name in those arrays are editor placed units, you don't need the names in quotes, as they are variable names, not strings. Share this post Link to post Share on other sites
dan3ko 10 Posted February 21, 2015 But since you didn't say what wasn't working, I don't have any other helpful information. I need to change the default uniforms for some soldiers on the map to new ones given by me. Now the soldiers spawns without any uniform, vest, weapon or goggles. Sorry if I didn't understand all you say me, my english isn't very good. Thanks for your help. At now the only soldier with working code is the "official1" unit. [color="#FF8040"][color="#191970"][b]private[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"_guard"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_tropa"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_mecan"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_all"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold1[color="#8B3E2F"][b],[/b][/color]sold2[color="#8B3E2F"][b],[/b][/color]sold3[color="#8B3E2F"][b],[/b][/color]sold4[color="#8B3E2F"][b],[/b][/color]sold5[color="#8B3E2F"][b],[/b][/color]sold6[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_tropa[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold8[color="#8B3E2F"][b],[/b][/color]sold9[color="#8B3E2F"][b],[/b][/color]sold10[color="#8B3E2F"][b],[/b][/color]sold11[color="#8B3E2F"][b],[/b][/color]sold12[color="#8B3E2F"][b],[/b][/color]sold13[color="#8B3E2F"][b],[/b][/color]sold14[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_mecan[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold15[color="#8B3E2F"][b],[/b][/color]sold16[color="#8B3E2F"][b],[/b][/color]sold17[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_all[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#1874CD"]_tropa[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#1874CD"]_mecan[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b][[/b][/color]oficial1[color="#8B3E2F"][b],[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]removeAllWeapons[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeVest[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeUniform[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeHeadgear[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_all[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]unassignItem[/b][/color] [color="#7A7A7A"]"NVGoggles"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]removeItem[/b][/color] [color="#7A7A7A"]"NVGoggles"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_guard[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform_tshirt"[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]addVest[/b][/color] [color="#7A7A7A"]"V_Rangemaster_belt"[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]addHeadgear[/b][/color] [color="#7A7A7A"]"H_MilCap_dgtl"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addVest[/b][/color] [color="#7A7A7A"]"V_TacVest_oli"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addHeadgear[/b][/color] [color="#7A7A7A"]"H_Booniehat_indp"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_tropa[/color][color="#8B3E2F"][b],[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform_shortsleeve"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_mecan[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]![/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]daytime[/b][/color] [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]5[/color] [color="#8B3E2F"][b]&[/b][/color][color="#8B3E2F"][b]&[/b][/color] [color="#191970"][b]daytime[/b][/color] [color="#8B3E2F"][b]>[/b][/color] [color="#FF0000"]19[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addItem[/b][/color] [color="#7A7A7A"]"NVGoggles_INDEP"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]assignItem[/b][/color] [color="#7A7A7A"]"NVGoggles_INDEP"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_guard[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addWeaponGlobal[/b][/color] [color="#7A7A7A"]"srifle_EBR_ARCO_pointer_F"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_guard[/color][color="#8B3E2F"][b],[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter Share this post Link to post Share on other sites
jshock 513 Posted February 21, 2015 (edited) Ok, and just realized the following blocks need to be changed (similar issue to the "_all" array): { _x forceAddUniform "U_I_CombatUniform"; _x addVest "V_TacVest_oli"; _x addHeadgear "H_Booniehat_indp"; } forEach (_guard + _tropa + [sold7]); { _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addMagazineGlobal "20Rnd_762x51_Mag"; _x addWeaponGlobal "srifle_EBR_ARCO_pointer_F"; } forEach _guard + [sold7]; EDIT: And to help us out with future issues turn on -showScriptErrors on in your Steam Startup Parameters (would need to put in the param then restart your game), then report any errors that may pop up :). Edited February 21, 2015 by JShock Share this post Link to post Share on other sites
654wak654 25 Posted February 21, 2015 The end part still has problems, replace the part after the offical1 lines with this: [color=#FF8040][color=#8B3E2F][b]{[/b][/color] [color=#000000]_x[/color] [color=#191970][b]forceAddUniform[/b][/color] [color=#7A7A7A]"U_I_CombatUniform"[/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addVest[/b][/color] [color=#7A7A7A]"V_TacVest_oli"[/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addHeadgear[/b][/color] [color=#7A7A7A]"H_Booniehat_indp"[/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]}[/b][/color] [color=#191970][b]forEach[/b][/color] [color=#1874CD]_guard[/color] [color=#8B3E2F][b]+[/b][/color] [color=#1874CD]_tropa[/color] [color=#8B3E2F][b]+[/b][/color] [color=#8B3E2F][b][[/b][/color]sold7[color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]{[/b][/color][color=#000000]_x[/color] [color=#191970][b]forceAddUniform[/b][/color] [color=#7A7A7A]"U_I_CombatUniform_shortsleeve"[/color][color=#8B3E2F][b]}[/b][/color] [color=#191970][b]forEach[/b][/color] [color=#1874CD]_mecan[/color][color=#8B3E2F][b];[/b][/color] [color=#191970][b]if[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#8B3E2F][b]![/b][/color][color=#8B3E2F][b]([/b][/color][color=#191970][b]daytime[/b][/color] [color=#8B3E2F][b]<[/b][/color] [color=#FF0000]5[/color] [color=#8B3E2F][b]&[/b][/color][color=#8B3E2F][b]&[/b][/color] [color=#191970][b]daytime[/b][/color] [color=#8B3E2F][b]>[/b][/color] [color=#FF0000]19[/color][color=#8B3E2F][b])[/b][/color][color=#8B3E2F][b])[/b][/color] [color=#191970][b]then[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addItem[/b][/color] [color=#7A7A7A]"NVGoggles_INDEP"[/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_x[/color] [color=#191970][b]assignItem[/b][/color] [color=#7A7A7A]"NVGoggles_INDEP"[/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]}[/b][/color] [color=#191970][b]forEach[/b][/color] [color=#1874CD]_guard[/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addMagazineGlobal[/b][/color] [color=#7A7A7A]"20Rnd_762x51_Mag"[/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addMagazineGlobal[/b][/color] [color=#7A7A7A]"20Rnd_762x51_Mag"[/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addMagazineGlobal[/b][/color] [color=#7A7A7A]"20Rnd_762x51_Mag"[/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addMagazineGlobal[/b][/color] [color=#7A7A7A]"20Rnd_762x51_Mag"[/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_x[/color] [color=#191970][b]addWeaponGlobal[/b][/color] [color=#7A7A7A]"srifle_EBR_ARCO_pointer_F"[/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]}[/b][/color] [color=#191970][b]forEach[/b][/color] [color=#1874CD]_guard[/color] [color=#8B3E2F][b]+[/b][/color] [color=#8B3E2F][b][[/b][/color]sold7[color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter EDIT: I'm starting to remember why I don't post in BI forums a lot... Share this post Link to post Share on other sites
jshock 513 Posted February 21, 2015 EDIT: I'm starting to remember why I don't post in BI forums a lot... Sorry, my fingers and mind are moving fast today :p. Share this post Link to post Share on other sites
dan3ko 10 Posted February 21, 2015 Thank you very much, now works perfectly. But in your code was an error. This: [color="#FF8040"][color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_tropa[/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color][/color] must be: [color="#FF8040"][color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#1874CD"]_tropa[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color][/color] Definitive code was: [color="#FF8040"][color="#191970"][b]private[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"_guard"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_tropa"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_mecan"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_all"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold1[color="#8B3E2F"][b],[/b][/color]sold2[color="#8B3E2F"][b],[/b][/color]sold3[color="#8B3E2F"][b],[/b][/color]sold4[color="#8B3E2F"][b],[/b][/color]sold5[color="#8B3E2F"][b],[/b][/color]sold6[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_tropa[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold8[color="#8B3E2F"][b],[/b][/color]sold9[color="#8B3E2F"][b],[/b][/color]sold10[color="#8B3E2F"][b],[/b][/color]sold11[color="#8B3E2F"][b],[/b][/color]sold12[color="#8B3E2F"][b],[/b][/color]sold13[color="#8B3E2F"][b],[/b][/color]sold14[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_mecan[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold15[color="#8B3E2F"][b],[/b][/color]sold16[color="#8B3E2F"][b],[/b][/color]sold17[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_all[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#1874CD"]_tropa[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#1874CD"]_mecan[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b][[/b][/color]oficial1[color="#8B3E2F"][b],[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]removeAllWeapons[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeVest[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeUniform[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]removeHeadgear[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_all[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]unassignItem[/b][/color] [color="#7A7A7A"]"NVGoggles"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]removeItem[/b][/color] [color="#7A7A7A"]"NVGoggles"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_guard[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform_tshirt"[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]addVest[/b][/color] [color="#7A7A7A"]"V_Rangemaster_belt"[/color][color="#8B3E2F"][b];[/b][/color] oficial1 [color="#191970"][b]addHeadgear[/b][/color] [color="#7A7A7A"]"H_MilCap_dgtl"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addVest[/b][/color] [color="#7A7A7A"]"V_TacVest_oli"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addHeadgear[/b][/color] [color="#7A7A7A"]"H_Booniehat_indp"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#1874CD"]_tropa[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]forceAddUniform[/b][/color] [color="#7A7A7A"]"U_I_CombatUniform_shortsleeve"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_mecan[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]![/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]daytime[/b][/color] [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]5[/color] [color="#8B3E2F"][b]&[/b][/color][color="#8B3E2F"][b]&[/b][/color] [color="#191970"][b]daytime[/b][/color] [color="#8B3E2F"][b]>[/b][/color] [color="#FF0000"]19[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addItem[/b][/color] [color="#7A7A7A"]"NVGoggles_INDEP"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]assignItem[/b][/color] [color="#7A7A7A"]"NVGoggles_INDEP"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_guard[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addMagazineGlobal[/b][/color] [color="#7A7A7A"]"20Rnd_762x51_Mag"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]addWeaponGlobal[/b][/color] [color="#7A7A7A"]"srifle_EBR_ARCO_pointer_F"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#1874CD"]_guard[/color] [color="#8B3E2F"][b]+[/b][/color] [color="#8B3E2F"][b][[/b][/color]sold7[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [/color] Made with KK's SQF to BBCode Converter Thanks for your help. Share this post Link to post Share on other sites
jshock 513 Posted February 21, 2015 But in your code was an error. Yea I actually realized that as well and updated above I guess before you refreshed your browser :p, happy it's working. Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 21, 2015 Yea, I'm assuming he will be changing all of those elements in each of his arrays that's why I made the point of: ahh true :) i should read mroe before posting Share this post Link to post Share on other sites