Blanco 0 Posted August 3, 2004 I got a array with weapons : _weapons = ["m16","AK74","steyr",etc...] I wanna check if a unit got one of these weapons in the _Weapons array I can do it with a cycle loop, but I'm asking : is it's possible with a if, then, else statement? I tried : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> If ("_unit hasweapon _x" count _weapons > 0) then {hint "_unit has one of those weapons in the array"} But it doesn't work... Is it possible in a single condition code line? Share this post Link to post Share on other sites
MrZig 0 Posted August 3, 2004 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{IF (_unit hasweapon _X) THEN {hint "Weapon found"}} foreach _weapons Should work Share this post Link to post Share on other sites
Blanco 0 Posted August 4, 2004 yeah, ... looks good, thx Zig. Share this post Link to post Share on other sites