Forum Jump :

Author Message


Posts: 433

Level: Member

Country: de
Location: Bavaria
Occupation: Communications Designer
Age: 36
In-game name: Tajin

#186774 Posted at 2016-02-22 13:56        
// nul = [this] execVM "nearestBpos.sqf"
_unit = _this select 0;
_building = nearestBuilding _unit;

_odist = 99999;
_i = 0;
_sel = 0;

while { (_building buildingPos _i) distance [0,0,0] > 0 } do {
	_dist = (_building buildingPos _i) distance _unit;
	if (_dist < _odist) {
		_sel = _i;
		_odist = _dist;
	_i = _i + 1;

_unit setPos _building buildingPos _sel;
_unit setUnitPos "UP";

Here is another old snipped that is very easy to use. It doesn't fill a house but it automatically places an object at the nearest available building position.

Though this probably isn't that useful anymore, now that we have 3DEN. ^^

There are a lot of very capable people on this forum, willing to spend some of their time to help you out. So if you have a problem, it surely isn't too much to ask that you atleast take the time to describe it properly. Thanks.

Tags: At, Fill, Help, How, Need, Some, To