BEAKSBY 11 Posted June 19, 2014 Has anyone had issues with sideEnemy before? I'm running the following in my initServer.sqf _handle = _x addEventHandler [ "Killed", { _unit = _this select 0; _killer = _this select 1; _handle = _unit getVariable [ "DNA_EH_Killed_Money", -1 ]; if ((side group _killer != side group _unit) && (side group _killer != sideEnemy)) then { hint format ["side group _killer: %1 \n side group _unit: %2", side group _killer, side group _unit]; {...more code} }; ...and when a player kills a friendly on the map he turns purple, yet the hint side group _killer still diplays he is still on his original side, and the code after the if statement is also executed as if the condition was TRUE?I thought it would display as "renegade" or "enemy"? How then do I ensure that if a player kills one of his own the following is FALSE? ((side group _killer != side group _unit) && (side group _killer != sideEnemy)) Share this post Link to post Share on other sites
Lala14 135 Posted June 19, 2014 (side _killer != sideEnemy) ? Share this post Link to post Share on other sites
Lala14 135 Posted June 20, 2014 maybe even !(side _killer isEqualTo sideEnemy) Share this post Link to post Share on other sites
Tajin 349 Posted June 20, 2014 (edited) Not sure about sideEnemy, maybe that one is a bit outdated. Try checking "rating" against -2000 instead. Alternately if you're not just looking for renegades, you can use this to check if someone is hostile: _unit countEnemy [_killer] > 0; Edited June 20, 2014 by Tajin Share this post Link to post Share on other sites
John Kozak 14 Posted June 20, 2014 Has anyone had issues with sideEnemy before?I'm running the following in my initServer.sqf _handle = _x addEventHandler [ "Killed", { _unit = _this select 0; _killer = _this select 1; _handle = _unit getVariable [ "DNA_EH_Killed_Money", -1 ]; if ((side group _killer != side group _unit) && (side group _killer != sideEnemy)) then { hint format ["side group _killer: %1 \n side group _unit: %2", side group _killer, side group _unit]; {...more code} }; ...and when a player kills a friendly on the map he turns purple, yet the hint still diplays he is still on his original side, and the code after the if statement is also executed as if the condition was TRUE? I thought it would display as "renegade" or "enemy"? How then do I ensure that if a player kills one of his own the following is FALSE? ((side group _killer != side group _unit) && (side group _killer != sideEnemy)) I'd guess your code is executed before the actual side change... side _unit returns ENEMY pretty reliable if the rating is in big negative Share this post Link to post Share on other sites
BEAKSBY 11 Posted June 20, 2014 (side _killer != sideEnemy) ? I went with this one and it works. To DarkWanderer's point I'd guess your code is executed before the actual side change... I think this is no longer true, as the addEventHandler "Killed" respects the if condition in my code now that I replaced it with side _killer != sideEnemy.Thanks again everyone Share this post Link to post Share on other sites