My Code:
private ["_Dik","_DikCode","_acceptableCodes","_add","_addtoXfront","_addtoXside","_addtoYfront","_addtoYside","_altState","_bldgDir","_bldgDir-90","_cosfront","_cosside","_ctrlState","_pos","_shiftState","_sinfront","_sinside","_this"];
systemChat(format["_this passed: %1",_this]);
_Dik = _this select 0;
systemChat(format["BuildObj passed: %1",BuildObj]);
_DikCode = _Dik select 1; integer
systemChat(format["_DikCode passed: %1",_DikCode]);
_shiftState = _Dik select 2; boolean
_ctrlState = _Dik select 3; boolean
_altState = _Dik select 4; // boolean
_acceptableCodes = [199,210,207,211,16,18,201,209];
if (!(_DikCode in _acceptableCodes)) exitWith {};
_add = .001;
if (_shiftState) then {
_add = .01;
};
if (_ctrlState) then {
_add = .1;
};
if (_altState) then {
_add = 1;
};
_pos = getPosWorld BuildObj;
_xpos = _pos select 0;
_ypos = _pos select 1;
_zpos = _pos select 2;
if (_DikCode == 201) then {
BuildObj setPosWorld [_xpos,_ypos,_zpos + _add];
};
if (_DikCode == 209) then {
BuildObj setPosWorld [_xpos,_ypos,_zpos - _add];
};
_add = 1;
if (_shiftState) then {
_add = 5;
};
if (_ctrlState) then {
_add = 15;
};
if (_altState) then {
_add = 45;
};
if (_DikCode == 16) then {
["F",_add] execVM "A3ResourceWarCl\PlayerScripts\building\vectors\Yaw.sqf";
};
if (_DikCode == 18) then {
["B",_add] execVM "A3ResourceWarCl\PlayerScripts\building\vectors\Yaw.sqf";
};
_add = .01;
if (_shiftState) then {
_add = .1;
};
if (_ctrlState) then {
_add = 1;
};
if (_altState) then {
_add = 4;
};
_sinside = 0.000000000000000 + sin(Bldgyaw);
systemChat(format["_sinside: %1",_sinside]);
_cosside = 0.000000000000000 + cos(Bldgyaw);
systemChat(format["_cosside: %1",_cosside]);
_sinfront = 0.000000000000000 + sin(Bldgyaw-90);
systemChat(format["_sinfront: %1",_sinfront]);
_cosfront = 0.000000000000000 + cos(Bldgyaw-90);
systemChat(format["_cosfront: %1",_cosfront]);
if (_DikCode == 199) then {
BuildObj setPosWorld [_xpos + (_sinside * _add),_ypos + (_cosside * _add),_zpos];
};
if (_DikCode == 207) then {
BuildObj setPosWorld [_xpos - (_sinside * _add),_ypos - (_cosside * _add),_zpos];
};
if (_DikCode == 210) then {
BuildObj setPosWorld [_xpos + (_sinfront * _add),_ypos + (_cosfront * _add),_zpos];
};
if (_DikCode == 211) then {
BuildObj setPosWorld [_xpos - (_sinfront * _add),_ypos - (_cosfront * _add),_zpos];
};