JacobJ 10 Posted June 16, 2011 (edited) Here is a bit of a script I have found and tweaked a bit: waitUntil {!isNull player}; // Array of markers pre placed in the editor at diffrent locations. _markers1 = ["balota", "kozlovka", "nadezhdino","mogilevka","pusta","elektrozavodsk"]; /// Pick some random positions to put the hummer _pos1 = (getmarkerPos (_markers1 select (floor(random(count _markers1))))); // Move the hummer to this random position humrescue setPos _pos1; if (_pos1 == (getmarkerpos (_markers1 select 5))) then { humrescue setTriggerArea [500, 500, 0, false]; }; The problem is, that I can't get the if statement to work. I what it to check (have the condition) that when _pos1 is elektrozavodsk it sets the triggerarea larger. But what I have there doesnt work. I thought I just could put _markers1 select 5 into the condition ()'s but that didnt work either. What can I do to make it happen? /Jacob Edited June 16, 2011 by JacobJ Forgot the title Share this post Link to post Share on other sites
demonized 16 Posted June 16, 2011 because you cannot compare a array to another one, you can however get distance and compare that. and i ofc asume that humrescue is a trigger not a hummer..... if not then the triggername needs to be fixed. waitUntil {!isNull player}; // Array of markers pre placed in the editor at diffrent locations. _markers1 = ["balota", "kozlovka", "nadezhdino","mogilevka","pusta","elektrozavodsk"]; /// Pick some random positions to put the hummer _pos1 = (getmarkerPos (_markers1 select (floor(random(count _markers1))))); // Move the hummer to this random position humrescue setPos _pos1; if ( [b](_pos1 distance (getmarkerpos "elektrozavodsk")) == 0[/b] ) then { humrescue setTriggerArea [500, 500, 0, false]; }; Share this post Link to post Share on other sites
JacobJ 10 Posted June 16, 2011 Arh okay I see. So arrays can't be compared, that I will have to remember. I see the logic in your solution and of course your solution works as it should! Thanks ps. the humrescue is a trigger. Share this post Link to post Share on other sites