frag 0 Posted November 13, 2013 Hi guys, Let’s say I would like to see a hint “Looking thru range finder†as soon as a player uses the range finder (when he right click to look into it). How I could do that? I would really like to catch that command that would let me know when the player starts looking thru the range finder. Share this post Link to post Share on other sites
f2k sel 164 Posted November 13, 2013 I don't think there is an exact command for this but I haven't checked to see if there are any new commands. if (currentweapon player == "Rangefinder") then {hint "RangeFinder in Use}; would tell you if the RF was in the units hand but not if he's actually looking through it. You could add a check to see if the right button is pressed while holding it. Share this post Link to post Share on other sites
Tankbuster 1733 Posted November 13, 2013 http://community.bistudio.com/wiki/isIRLaserOn might do it? Oh... scratch that... you said rangefinder, not designator :( Share this post Link to post Share on other sites
f2k sel 164 Posted November 13, 2013 If you make an init.sqf file and place this in it it may help a little. waituntil {!(IsNull (findDisplay 46))}; findDisplay 46 displayAddEventHandler ["MouseButtondown","if ((_this select 1)==1 and (currentweapon player == 'Rangefinder')) then {hint 'RangeFinder in Use'}"]; Share this post Link to post Share on other sites
frag 0 Posted November 13, 2013 Hi F2kSel... good idea. I understand what you are trying to do here. But ... what the ((_this select 1)==1 does exactly? What does the _this select 1 represent? Share this post Link to post Share on other sites
Larrow 2802 Posted November 13, 2013 Use camera view to know if you are sighted or not. if ( (currentWeapon player == "Rangefinder") && (cameraView == "GUNNER") ) then { hint "You are looking through your RangeFinder"; //do stuff }; Share this post Link to post Share on other sites
frag 0 Posted November 13, 2013 You guys are my angels ... everything works! THANKS FOR THE HELP! This forum is a bless. Share this post Link to post Share on other sites
f2k sel 164 Posted November 13, 2013 the ((_this select 1)==1 would be the button that is being pressed. I think ((_this select 1)==0 left button and ((_this select 1)==1 is the right ect. But (cameraView == "GUNNER") is a better solution for this problem. Share this post Link to post Share on other sites
Tankbuster 1733 Posted November 13, 2013 Use camera view to know if you are sighted or not. if ( (currentWeapon player == "Rangefinder") && (cameraView == "GUNNER") ) then { hint "You are looking through your RangeFinder"; //do stuff }; That's really cool. Nice job. Share this post Link to post Share on other sites