Hi there,
First of all thaks a lot for this script, i was placing unit inside buildings by using the code below in the init field of a unit:
this setPosATL [2038.46,2704.55,4.13975];
and i was using this script in the init.sqf in order to get the right coords (x,y,z):
while {true} do {
copyToClipboard str getposATL player;
hint str getposATL player;
sleep 0.2;
};
Secondly, back to your topic, it's very easy to get your script working on the VANILLA version..
CBA_fnc_getNearestBuilding
private ["_building", "_i"];
_building = nearestBuilding _this;
_i = 0;
while {str(_building buildingPos _i) != str([0,0,0])} do {
_i = _i + 1;
};
[_building, _i]
In order to replace CBA_fnc_shuffle you can use something like the following:
_allItems = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
_selectedItems = [];
_howManyToSelect = 20;
while {_howManyToSelect != 0} do {
_add = _allItems select (floor(random(count _allItems)));
if (!(_add in _selectedItems)) then {
_selectedItems = selectedItems + [_add];
_howManyToSelect = howManyToSelect - 1;
};
};
Let me know if you need any help!
CYA