mattxr 9 Posted January 1, 2007 Can anyone tell me why this doesn't work? needs to be for a .sqs Quote[/b] ]DeathCamArrayTemp = [] "if ((not isNull _x) and (alive _x)) then {DeathCamArrayTemp = DeathCamArrayTemp + [_x]}" foreach DeathCamArray DeathCamArray = DeathCamArrayTemp DeathCamNameCache = [] "if (name _x == ""error: no unit"") then {DeathCamNameCache = DeathCamNameCache + [""object""]} else {DeathCamNameCache = DeathCamNameCache + [name _x]}" foreach DeathCamArray Share this post Link to post Share on other sites
t_d 47 Posted January 2, 2007 foreach needs code so you cant use ""foreach but instead use {}foreach Share this post Link to post Share on other sites
Big Dawg KS 6 Posted January 2, 2007 Indeed, so it should be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">DeathCamArrayTemp = [] {if ((not isNull _x) and (alive _x)) then {DeathCamArrayTemp = DeathCamArrayTemp + [_x]}} foreach DeathCamArray DeathCamArray = DeathCamArrayTemp DeathCamNameCache = [] {if (name _x == "error: no unit") then {DeathCamNameCache = DeathCamNameCache + ["object"]} else {DeathCamNameCache = DeathCamNameCache + [name _x]}} foreach DeathCamArray Share this post Link to post Share on other sites