Jump to content
Sign in to follow this  
Gonobob

Nearestobject problem

Recommended Posts

hi all, can anyone help me? sorry for bad english

_building = nearestObject [player, "HouseBase"]; ---working and all next don't work

if (!(isNull _building)) exitWith {cutText [localize "BUILDING", "PLAIN DOWN"];};

if (_building != objNull ) exitWith {cutText [localize "BUILDING", "PLAIN DOWN"];};

if (_building) exitWith {cutText [localize "BUILDING", "PLAIN DOWN"];};

how can i do exitWith when near building? thanks

Share this post


Link to post
Share on other sites

NearestBuilding might be better for you.

It's a bit quirky - it doesn't find EVERY building such as the control tower building at Loy Manara, but other than that it's pretty reliable. I use it in my IED script to decide if it's in an urban or rural environment. more than 45m is considered rural.

Share this post


Link to post
Share on other sites

thanks mate, i did it

_building = nearestBuilding player;

_distance = player distance _building;

if( _distance < 100) exitWith {cutText [localize "str_player_32", "PLAIN DOWN"];};

Share this post


Link to post
Share on other sites
!isNull _building should work

i tried this, didn't work(

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×