-FW- Shaanguy 10 Posted February 13, 2015 TestIDS = []; TestIDS = TestIDS + [player addAction["<img image='MyPicture.paa' width='32' height='32'/> Pickup Something", "Pickup_Something.sqf", [], 1, false, false, "", "count (_name = nearestobjects [_target, ["CLASSNAME"], 5]) != 0 && _name getVariable 'something' = 4"]]; the problem here is that i cant give a name, i wanted to if the object is locked or getVariable "something" < 5 then the addaction appears, O_o .................................... Share this post Link to post Share on other sites
jshock 513 Posted February 13, 2015 player addAction [ "<img image='MyPicture.paa' width='32' height='32'/> Pickup Something", "Pickup_Something.sqf", [], 1, false, false, "", "{_x getVariable 'something' isEqualTo 4} count (nearestObjects [getPos _target,'CLASSNAME',5]) > 0" ]; Share this post Link to post Share on other sites
-FW- Shaanguy 10 Posted February 13, 2015 used this: player addAction [ "<img image='' width='32' height='32'/> Pickup Something", "Pickup_Something.sqf", [], 1, false, false, "", "{_x getVariable 'test' > 1} count (nearestObjects [getPos _target,'Land_PaperBox_closed_F',5]) > 0" ]; i did this setVariable ["test" 1]; in the init of the object but still the addaction does not appears, am i doing something wrong here? Share this post Link to post Share on other sites
t-800a 151 Posted February 13, 2015 You are chekcing for _x getVariable 'test' is-bigger-then 1, and 1 is not bigger then 1. ;) Share this post Link to post Share on other sites
-FW- Shaanguy 10 Posted February 21, 2015 Posted By t-800a You are chekcing for _x getVariable 'test' is-bigger-then 1, and 1 is not bigger then 1. oh yeah my mistake, but i tried this: player addAction [ "<img image='' width='32' height='32'/> Pickup Something", "Pickup_Something.sqf", [], 1, false, false, "", "{locked _x == true} count (nearestObjects [getPos _target,'C_Offroad_01_F',5]) > 0" ]; Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted February 21, 2015 (edited) Shaanguy;2879819']i did this setVariable ["test" 1]; in the init of the object Did you actually write it exactly like this? Because it's gotta be this setVariable ["test"' date='[/b'] 1]; Also, since ArmA 3, locked does not return a boolean, but a number depending on the locked state as vehicles can also be locked for player only etc. So, instead of "locked _x == true", you have to check for "locked _x == 2". Be aware though that if locked == 1 (default state), it's still different from e.g. 2 even though 1 and 2 may both mean "is locked". And the types parameter for nearestObjects has to be an array, so try this as action condition: "{locked _x == 2} count (nearestObjects [getPos _target,['C_Offroad_01_F'],5]) > 0" Edited February 21, 2015 by Heeeere's Johnny! Share this post Link to post Share on other sites