Jump to content
Sign in to follow this  
1para{god-father}

Vehicle !alive Help

Recommended Posts

I have a convoy and was using !alive for the trucks so i know it has been ambushed but if i shoot the drivers out it will never carry on the code any sugg on how to solve this issue ?  the guys are in a group  _aiGroup

 

i nmeed a way to know if any driver has been shot in the vehicles

waitUntil {(!alive _leadtruck) or (!alive _maintruck) or (!alive _reartruck) };

Thanks

Share this post


Link to post
Share on other sites

You'll need to check if that particular unit is alive, not the truck. When the driver dies, the truck does not.

waitUntil {!(alive driver _leadtruck) or !(alive driver _maintruck) or !(alive driver _reartruck)};

However, if the convoy is ambushed and none of the drivers are killed, the code will not carry on. You may want to check if the units/trucks become damaged rather than killed.

Share this post


Link to post
Share on other sites

Going a step further,

init.sqf or wherever:

TAG_flag_DriverKilled = false;

_drivers = units _aiGroup select {assignedVehicleRole _x isEqualTo "DRIVER"};
{

_x addMPEventHandler ["MPKilled",{TAG_flag_DriverKilled = true}];

} forEach _drivers;

Now you only need to check if TAG_flag_DriverKilled is true.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

is there a way to work of if a Vehicle has stopped i.e taken enough damage it will not move but not destroyed ?

 

 

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  

×