
Originally Posted by
(Korax @ June 24 2004,07:30)
Well i guess if you use nearestobject right at the same spot as the boat, it will always return the boat as being the closest, no? ***Try checking in random positions AROUND the boat for any people.. like this
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_boat = _this select 0
_timer = 200
#loop
~0.001
_pos = [(getpos _boat select 0)+ 10 - random 20,(getpos _boat select 1)+10 - random 20,0]
_person = nearestObject _pos
? ("man" counttype [_person] == 1 && _person distance _boat < 20) : goto "pickup"
_timer = _timer-1
?(_timer>0):goto "loop"
exit
#Pickup
_person assignAsCargo ***_Boat
_person moveincargo _Boat
_boat Sidechat "Passenger on board"
exit