addaction when close to a building

Merg

Well-Known Member
Hi,

Im working on a script, but i have a problem. How do i make a scroll bar appear when Im close to a building?

I tried this :
PHP:
_objects = ["some building here","and another"];

if  (player distance _object) < 5)) then {
is_close_to"= true; } else { is_close_to"= false;};

if((speed player <= 1) && _canDo && is_close_to=true;  ) then {
        if (action_name < 0) then {
        action_name = player addaction
 
You can create a trigger at the building position:
http://community.bistudio.com/wiki/createTrigger

Then use setTriggerStatements to make the trigger add an action:
http://community.bistudio.com/wiki/setTriggerStatements
http://community.bistudio.com/wiki/addAction
Thanks but i want it to work on all buildings and not just one. Do you know a solution? Like how someone made the water pumps drinkable.

Here's the link: http://opendayz.net/threads/release-drink-water-v2-0.13493/
 
I was just going to ask if this code was necessary :)
Code:
if (!_canDrink) then {
  _objectsWell = nearestObjects [_playerPos, [], 4];
  {
  //Check for Well
  _isWell = ["_well",str(_x),false] call fnc_inString;
  if (_isWell) then {_canDrink = true};
  } forEach _objectsWell;
};

Thanks again.
 
Back
Top