Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
tophe

Check if any crew is alive.

Recommended Posts

I have this statement on a vehicle:

if ((getDammage _unit > 0.1) and (count crew _unit == 0)) then {doStuff};

That will have the script doStuff when the vehicle is damaged and empty.

But if the crew is killed and left inside the vehicle this won't return the true-value. Since dead crew still counts as crew.

So what I need is something like this:

if ((getDammage _unit > 0.1) and (count [b]alive [/b]crew _unit == 0)) then {doStuff};

I hope you know what I'm after. Any ideas on the syntax for such a statement?

Share this post


Link to post
Share on other sites

Tajin posted a code working in OFP, but no longer in ArmA/ArmA2...

So try this:

if ((getDammage _unit > 0.1) and ([b]{[/b]alive _x[b]}[/b] count crew _unit == 0)) then {doStuff};

btw:

What about an EventHandler "HIT" or "DAMAGE" to run your doStuff? Only an idea... :rolleyes:

Share this post


Link to post
Share on other sites

Thanks guys! I'll try these settings.

I try to stay away from eventhandlers in this script. To make it as easy as possible to setup for any user. I only want the user having to execute the script on a unit, nothing more. If I went to eventhandlers I also would have to rewrite the whole script, since it checks for all kinds of things, not only damage and crew.

Share this post


Link to post
Share on other sites
Tajin posted a code working in OFP, but no longer in ArmA/ArmA2...

Oooops!

Copy&Past can be a bitch :p

Share this post


Link to post
Share on other sites
Sign in to follow this  

×