Jump to content
Sign in to follow this  
BEAKSBY

effectiveCommander and addEventHandler "Killed" & StaticWeapon

Recommended Posts

HI All,

Currently in my script you get a reward if you (or your AI) kill the enemy, but doesn't work if you run them over in a tank or other vehicle and they are in a StaticWeapon.

Does it have something to do with "Killed" --> Triggered when the unit is killed. Be careful when the killer has been a vehicle. For most cases the reference of the vehicle is the same as the effectiveCommander, but not always.?

Here are my conditions:

//--- Check if opposite side is killed by _killer && _Killer is not an renegade && unit killed is in an vehicle or a vehicle
if ((side group _killer != side group _unit) && (side _killer != sideEnemy) && (typeOf vehicle _unit isKindOf "LandVehicle") ) then {   

and

//--- Check if opposite side is killed by _killer  && _Killer is not an renegade  && _unit is a man not in a vehicle unless it is a StaticWeapon
if ((side group _killer != side group _unit) && (side _killer != sideEnemy) && (((typeOf _unit isKindOf "Man") && 
(vehicle _unit == _unit)) || (typeOf _unit isKindOf "Man") && (typeOf vehicle _unit isKindOf "StaticWeapon" )) ) then {

Share this post


Link to post
Share on other sites

hello as you run the method got killed when you kill an enemy unit or kill you? could tell me how to do it thanks, if you can private message then I see this post

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  

×