splatsh 10 Posted January 27, 2011 I have this right now: // Code with spawn of vehicle // " // " // " // Code with creation of wayoints // " // " // " // Code with waypoint 2 // Here I have one setWaypointStatements ["true","TheEnd=1;"]; // " // " // " // Code with delete stuff if (TheEnd == 1) then { Delete all stuff }; Now, how can I at best way check if my spawned stuff is alive all the way from start to the end? 1) Create a trigger to check it 2) With other code to check it (what kind of code can I use then) Share this post Link to post Share on other sites
[frl]myke 14 Posted January 27, 2011 Is it important for mission control (mission fails/win when all dead) or is it just to delete it? Share this post Link to post Share on other sites
neokika 62 Posted January 27, 2011 Hi, _vehicle addEventHandler ["killed", { ...code to execute when vehicle is destroyed... }]; _neo_ Share this post Link to post Share on other sites
splatsh 10 Posted January 27, 2011 Myke;1843475']Is it important for mission control (mission fails/win when all dead) or is it just to delete it? It is just for delete stuff =) ---------- Post added at 07:05 PM ---------- Previous post was at 07:04 PM ---------- Hi' date=' _vehicle addEventHandler ["killed", { ...code to execute when vehicle is destroyed... }]; _neo_[/quote'] Is that for alive and canMove to? Or I don't need alive and canMove check? Share this post Link to post Share on other sites
shuko 59 Posted January 27, 2011 Killed EH when the damage is 1, aka the object is dead/destroyed. Share this post Link to post Share on other sites
splatsh 10 Posted January 27, 2011 Killed EH when the damage is 1, aka the object is dead/destroyed. Thanks. ---------- Post added at 07:44 PM ---------- Previous post was at 07:28 PM ---------- It was no good with that check... I shoot it so its engine got damage, so the helo landed. And then the helo got no damage 1. I need to check if vehicle is alive or canMove And if it is not alive and can not move, then I need to do some code. But where to put that code in my code? And what to use: - do while... - If vehicle... Share this post Link to post Share on other sites
neokika 62 Posted January 28, 2011 (edited) Hi again, _vehicle addEventHandler ["Hit", { private ["_vehicle"]; _vehicle = _this select 0; if ((!alive _vehicle) || (!canMove _vehicle)) then { _vehicle removeAllEventHandlers "Hit"; ...more code... }; }]; _neo_ Edited January 28, 2011 by neokika Share this post Link to post Share on other sites
splatsh 10 Posted January 28, 2011 Hi again, _vehicle addEventHandler ["Hit", { private ["_vehicle"]; _vehicle = _this select 0; if ((!alive _vehicle) || (!canMove _vehicle)) then { _vehicle removeAllEventHandlers "Hit"; ...more code... }; }]; _neo_ Wow, cool, thanks =) Share this post Link to post Share on other sites