RonnieJ 10 Posted February 4, 2010 Hey guys... I want some taliban action where you are not considered a danger untill you have a visible weapon or fire oppon the AI patrols... ive made this so far: removeallweapons this; this setcaptive true; this addEventHandler ["fired", {s14 setcaptive false}]; And that works perfectly but I also want that you cant go with a weapon in your hans up to the AI patrol... I need some way of setting the player captive false if he is seen by the patrol with a weapon... :confused: Share this post Link to post Share on other sites
RonnieJ 10 Posted February 4, 2010 Anyone? Cant find any threads about it on the forums... maybe a way to see (ACE2) if the player have the weapon on the back? Share this post Link to post Share on other sites
Cyborg11 10 Posted February 4, 2010 Something like this should work: If (((_enemy knowsAbout _unit) > 1.0) && (_currentWeapon _unit != "")) then { _unit setCaptive false; }; Share this post Link to post Share on other sites
RonnieJ 10 Posted February 5, 2010 Sounds great but how do you assign that enemy? _enemy... can that be "WEST"? Share this post Link to post Share on other sites
Cyborg11 10 Posted February 5, 2010 _enemy can be all :D Like: _enemy = _unit findNearestEnemy _unit; http://community.bistudio.com/wiki/findNearestEnemy Share this post Link to post Share on other sites
RonnieJ 10 Posted February 5, 2010 I tried this in the players init line while {true} do { _enemy = this findNearestEnemy this; If (((_enemy knowsAbout this) > 1.0) && (currentWeapon this != "")) then { this setCaptive false; } else { this setCaptive true; }; }; But it dosent seem to work... any ideas? Share this post Link to post Share on other sites
Big Dawg KS 5 Posted February 6, 2010 Something like this should work: If (((_enemy knowsAbout _unit) > 1.0) && (_currentWeapon _unit != "")) then { _unit setCaptive false; }; The knowsAbout check isn't even really needed. Just toggle captive status on and off when the unit is armed or unarmed, and if an enemy sees him while he's not captive they will engage. Share this post Link to post Share on other sites
RonnieJ 10 Posted February 6, 2010 Big Dawg KS> you got a point :) thats true... Share this post Link to post Share on other sites