Jump to content
Sign in to follow this  
mattxr

Little Code HelpHelp

Recommended Posts

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

foreach needs code so you cant use ""foreach but instead use {}foreach

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×