Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_pIts","_vehicle_nearestDoors","_vehicle_nearestGatePanel","_vehicle_nearestRoofGatePanel","_cnt","_remoteDoorClassname","_remoteIsWoodGarage","_remoteIsCinderGarage","_remoteLatchClosed","_remoteLatchOpen","_remoteHingeClosed","_remoteHingeOpen","_remoteDoorClosed","_remoteDoorOpen","_remoteDoorCode"];
- player_currentVehicle removeAction s_vehicle_remote;
- s_vehicle_remote = -1;
- _pIts = items player;
- if (!("ItemRadio" in _pIts)) exitWith {
- titleText["Sorry, you need a Radio to use this function!", "PLAIN", 3];
- sleep 10;
- s_vehicle_remote = -1;
- };
- s_vehicle_remotedoorunlockcode = -1;
- s_vehicle_remotedoorunlock = -1;
- s_vehicle_remotedooropen = -1;
- s_vehicle_remotedoorclose = -1;
- s_vehicle_remotedoorlockcode = -1;
- s_vehicle_remotedoorlock = -1;
- s_vehicle_enterCodeRemote = -1;
- s_vehicle_remotegateup = -1;
- s_vehicle_remotegatedown = -1;
- keyValid = false;
- gateAccess = false;
- _vehicle_nearestGatePanel = nearestObjects [player_currentVehicle, ["Infostand_2_EP1","Infostand_1_EP1"], 30];
- if (count _vehicle_nearestGatePanel > 0) then {
- vehicle_near_GatePanel = _vehicle_nearestGatePanel select 0;
- } else {
- vehicle_near_GatePanel = objNull;
- };
- _vehicle_nearestDoors = nearestObjects [player_currentVehicle, ["CinderWallDoorLocked_DZ","Land_DZE_GarageWoodDoorLocked"], 30];
- if (count _vehicle_nearestDoors > 0) then {
- vehicle_near_lockedDoor = _vehicle_nearestDoors select 0;
- } else {
- vehicle_near_lockedDoor = objNull;
- };
- if (isNull vehicle_near_GatePanel && isNull vehicle_near_lockedDoor) exitWith {
- titleText["Sorry, no Gate-Panels or Garages found in range...", "PLAIN", 3];
- s_vehicle_remote = -1;
- };
- titleText ["### Gate-Panel or Garage found ### Control activated for 60 seconds ###", "PLAIN", 1];
- sleep 1;
- _cnt = 59;
- gateAccess = true;
- while {gateAccess} do
- {
- if (_cnt == 0) exitWith {
- titleText ["### Time is up ### Remote connection Terminated ###", "PLAIN", 3];
- };
- titleText [format["### Remote connection get terminated in %1 seconds ###", _cnt], "PLAIN",1];
- if ((vehicle player) == player) exitWith {
- titleText ["### You left the Vehicle ### Remote connection Terminated ###", "PLAIN", 3];
- };
- if (!isNull vehicle_near_lockedDoor) then {
- if (vehicle_near_lockedDoor distance player_currentVehicle <= 30 && vehicle_near_lockedDoor distance player_currentVehicle >= 3) then {
- _remoteDoorClassname = (vehicle_near_lockedDoor getVariable["Classname","0"]);
- _remoteIsWoodGarage = (_remoteDoorClassname == "Land_DZE_GarageWoodDoorLocked");
- _remoteIsCinderGarage = (_remoteDoorClassname == "CinderWallDoorLocked_DZ");
- _remoteLatchClosed = (vehicle_near_lockedDoor animationPhase "Open_latch" == 0);
- _remoteLatchOpen = (vehicle_near_lockedDoor animationPhase "Open_latch" == 1);
- _remoteHingeClosed = (vehicle_near_lockedDoor animationPhase "Open_hinge" == 0);
- _remoteHingeOpen = (vehicle_near_lockedDoor animationPhase "Open_hinge" == 1);
- _remoteDoorClosed = (vehicle_near_lockedDoor animationPhase "Open_door" == 0);
- _remoteDoorOpen = (vehicle_near_lockedDoor animationPhase "Open_door" == 1);
- _remoteDoorCode = (vehicle_near_lockedDoor getvariable['CharacterID','0']);
- if (_remoteDoorClosed && ((_remoteIsCinderGarage && _remoteLatchClosed) || (_remoteIsWoodGarage && _remoteHingeClosed))) then {
- if (DZE_Lock_Door != _remoteDoorCode) then {
- if (s_vehicle_remotedoorunlock != -1) then {
- player_currentVehicle removeAction s_vehicle_remotedoorunlock;
- s_vehicle_remotedoorunlock = -1;
- };
- if (s_vehicle_remotedoorunlockcode <0) then {
- s_vehicle_remotedoorunlockcode = player_currentVehicle addAction [("<t color=""#FF4000"">" + ("Unlock Door") +"</t>"), "custom\vehicle_remotedoorcode.sqf",player_currentVehicle,1, true, true, "",""];
- };
- } else {
- if (s_vehicle_remotedoorunlockcode != -1) then {
- player_currentVehicle removeAction s_vehicle_remotedoorunlockcode;
- s_vehicle_remotedoorunlockcode = -1;
- };
- if (s_vehicle_remotedoorunlock <0) then {
- s_vehicle_remotedoorunlock = player_currentVehicle addAction [("<t color=""#FF4000"">" + ("Unlock Door") +"</t>"), "custom\vehicle_remoteunlockdoor.sqf","",1,true,true,"",""];
- };
- };
- } else {
- player_currentVehicle removeAction s_vehicle_remotedoorunlock;
- s_vehicle_remotedoorunlock = -1;
- player_currentVehicle removeAction s_vehicle_remotedoorunlockcode;
- s_vehicle_remotedoorunlockcode = -1;
- };
- if (_remoteDoorClosed and ((_remoteIsCinderGarage && _remoteLatchOpen) || (_remoteIsWoodGarage && _remoteHingeOpen))) then {
- if (vehicle_remotedooropen <0) then {
- vehicle_remotedooropen = player_currentVehicle addAction [("<t color=""#FF4000"">" + ("Open Door") +"</t>"), "custom\vehicle_remoteopendoor.sqf","",1,true,true,"",""];
- };
- } else {
- player_currentVehicle removeAction vehicle_remotedooropen;
- vehicle_remotedooropen = -1;
- };
- if (_remoteDoorOpen and ((_remoteIsCinderGarage && _remoteLatchOpen) || (_remoteIsWoodGarage && _remoteHingeOpen))) then {
- if (vehicle_remotedoorclose <0) then {
- vehicle_remotedoorclose = player_currentVehicle addAction [("<t color=""#FF4000"">" + ("Close Door") +"</t>"), "custom\vehicle_remoteclosedoor.sqf","",1,true,true,"",""];
- };
- } else {
- player_currentVehicle removeAction vehicle_remotedoorclose;
- vehicle_remotedoorclose = -1;
- };
- if (_remoteDoorClosed && ((_remoteIsCinderGarage && _remoteLatchOpen) || (_remoteIsWoodGarage && _remoteHingeOpen))) then {
- if (DZE_Lock_Door != _remoteDoorCode) then {
- if (s_vehicle_remotedoorlock != -1) then {
- player_currentVehicle removeAction s_vehicle_remotedoorlock;
- s_vehicle_remotedoorlock = -1;
- };
- if (s_vehicle_remotedoorlockcode <0) then {
- s_vehicle_remotedoorlockcode = player_currentVehicle addAction [("<t color=""#FF4000"">" + ("Lock Door") +"</t>"), "custom\vehicle_remotedoorcode.sqf",player_currentVehicle,1, true, true, "",""];
- };
- } else {
- if (s_vehicle_remotedoorlockcode != -1) then {
- player_currentVehicle removeAction s_vehicle_remotedoorlockcode;
- s_vehicle_remotedoorlockcode = -1;
- };
- if (s_vehicle_remotedoorlock <0) then {
- s_vehicle_remotedoorlock = player_currentVehicle addAction [("<t color=""#FF4000"">" + ("Lock Door") +"</t>"), "custom\vehicle_remotelockdoor.sqf","",1,true,true,"",""];
- };
- };
- } else {
- player_currentVehicle removeAction s_vehicle_remotedoorlock;
- s_vehicle_remotedoorlock = -1;
- player_currentVehicle removeAction s_vehicle_remotedoorlockcode;
- s_vehicle_remotedoorlockcode = -1;
- };
- } else {
- player_currentVehicle removeAction s_vehicle_remotedoorunlockcode;
- s_vehicle_remotedoorunlockcode = -1;
- player_currentVehicle removeAction s_vehicle_remotedoorunlock;
- s_vehicle_remotedoorunlock = -1;
- player_currentVehicle removeAction s_vehicle_remotedooropen;
- s_vehicle_remotedooropen = -1;
- player_currentVehicle removeAction s_vehicle_remotedoorclose;
- s_vehicle_remotedoorclose = -1;
- player_currentVehicle removeAction s_vehicle_remotedoorlockcode;
- s_vehicle_remotedoorlockcode = -1;
- player_currentVehicle removeAction s_vehicle_remotedoorlock;
- s_vehicle_remotedoorlock = -1;
- };
- };
- if (!isNull vehicle_near_GatePanel) then {
- if (player_currentVehicle distance vehicle_near_GatePanel <=30 && player_currentVehicle distance vehicle_near_GatePanel >=3) then {
- if (!keyValid) then {
- player_currentVehicle removeAction s_vehicle_remotegateup;
- s_vehicle_remotegateup = -1;
- player_currentVehicle removeAction s_vehicle_remotegatedown;
- s_vehicle_remotegatedown = -1;
- if (s_vehicle_enterCodeRemote < 0) then {
- s_vehicle_enterCodeRemote = player_currentVehicle addaction [("<t color=""#FF4000"">" + ("Enter Key Code to Operate Gate") +"</t>"),"dayz_code\external\keypad\fnc_keyPad\vehicle_enterCodeRemote.sqf",vehicle_near_GatePanel,1,true,true,"",""];
- };
- } else {
- player_currentVehicle removeAction s_vehicle_enterCodeRemote;
- s_vehicle_enterCodeRemote = -1;
- if (s_vehicle_remotegateup < 0) then {
- s_vehicle_remotegateup = player_currentVehicle addaction [("<t color=""#FF4000"">" + ("Operate Gate - UP") +"</t>"), "dayz_code\external\keypad\fnc_keyPad\vehicle_operate_gates_up_remote.sqf",vehicle_near_GatePanel,2,false,true,"",""];
- };
- if (s_vehicle_remotegatedown < 0) then {
- s_vehicle_remotegatedown = player_currentVehicle addaction [("<t color=""#FF4000"">" + ("Operate Gate - DOWN") +"</t>"), "dayz_code\external\keypad\fnc_keyPad\vehicle_operate_gates_down_remote.sqf",vehicle_near_GatePanel,1,false,true,"",""];
- };
- };
- } else {
- player_currentVehicle removeAction s_vehicle_enterCodeRemote;
- s_vehicle_enterCodeRemote = -1;
- player_currentVehicle removeAction s_vehicle_remotegateup;
- s_vehicle_remotegateup = -1;
- player_currentVehicle removeAction s_vehicle_remotegatedown;
- s_vehicle_remotegatedown = -1;
- };
- };
- if ((!isNull vehicle_near_lockedDoor && vehicle_near_lockedDoor distance player_currentVehicle > 30) || (!isNull vehicle_near_GatePanel && player_currentVehicle distance vehicle_near_GatePanel > 30)) exitWith {
- titleText["### Remote connection Terminated ### Distance to high! ###", "PLAIN", 3];
- };
- _cnt = _cnt - 1;
- sleep 1;
- };
- cutText["","PLAIN",1];
- player_currentVehicle removeAction s_vehicle_remotedoorunlock;
- player_currentVehicle removeAction s_vehicle_remotedoorunlockcode;
- player_currentVehicle removeAction s_vehicle_remotedooropen;
- player_currentVehicle removeAction s_vehicle_remotedoorclose;
- player_currentVehicle removeAction s_vehicle_remotedoorlockcode;
- player_currentVehicle removeAction s_vehicle_remotedoorlock;
- player_currentVehicle removeAction s_vehicle_enterCodeRemote;
- player_currentVehicle removeAction s_vehicle_remotegateup;
- player_currentVehicle removeAction s_vehicle_remotegatedown;
- s_vehicle_remote = -1;
- keyValid = false;
- gateAccess = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement