Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //controls brought to us by the amazing Bad Benson. His work is outstanding and he has taught me much!
- class CfgPatches
- {
- class Jbad_Vehicle_controls
- {
- units[] = {};
- weapons[] = {};
- requiredVersion = 0.1;
- requiredAddons[] = {};
- };
- };
- class Jbad_controls_RscButton
- {
- access = 0;
- idc = -1;
- type = 1;
- text = "";
- colorText[] = {1,1,1,0.5};
- colorDisabled[] = {1,1,1,1};
- colorBackground[] = {0,0,0,0.3};
- colorBackgroundDisabled[] = {0,0.0,0};
- colorBackgroundActive[] = {0.15,0.35,0.55,0.7};
- colorFocused[] = {0.75,0.75,0.75,0.5};
- colorShadow[] = {0,0,0,0};
- colorBorder[] = {0.023529,0,0.0313725,1};
- soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
- soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
- soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
- soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
- style = 2;
- x = 0;
- y = 0;
- w = 0.055589;
- h = 0.039216;
- shadow = 2;
- font = "EtelkaNarrowMediumPro";
- sizeEx = 0.02921;
- offsetX = 0.003;
- offsetY = 0.003;
- offsetPressedX = 0.002;
- offsetPressedY = 0.002;
- borderSize = 0;
- };
- class Jbad_crane_back
- {
- access = 0;
- type = CT_STATIC;
- style = ST_CENTER;
- idc = -1;
- colorBackground[] = {0,0,0,1};
- colorText[] = {1,1,1,1};
- text = "";
- fixedWidth = 0;
- x = 0;
- y = 0;
- h = 0;
- w = 0;
- shadow = 2;
- font = "PuristaMedium";
- SizeEx = 0.03000;
- };
- class Jbad_Crane_MENU
- {
- idd = -1;
- movingenable = 1;
- onLoad = "uinamespace setvariable ['Jbad_Crane_MENU', _this select 0];";
- class Controls
- {
- class background : Jbad_crane_back
- {
- text = "\Jbad_Defines\Jbad_Vehicle_Controls\data\Screen_Monitor.paa";////your picture here
- idc = -1;
- style = 48;
- x = 0.5 * safezoneW + safezoneX;
- y = 0.2 * safezoneH + safezoneY;
- w = .3 * safezoneW;
- h = .5 * safezoneH;
- color[] = {1,1,1,1};
- colorBackground[] = {0,0,0,0};
- };
- class hook_up: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Down";
- x = "0.72 - 0.005";
- y = "0.5 - 0.1 + 0.05";
- w = "0.1";
- h = "0.1";
- action = "if (((vehicle player) animationPhase 'Hook_1') <= 1) then {(vehicle player) animate ['Hook_1', ((vehicle player) animationPhase 'Hook_1')+0.025]}";
- };
- class hook_down: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Up";
- x = "0.72 - 0.005";
- y = "0.5 - 0.1 - 0.05";
- w = "0.1";
- h = "0.1";
- action = "if (((vehicle player) animationPhase 'Hook_1') >= 0) then {(vehicle player) animate ['Hook_1', ((vehicle player) animationPhase 'Hook_1')-0.025]}";
- };
- class Exit: Jbad_controls_RscButton
- {
- idc = -1;
- text = "";
- colorText[] = {0,0,0,0};
- colorDisabled[] = {0,0,0,0};
- colorBackgroundActive[] = {0,0,0,0};
- colorFocused[] = {0,0,0,0};
- colorShadow[] = {0,0,0,0};
- colorBorder[] = {0,0,0,0};
- x = "1.245 - 0.005 - 0.1";
- y = "0.4 - 0.1 - 0.15";
- w = "0.05";
- h = "0.05";
- action = "closeDialog 0";
- };
- class Pully_foward: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Foward";
- x = "0.72 - 0.005 - 0.101";
- y = "0.3 - 0.1 + 0.005";
- w = "0.1";
- h = "0.1";
- action = "if (((vehicle player) animationPhase 'pully') <= 1) then {(vehicle player) animate ['pully', ((vehicle player) animationPhase 'pully')+0.025]}";
- };
- class Pully_backward: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Backward";
- x = "0.72 - 0.005 + 0.102";
- y = "0.3 - 0.1 + 0.005";
- w = "0.1";
- h = "0.1";
- action = "if (((vehicle player) animationPhase 'pully') >= -1) then {(vehicle player) animate ['pully', ((vehicle player) animationPhase 'pully')-0.025]}";
- };
- class crane_left: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Turn Left";
- x = "0.72 - 0.005 - 0.101";
- y = "0.5 - 0.1 + 0.005";
- w = "0.1";
- h = "0.1";
- action = "if (((vehicle player) animationPhase 'boom') <= 1) then {(vehicle player) animate ['boom', ((vehicle player) animationPhase 'boom')+0.025]}";
- };
- class crane_right: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Turn Right";
- x = "0.72 - 0.005 + 0.102";
- y = "0.5 - 0.1 + 0.005";
- w = "0.1";
- h = "0.1";
- action = "if (((vehicle player) animationPhase 'boom') >= -1) then {(vehicle player) animate ['boom', ((vehicle player) animationPhase 'boom')-0.025]}";
- };
- class crane_attach: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Attach Hook";
- x = "0.5 - 0.1 + 0.58";
- y = "0.5 - 0.1 + 0.12";
- w = "0.1";
- h = "0.1";
- action = "if (((vehicle player) animationPhase 'Hook_1') > 0.5) then {_selpos = (vehicle player) selectionPosition 'Hook_1'; _pos1 = (vehicle player) modeltoworld _selpos; _pos2 = (vehicle player) modeltoworld [_selpos select 0, _selpos select 1, (_selpos select 2) - 2]; _types = (vehicle player) getvariable 'hookblist'; _objs = lineintersectsWith [ATLtoASL _pos1, ATLtoASL _pos2];if (count _objs > 0) then {{if (_x isKindOf (_types select 0)) then {_objs = _objs - [_x]};} foreach _objs}; if (count _objs > 0) then {(_objs select 0) attachto [(vehicle player), [0,0,0], 'Hook_1']; (vehicle player) setvariable ['ishooking', true, true]; (vehicle player) setvariable ['hooked', (_objs select 0), true];};}";
- };
- class crane_detach: Jbad_controls_RscButton
- {
- idc = -1;
- text = "Detach Hook";
- x = "0.5 - 0.1 + 0.58";
- y = "0.5 - 0.1 - 0.25";
- w = "0.1";
- h = "0.1";
- action = "if ((vehicle player) getvariable 'ishooking') then {_obj = (vehicle player) getvariable 'hooked'; detach _obj; _obj setvelocity [0,0,-1]; (vehicle player) setvariable ['ishooking', false, true]; (vehicle player) setvariable ['hooked', [], true];}";
- };
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement