Blitzen88 18 Posted April 21 How can I pull and use a unit's classname in the title of an addaction? For instance: { _Object addaction ["How do I add the classname here", {[_this select 0] execVM "Scripts\Blah.sqf"}]; } foreach units group1; Share this post Link to post Share on other sites
Schatten 275 Posted April 21 Just get unit class name and use it in the title: _Object addAction [format ["How do I add the %1 here", typeOf _x], "Scripts\Blah.sqf"]; Share this post Link to post Share on other sites
Blitzen88 18 Posted April 21 How would you do it if you were pulling from an array? For instance: _array = [ Vehicle1 Vehicle2 Vehicle3 ]; { _Object addaction ["How do I add the name here", {[_this select 0] execVM "Scripts\Blah.sqf"}]; } foreach _array; Share this post Link to post Share on other sites
Schatten 275 Posted April 21 You can do it the same way I did. Share this post Link to post Share on other sites
Schatten 275 Posted April 21 17 minutes ago, Blitzen88 said: How would you do it if you were pulling from an array? Looks like you haven't tried my code. Try it -- replace forEach's body. Pay attention to the second arg for addAction -- just passing the path to the script is enough. Share this post Link to post Share on other sites