Sorry for double post but i have a related questiion.
do the different buildings have different floor heights? barns higher than hangars? etc
reason i ask is that setting the weaponholder a bit higher doesnt always seem to be enough, but setting it too high makes the damn weapons float in space.
also, i die a lot from the invisible boundary of the weapon holder? that seems mad but i can run into it at full speed and i die.
how to turn the invisible box around weapon holders off?
the code i am using...
Code:
// inspiration taken from Tophe's random house patrol script
// and very very useful help from Zonekiller
sleep 0.5;
if (!isServer) exitWith {};
private ["_Position1"];
// introduce random chance
_Position1 = _this select 0;
_position = getPos _Position1;
_house = nearestBuilding _Position1;
_x = 0;
_notbugged = true;
while { format ["%1", _house buildingPos _x] != "[0,0,0]" } do {_x = _x + 1};
_x = _x - 1;
_Position1 setPos (_house buildingPos (random _x));
if ((getPos _Position1 select 0 == 0) and (getPos _Position1 select 1 == 0)) then
{_Position1 setPos _position; _notbugged = false;
_Position1 globalChat format ["Choose a different building"];
Smoke3 = "SmokeshellGreen" createVehicle getPos _Position1;
};
_chance = floor (random 10);
if (_chance <=7) then {
//Smoke1 = "Smokeshell" createVehicle getPos _Position1;
_arrayw = ["LeeEnfield","AK_47_M","SVD_des_EP1","RPG7V","Huntingrifle"];
_arraya = ["10x_303","30Rnd_762x39_AK47","10Rnd_762x54_SVD","PG7VR","5x_22_LR_17_HMR"];
_randnum = floor (random (count _arrayw));
_WeaponH = _arrayw select _randnum;
_ammoH = _arraya select _randnum;
_randammo = ceil (random 6);
Weapon1 = "weaponHolder" createVehicle getpos _Position1 ;Weapon1 addWeaponCargo [_WeaponH,1];
Weapon1 addMagazineCargo [_ammoH,_randammo];
_tempos = getPos Weapon1;
Weapon1 setposATL[(getPosATL _Position1 select 0),(getPosATL _Position1 select 1), 0.05];
};
if (_chance >7 ) then {
Smoke1 = "SmokeshellRed" createVehicle getPos _Position1;
};
// called with _nil = [this] execVM "randammoinbuilding.sqf"