Jump to content

1.6.2 [Remote Lock/Unlock Veh] USING KEYBOARD.sqf


juandayz

Recommended Posts

VIDEO:

Spoiler

 

If (You dont have a custom compiles.sqf or a custom keyboard.sqf) exitWith { step1;}else{ proceed with step 2; } forEach user;

1-Making a custom compiles.sqf and custom keyboard.sqf

Spoiler

 We gonna need create a custom compiles.sqf to call our custom keyboard.sqf if u already have a custom compiles.sqf just paste the call for keyboard.sqf

1-A-Open your init.sqf and find:


call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

//BELOW PASTE:

call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";

now into mpmissions\your instance\dayz_code\init\  create compiles.sqf with that code inside:   (if u dont have the path..just create it)

Spoiler


if (!isDedicated) then {
DZ_KeyDown_EH = compile preprocessFileLineNumbers "dayz_code\compile\keyboard.sqf";
};

 

1-B  copy keyboard.sqf   from:  ...\@DayZ_Epoch\addons\dayz_code.pbo\compile\  to:       ...\mpmissions\your instance\dayz_code\compile\     (if u dont have the path. jsut create it)

 

 

2-In your CUSTOM!!! keyboard.sqf at bottom but before the last "_handled" paste:

Spoiler

if (_dikCode == 0x12) then {[]execVM "scripts\remote_key.sqf";}; //#E KEY //remote  Change by another if u want 

 

3-Create remote_key.sqf  (mpmissions\your instance\scripts\ )

Spoiler

private ["_onLadder","_vehicle","_canDo","_vehicleOwnerID","_totalKeys","_temp_keys","_temp_keys_names","_hasKey","_oldOwner","_uid"];
_vehicle = cursorTarget;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; 
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
if !(_vehicle isKindOf "AllVehicles" && {player distance _vehicle < 50}) exitWith {};
if (!alive _vehicle) exitWith {systemchat "<REMOTE_KEY>:THIS VEHICLE IS DAMAGED DO YOU SEE";};
if !(_vehicleOwnerID != "0" && _canDo) exitWith {systemchat "<REMOTE_KEY>:SOMETHING WRONG WITH YOU OR YOU VEHICLE";};
//update by juandayz for free :D
_totalKeys = call epoch_tempKeys;
_temp_keys = _totalKeys select 0;
_temp_keys_names = _totalKeys select 1;	
_hasKey = _vehicleOwnerID in _temp_keys;
_uid = getPlayerUID player;
_oldOwner = (_vehicleOwnerID == _uid);
if !(_hasKey or _oldOwner) exitWith {systemchat "<REMOTE_KEY>:THIS IS NOT YOUR VEHICLE";};
//if is locked
player playActionNow "GesturePoint";
if(locked _vehicle) then {
PVDZE_veh_Lock = [_vehicle,false];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
//null = [objNull,_vehicle,rSAY,"carLock",80] call RE;
systemChat("<REMOTE_KEY>:Vehicle has been unlocked");
if (!isEngineOn _vehicle) then {_vehicle engineOn true;};
}else{ 
//If is unlocked
PVDZE_veh_Lock = [_vehicle,true];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
//null = [objNull,_vehicle,rSAY,"carLock",80] call RE;
systemChat("<REMOTE_KEY>:Vehicle has been locked");
if (isEngineOn _vehicle) then {
if !(_vehicle isKindOf "Helicopter") then {_vehicle engineOn false;
}else{_hf = fuel _vehicle;_vehicle setFuel 0;_vehicle engineOn false;uiSleep 5; _vehicle setFuel _hf;};
};
};

 

 

Link to comment
Share on other sites

Spoiler

//private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];
disableSerialization;
_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;

if (carryClick) then {carryClick = false;};

if (_button == 1) then {
    private ["_conf","_name","_compile","_height","_item"];
    _group = _parent displayCtrl 6902;

    _pos = ctrlPosition _group;

    _item = gearSlotData _control;    
    if ( //No right click action
        (!DZE_SelfTransfuse && _item in ["ItemBloodbag","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]) or
        (!dayz_groupSystem && _item == "ItemRadio")
    ) exitWith {};
    if (mouseOverCarry) then {
        _item = DayZ_onBack;
        carryClick = true;
    };

    _pos set [0,((_this select 2) + 0.46)];
    _pos set [1,((_this select 3) + 0.07)];

    _conf = configFile >> "cfgMagazines" >> _item;
    if (!isClass _conf) then {
        _conf = configFile >> "cfgWeapons" >> _item;
    };
    _name = getText(_conf >> "displayName");

    _cfgActions = _conf >> "ItemActions";
    _numActions = (count _cfgActions);
    _height = 0;

    //Populate Menu
    for "_i" from 0 to (_numActions - 1) do
    {
        _menu = _parent displayCtrl (1600 + _i);
        _menu ctrlShow true;
        _config = (_cfgActions select _i);
        _type = getText (_config >> "text");
        _script = getText (_config >> "script");
        _outputOriented = getNumber (_config >> "outputOriented") == 1;
        _height = _height + (0.025 * safezoneH);
        _compile = format["_id = '%2' %1;",_script,_item];
        uiNamespace setVariable ['uiControl', _control];
        if (_outputOriented) then {
            /*
                This flag means that the action is output oriented
                the output class will then be transferred to the script
                and the type used for the name
            */
            _array = getArray (_config >> "output");
            _outputClass = _array select 0;
            _outputType = _array select 1;
            _name = getText (configFile >> _outputType >> _outputClass >> "displayName");
            _compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
        };

        _menu ctrlSetText format[_type,_name];
        _menu ctrlSetEventHandler ["ButtonClick",_compile];
    };
    
    /*
        Begin: Vehicle remote lock/unlock
    */
        _itemsPlayer = items player;
        
        _temp_keys = [];
        _temp_keys_names = [];
        // find available keys
        _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
        if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
            _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
            _ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
            _temp_keys_names set [_ownerKeyId,_ownerKeyName];
            
            _objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
            _i = 0;
            {
                if (alive _x) then {
                    _ownerID = _x getVariable ["CharacterID", "0"];
                    _hasKey = (_ownerID == str(_ownerKeyId));
                    _oldOwner = (_ownerID == dayz_playerUID);

                    if(_hasKey or _oldOwner) then {
                        if(locked _x) then {
                            //Unlock
                            _menu =  _parent displayCtrl (1600 + _numActions);
                            _menu ctrlShow true;
                            _text =  "Unlock";
                            _script =  "[""" + _ownerID + """] execVM ""scripts\remote_key\remote_unlock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        } else {
                            //Lock
                            _menu =  _parent displayCtrl (1600 + _numActions);
                            _menu ctrlShow true;
                            _text =  "Lock";
                            _script =  "[""" + _ownerID + """] execVM ""scripts\remote_key\remote_lock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        };
                        //Engine start
                        _menu =  _parent displayCtrl (1600 + _numActions + 1);
                        _menu ctrlShow true;
                        _text =  "Engine";
                        _script =  "[""" + _ownerID + """] execVM ""scripts\remote_key\remote_engine.sqf""";
                        _height = _height + (0.025 * safezoneH);
                        uiNamespace setVariable ['uiControl', _control];
                        _menu ctrlSetText _text;
                        _menu ctrlSetEventHandler ["ButtonClick",_script];
                    };
                    
                    _i = _i + 1;
                };
            } forEach _objects;
        };
    /*
        End: Vehicle remote lock/unlock
    */    
    
    _pos set [3,_height];

    //hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];

    _group ctrlShow true;
    ctrlSetFocus _group;
    _group ctrlSetPosition _pos;
    _group ctrlCommit 0;
};

   @juandayz    I also have an extra rc and click actions.

Link to comment
Share on other sites

1 minute ago, Hooty said:
  Reveal hidden contents

//private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];
disableSerialization;
_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;

if (carryClick) then {carryClick = false;};

if (_button == 1) then {
    private ["_conf","_name","_compile","_height","_item"];
    _group = _parent displayCtrl 6902;

    _pos = ctrlPosition _group;

    _item = gearSlotData _control;    
    if ( //No right click action
        (!DZE_SelfTransfuse && _item in ["ItemBloodbag","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]) or
        (!dayz_groupSystem && _item == "ItemRadio")
    ) exitWith {};
    if (mouseOverCarry) then {
        _item = DayZ_onBack;
        carryClick = true;
    };

    _pos set [0,((_this select 2) + 0.46)];
    _pos set [1,((_this select 3) + 0.07)];

    _conf = configFile >> "cfgMagazines" >> _item;
    if (!isClass _conf) then {
        _conf = configFile >> "cfgWeapons" >> _item;
    };
    _name = getText(_conf >> "displayName");

    _cfgActions = _conf >> "ItemActions";
    _numActions = (count _cfgActions);
    _height = 0;

    //Populate Menu
    for "_i" from 0 to (_numActions - 1) do
    {
        _menu = _parent displayCtrl (1600 + _i);
        _menu ctrlShow true;
        _config = (_cfgActions select _i);
        _type = getText (_config >> "text");
        _script = getText (_config >> "script");
        _outputOriented = getNumber (_config >> "outputOriented") == 1;
        _height = _height + (0.025 * safezoneH);
        _compile = format["_id = '%2' %1;",_script,_item];
        uiNamespace setVariable ['uiControl', _control];
        if (_outputOriented) then {
            /*
                This flag means that the action is output oriented
                the output class will then be transferred to the script
                and the type used for the name
            */
            _array = getArray (_config >> "output");
            _outputClass = _array select 0;
            _outputType = _array select 1;
            _name = getText (configFile >> _outputType >> _outputClass >> "displayName");
            _compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
        };

        _menu ctrlSetText format[_type,_name];
        _menu ctrlSetEventHandler ["ButtonClick",_compile];
    };
    
    /*
        Begin: Vehicle remote lock/unlock
    */
        _itemsPlayer = items player;
        
        _temp_keys = [];
        _temp_keys_names = [];
        // find available keys
        _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
        if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
            _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
            _ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
            _temp_keys_names set [_ownerKeyId,_ownerKeyName];
            
            _objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
            _i = 0;
            {
                if (alive _x) then {
                    _ownerID = _x getVariable ["CharacterID", "0"];
                    _hasKey = (_ownerID == str(_ownerKeyId));
                    _oldOwner = (_ownerID == dayz_playerUID);

                    if(_hasKey or _oldOwner) then {
                        if(locked _x) then {
                            //Unlock
                            _menu =  _parent displayCtrl (1600 + _numActions);
                            _menu ctrlShow true;
                            _text =  "Unlock";
                            _script =  "[""" + _ownerID + """] execVM ""scripts\remote_key\remote_unlock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        } else {
                            //Lock
                            _menu =  _parent displayCtrl (1600 + _numActions);
                            _menu ctrlShow true;
                            _text =  "Lock";
                            _script =  "[""" + _ownerID + """] execVM ""scripts\remote_key\remote_lock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        };
                        //Engine start
                        _menu =  _parent displayCtrl (1600 + _numActions + 1);
                        _menu ctrlShow true;
                        _text =  "Engine";
                        _script =  "[""" + _ownerID + """] execVM ""scripts\remote_key\remote_engine.sqf""";
                        _height = _height + (0.025 * safezoneH);
                        uiNamespace setVariable ['uiControl', _control];
                        _menu ctrlSetText _text;
                        _menu ctrlSetEventHandler ["ButtonClick",_script];
                    };
                    
                    _i = _i + 1;
                };
            } forEach _objects;
        };
    /*
        End: Vehicle remote lock/unlock
    */    
    
    _pos set [3,_height];

    //hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];

    _group ctrlShow true;
    ctrlSetFocus _group;
    _group ctrlSetPosition _pos;
    _group ctrlCommit 0;
};

   @juandayz    I also have an extra rc and click actions.

yes i also use it with extra_rc.hpp ... compare with mine.

Spoiler

//private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];
disableSerialization;
_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;

if (carryClick) then {carryClick = false;};

if (_button == 1) then {
	private ["_conf","_name","_compile","_height","_item"];
	_group = _parent displayCtrl 6902;

	_pos = ctrlPosition _group;

	_item = gearSlotData _control;	
	if ( //No right click action
		(!DZE_SelfTransfuse && _item in ["ItemBloodbag","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]) or
		(!dayz_groupSystem && _item == "ItemRadio")
	) exitWith {};
	if (mouseOverCarry) then {
		_item = DayZ_onBack;
		carryClick = true;
	};

	_pos set [0,((_this select 2) + 0.46)];
	_pos set [1,((_this select 3) + 0.07)];

	_conf = configFile >> "cfgMagazines" >> _item;
	if (!isClass _conf) then {
		_conf = configFile >> "cfgWeapons" >> _item;
	};
	_name = getText(_conf >> "displayName");

	_cfgActions = _conf >> "ItemActions";
	_numActions = (count _cfgActions);
	_height = 0;

	//Populate Menu
	for "_i" from 0 to (_numActions - 1) do
	{
		_menu = _parent displayCtrl (1600 + _i);
		_menu ctrlShow true;
		_config = (_cfgActions select _i);
		_type = getText (_config >> "text");
		_script = getText (_config >> "script");
		_outputOriented = getNumber (_config >> "outputOriented") == 1;
		_height = _height + (0.025 * safezoneH);
		_compile = format["_id = '%2' %1;",_script,_item];
		uiNamespace setVariable ['uiControl', _control];
		if (_outputOriented) then {
			/*
				This flag means that the action is output oriented
				the output class will then be transferred to the script
				and the type used for the name
			*/
			_array = getArray (_config >> "output");
			_outputClass = _array select 0;
			_outputType = _array select 1;
			_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
			_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
		};

		_menu ctrlSetText format[_type,_name];
		_menu ctrlSetEventHandler ["ButtonClick",_compile];
	};
	//EXTRA_RC
	
	_erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
    _erc_numActions = (count _erc_cfgActions);
    if (isClass _erc_cfgActions) then {
     for "_j" from 0 to (_erc_numActions - 1) do
     {
       _menu =  _parent displayCtrl (1600 + _j + _numActions);
       _menu ctrlShow true;
       _config =  (_erc_cfgActions select _j);
       _text =  getText (_config >> "text");
       _script =  getText (_config >> "script");
       _height = _height + (0.025 * safezoneH);
       uiNamespace setVariable ['uiControl', _control];
       _menu ctrlSetText _text;
       _menu ctrlSetEventHandler ["ButtonClick",_script];
      };
   };
	//EXTRA_RC
	
	/*
		Begin: Vehicle remote lock/unlock
	*/
		_itemsPlayer = items player;
		
		_temp_keys = [];
		_temp_keys_names = [];
		// find available keys
		_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
			_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
			_temp_keys_names set [_ownerKeyId,_ownerKeyName];
			
			_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
			_i = 0;
			{
				if (alive _x) then {
					_ownerID = _x getVariable ["CharacterID", "0"];
					_hasKey = (_ownerID == str(_ownerKeyId));
					_oldOwner = (_ownerID == dayz_playerUID);

					if(_hasKey or _oldOwner) then {
						if(locked _x) then {
							//Unlock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Unlock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						} else {
							//Lock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Lock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						};
						//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 1);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					
					_i = _i + 1;
				};
			} forEach _objects;
		};
	/*
		End: Vehicle remote lock/unlock
	*/	
	
	_pos set [3,_height];

	//hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];

	_group ctrlShow true;
	ctrlSetFocus _group;
	_group ctrlSetPosition _pos;
	_group ctrlCommit 0;
};

 

 

Link to comment
Share on other sites

4 minutes ago, juandayz said:

yes i also use it with extra_rc.hpp ... compare with mine.

  Hide contents


//private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];
disableSerialization;
_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;

if (carryClick) then {carryClick = false;};

if (_button == 1) then {
	private ["_conf","_name","_compile","_height","_item"];
	_group = _parent displayCtrl 6902;

	_pos = ctrlPosition _group;

	_item = gearSlotData _control;	
	if ( //No right click action
		(!DZE_SelfTransfuse && _item in ["ItemBloodbag","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]) or
		(!dayz_groupSystem && _item == "ItemRadio")
	) exitWith {};
	if (mouseOverCarry) then {
		_item = DayZ_onBack;
		carryClick = true;
	};

	_pos set [0,((_this select 2) + 0.46)];
	_pos set [1,((_this select 3) + 0.07)];

	_conf = configFile >> "cfgMagazines" >> _item;
	if (!isClass _conf) then {
		_conf = configFile >> "cfgWeapons" >> _item;
	};
	_name = getText(_conf >> "displayName");

	_cfgActions = _conf >> "ItemActions";
	_numActions = (count _cfgActions);
	_height = 0;

	//Populate Menu
	for "_i" from 0 to (_numActions - 1) do
	{
		_menu = _parent displayCtrl (1600 + _i);
		_menu ctrlShow true;
		_config = (_cfgActions select _i);
		_type = getText (_config >> "text");
		_script = getText (_config >> "script");
		_outputOriented = getNumber (_config >> "outputOriented") == 1;
		_height = _height + (0.025 * safezoneH);
		_compile = format["_id = '%2' %1;",_script,_item];
		uiNamespace setVariable ['uiControl', _control];
		if (_outputOriented) then {
			/*
				This flag means that the action is output oriented
				the output class will then be transferred to the script
				and the type used for the name
			*/
			_array = getArray (_config >> "output");
			_outputClass = _array select 0;
			_outputType = _array select 1;
			_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
			_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
		};

		_menu ctrlSetText format[_type,_name];
		_menu ctrlSetEventHandler ["ButtonClick",_compile];
	};
	//EXTRA_RC
	
	_erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
    _erc_numActions = (count _erc_cfgActions);
    if (isClass _erc_cfgActions) then {
     for "_j" from 0 to (_erc_numActions - 1) do
     {
       _menu =  _parent displayCtrl (1600 + _j + _numActions);
       _menu ctrlShow true;
       _config =  (_erc_cfgActions select _j);
       _text =  getText (_config >> "text");
       _script =  getText (_config >> "script");
       _height = _height + (0.025 * safezoneH);
       uiNamespace setVariable ['uiControl', _control];
       _menu ctrlSetText _text;
       _menu ctrlSetEventHandler ["ButtonClick",_script];
      };
   };
	//EXTRA_RC
	
	/*
		Begin: Vehicle remote lock/unlock
	*/
		_itemsPlayer = items player;
		
		_temp_keys = [];
		_temp_keys_names = [];
		// find available keys
		_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
			_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
			_temp_keys_names set [_ownerKeyId,_ownerKeyName];
			
			_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
			_i = 0;
			{
				if (alive _x) then {
					_ownerID = _x getVariable ["CharacterID", "0"];
					_hasKey = (_ownerID == str(_ownerKeyId));
					_oldOwner = (_ownerID == dayz_playerUID);

					if(_hasKey or _oldOwner) then {
						if(locked _x) then {
							//Unlock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Unlock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						} else {
							//Lock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Lock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						};
						//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 1);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					
					_i = _i + 1;
				};
			} forEach _objects;
		};
	/*
		End: Vehicle remote lock/unlock
	*/	
	
	_pos set [3,_height];

	//hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];

	_group ctrlShow true;
	ctrlSetFocus _group;
	_group ctrlSetPosition _pos;
	_group ctrlCommit 0;
};

 

 

This was missing lol

Spoiler


    _erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
    _erc_numActions = (count _erc_cfgActions);
    if (isClass _erc_cfgActions) then {
     for "_j" from 0 to (_erc_numActions - 1) do
     {
       _menu =  _parent displayCtrl (1600 + _j + _numActions);
       _menu ctrlShow true;
       _config =  (_erc_cfgActions select _j);
       _text =  getText (_config >> "text");
       _script =  getText (_config >> "script");
       _height = _height + (0.025 * safezoneH);
       uiNamespace setVariable ['uiControl', _control];
       _menu ctrlSetText _text;
       _menu ctrlSetEventHandler ["ButtonClick",_script];
      };
   };
 

 

Link to comment
Share on other sites

@Hooty

using deployanything, extra_rc and remote_key  your ui_selectSlot.sqf  looks:

Spoiler

//private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];
disableSerialization;
_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;

if (carryClick) then {carryClick = false;};

if (_button == 1) then {
	private ["_conf","_name","_compile","_height","_item"];
	_group = _parent displayCtrl 6902;

	_pos = ctrlPosition _group;

	_item = gearSlotData _control;	
	if ( //No right click action
		(!DZE_SelfTransfuse && _item in ["ItemBloodbag","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]) or
		(!dayz_groupSystem && _item == "ItemRadio")
	) exitWith {};
	if (mouseOverCarry) then {
		_item = DayZ_onBack;
		carryClick = true;
	};

	_pos set [0,((_this select 2) + 0.46)];
	_pos set [1,((_this select 3) + 0.07)];

	_conf = configFile >> "cfgMagazines" >> _item;
	if (!isClass _conf) then {
		_conf = configFile >> "cfgWeapons" >> _item;
	};
	_name = getText(_conf >> "displayName");

	_cfgActions = _conf >> "ItemActions";
	_numActions = (count _cfgActions);
	_height = 0;

	//Populate Menu
	for "_i" from 0 to (_numActions - 1) do
	{
		_menu = _parent displayCtrl (1600 + _i);
		_menu ctrlShow true;
		_config = (_cfgActions select _i);
		_type = getText (_config >> "text");
		_script = getText (_config >> "script");
		_outputOriented = getNumber (_config >> "outputOriented") == 1;
		_height = _height + (0.025 * safezoneH);
		_compile = format["_id = '%2' %1;",_script,_item];
		uiNamespace setVariable ['uiControl', _control];
		if (_outputOriented) then {
			/*
				This flag means that the action is output oriented
				the output class will then be transferred to the script
				and the type used for the name
			*/
			_array = getArray (_config >> "output");
			_outputClass = _array select 0;
			_outputType = _array select 1;
			_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
			_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
		};

		_menu ctrlSetText format[_type,_name];
		_menu ctrlSetEventHandler ["ButtonClick",_compile];
	};
	
	
	
	
	//### BEGIN MODIFIED CODE: extra click actions
	{
		private["_classname","_text","_execute","_condition"];
		_classname   = _x select 0;
	    _text        = _x select 1;
		_execute     = _x select 2;
		_condition   = _x select 3;
		// if the clicked item matches, then assign the script call and display text
		if(_item == _classname && (call compile _condition)) then {
			_menu = _parent displayCtrl (1600 + _numActions);
			_menu ctrlShow true;
			_height = _height + (0.025 * safezoneH);
			uiNamespace setVariable ['uiControl', _control];
			_menu ctrlSetText _text;
			_menu ctrlSetEventHandler ["ButtonClick",_execute];
			_numActions = _numActions + 1;
		};
	} forEach DZE_CLICK_ACTIONS;
	//### END MODIFIED CODE: extra click actions
	
		//EXTRA_RC
	
	_erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
    _erc_numActions = (count _erc_cfgActions);
    if (isClass _erc_cfgActions) then {
     for "_j" from 0 to (_erc_numActions - 1) do
     {
       _menu =  _parent displayCtrl (1600 + _j + _numActions);
       _menu ctrlShow true;
       _config =  (_erc_cfgActions select _j);
       _text =  getText (_config >> "text");
       _script =  getText (_config >> "script");
       _height = _height + (0.025 * safezoneH);
       uiNamespace setVariable ['uiControl', _control];
       _menu ctrlSetText _text;
       _menu ctrlSetEventHandler ["ButtonClick",_script];
      };
   };
	//EXTRA_RC
	
	/*
		Begin: Vehicle remote lock/unlock
	*/
		_itemsPlayer = items player;
		
		_temp_keys = [];
		_temp_keys_names = [];
		// find available keys
		_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
			_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
			_temp_keys_names set [_ownerKeyId,_ownerKeyName];
			
			_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
			_i = 0;
			{
				if (alive _x) then {
					_ownerID = _x getVariable ["CharacterID", "0"];
					_hasKey = (_ownerID == str(_ownerKeyId));
					_oldOwner = (_ownerID == dayz_playerUID);

					if(_hasKey or _oldOwner) then {
						if(locked _x) then {
							//Unlock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Unlock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						} else {
							//Lock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Lock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						};
						//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 1);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					
					_i = _i + 1;
				};
			} forEach _objects;
		};
	/*
		End: Vehicle remote lock/unlock
	*/	
	
	
	_pos set [3,_height];

	//hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];

	_group ctrlShow true;
	ctrlSetFocus _group;
	_group ctrlSetPosition _pos;
	_group ctrlCommit 0;
};

 

and your compiles.sqf look:

player_selectSlot =			compile preprocessFileLineNumbers "overwrites\click_actions\ui_selectSlot.sqf";

 

Link to comment
Share on other sites

If u wanna add a Vehicle Sound Finder. then:

1-in your ui_selectslot.sqf

Spoiler

find:


_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];

change by:


_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 150];

Find:


//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 1);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
						

below paste:



						//finder
						_menu =  _parent displayCtrl (1600 + _numActions + 2);
						_menu ctrlShow true;
						_text =  "Finder";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_finder.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];

 

2-create remote_finder.sqf into remote_key folder

Spoiler

(FindDisplay 106) closeDisplay 1;
private ["_ownerID","_objects","_i","_ownerID2","_vehicle","_sounddist"];
_ownerID = _this select 0;

_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 150];
_i = 0;
{
	_vehicle = _x;
	if (alive _vehicle) then {
		_ownerID2 = _vehicle getVariable ["CharacterID", "0"];

		if(_ownerID == _ownerID2) then {
		_sounddist = 55;
		_nul = [objNull, _vehicle, rSAY, "caralarm", _sounddist] call RE;
		systemChat("Vehicle Alarm Activated");
		};
		
		_i = _i + 1;
	};
} forEach _objects;

 

3-in description.ext find:

Spoiler

class CfgSounds
{
    sounds[] =
    {
        carLock
    };
    class carLock
    {
        name="carLock";
        sound[]={remote_key\carlock.ogg,0.9,1};
        titles[] = {};
    };

};

rplace by:


class CfgSounds
{
    sounds[] =
    {
		carLock
    };
    class carLock
    {
		name="carLock";
        sound[]={remote_key\carlock.ogg,0.9,1};
		titles[] = {};
    };
	sounds2[] =
    {
    caralarm
    };
    class caralarm
    {
    name="caralarm";
    sound[]={remote_key\caralarm.ogg,0.9,1};
    titles[] = {};
    };	
};

 

4-Now download the caralarm.ogg and paste into remote_key folder.

http://www.mediafire.com/file/ecrulbo4idm5hbi/caralarm.ogg

Link to comment
Share on other sites

Do I need to change something for 'godmode locked' except:

Quote

replace by:
fnc_veh_handleDam = compile preprocessFileLineNumbers "remote_key\veh_handleDam.sqf";

???

1. Now locked vehicle still get damages, fnc_veh_handleDam was replaced.

2. Is it right that a locked vehicle does not start by 'remote engine on', but if you unlock it, start, lock, it does not turn off?

3. If I start the engine on a helicopter, it, after a while, turns itself off.

Link to comment
Share on other sites

Hey @WLF sory for the issues...

1-well see about the veh_handleDam.sqf works for me in my test server,  any way.. gonna test in other server to see what happend.

*If u want, just use the @S4M way or @BigEgg way.. just remove the veh_handleDam.sqf from remote_key folder to not enlarge your mission file.

 

2-About your second question... Yup its true. The engine cant turn on, if vehicle is locked.. the cause? this line:

if(!locked _vehicle) then {

if u wanna add the option to turn on the locked vehicles you can try replace this line by

if ((!locked _vehicle) or (locked _vehicle)) then {

or just remove the whole line and his last braket.

3-Helicopters... honestly i dont test it.. and dont know whers the issue become.. but for now.. you can remove the option on helis in this line:

_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];

 

Hope its help you mate.

Link to comment
Share on other sites

@WLF  in veh_handleDam.sqf

use this line

if (((locked _unit && (count(crew _unit)) == 0))) exitWith{};

and remove this

if (((locked _unit && (count(crew _unit)) == 0))) then {

_unit addEventHandler ["HandleDamage", {false}];
_unit enableSimulation false;

}else{

and the last bracket.

_total
};

@Cherdenko  tnks for it.

Link to comment
Share on other sites

I am do not understand where I mistaken...

1. Changed my custom compiles.sqf to:

fnc_veh_handleDam = compile preprocessFileLineNumbers "remote_key\veh_handleDam.sqf";

2. veh_handleDam.sqf:

Spoiler

////////Vehicles With GodMode by Cherdenko
/*
        Created exclusively for ArmA2:OA - DayZMod.
        Please request permission to use/alter/distribute from project leader (R4Z0R49) AND the author ([email protected])
*/

/***********************************************************
ASSIGN DAMAGE TO A UNIT.
Called by "HandleDamage" vehicle Event Handler
or by "PVCDZ_veh_SH" PV
or by zombie_attack

- Function fnc_veh_handleDam
- [unit, selectionName, damage, source, projectile, broadcast] call fnc_veh_handleDam;
- return : updated damage for that part
broadcast: boolean. if true, then the request will be sent to all players if the vehicle is not local.
************************************************************/
private["_unit","_selection","_strH","_total","_damage","_needUpdate","_totalDmg"];

_unit = _this select 0;
_selection = _this select 1;
_total = _this select 2;

if (((locked _unit && (count(crew _unit)) == 0))) exitWith{};

if (_selection != "") then {
	_strH = "hit_" + _selection;
	_totalDmg = false;
} else {
	_strH = "totalDmg";
	_totalDmg = true;
};

if (_total >= 0.98) then {
        _total = 1.0;
};

if (local _unit) then {
	if (_total > 0) then {
		if (!_totalDmg) then {
			_unit setVariable [_strH, _total, true];
		};
		_unit setHit [_selection, _total];

		PVDZ_veh_Save = [_unit,"damage",false,_totalDmg];
		if (!isServer) then {
			publicVariableServer "PVDZ_veh_Save";
		} else {
			PVDZ_veh_Save call server_updateObject;
		};
	};
} else {
	//if ( (count _this > 5) AND {(_this select 5)}) then {
		// vehicle is not local to this client, ask the client which vehicle is local to set damage
		//_this resize 5; // delete "broadcast" boolean
		PVDZ_send = [_unit,"VehHandleDam",_this];
		publicVariableServer "PVDZ_send";
	//};
};

// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
_total

 

3. Changed ui_selectSlot.sqf to:

Spoiler

//private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];
disableSerialization;
_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;

if (carryClick) then {carryClick = false;};

if (_button == 1) then {
	private ["_conf","_name","_compile","_height","_item"];
	_group = _parent displayCtrl 6902;

	_pos = ctrlPosition _group;

	_item = gearSlotData _control;	
	if ( //No right click action
		(!DZE_SelfTransfuse && _item in ["ItemBloodbag","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]) or
		(!dayz_groupSystem && _item == "ItemRadio")
	) exitWith {};
	if (mouseOverCarry) then {
		_item = DayZ_onBack;
		carryClick = true;
	};

	_pos set [0,((_this select 2) + 0.46)];
	_pos set [1,((_this select 3) + 0.07)];

	_conf = configFile >> "cfgMagazines" >> _item;
	if (!isClass _conf) then {
		_conf = configFile >> "cfgWeapons" >> _item;
	};
	_name = getText(_conf >> "displayName");

	_cfgActions = _conf >> "ItemActions";
	_numActions = (count _cfgActions);
	_height = 0;

	//Populate Menu
	for "_i" from 0 to (_numActions - 1) do
	{
		_menu = _parent displayCtrl (1600 + _i);
		_menu ctrlShow true;
		_config = (_cfgActions select _i);
		_type = getText (_config >> "text");
		_script = getText (_config >> "script");
		_outputOriented = getNumber (_config >> "outputOriented") == 1;
		_height = _height + (0.025 * safezoneH);
		_compile = format["_id = '%2' %1;",_script,_item];
		uiNamespace setVariable ['uiControl', _control];
		if (_outputOriented) then {
			/*
				This flag means that the action is output oriented
				the output class will then be transferred to the script
				and the type used for the name
			*/
			_array = getArray (_config >> "output");
			_outputClass = _array select 0;
			_outputType = _array select 1;
			_name = getText (configFile >> _outputType >> _outputClass >> "displayName");
			_compile = format["_id = ['%2',%3] %1;",_script,_item,_array];
		};

		_menu ctrlSetText format[_type,_name];
		_menu ctrlSetEventHandler ["ButtonClick",_compile];
	};

	//EXTRA_RC
	_erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
	_erc_numActions = (count _erc_cfgActions);
	if (isClass _erc_cfgActions) then {
		for "_j" from 0 to (_erc_numActions - 1) do {
			_menu =  _parent displayCtrl (1600 + _j + _numActions);
			_menu ctrlShow true;
			_config =  (_erc_cfgActions select _j);
			_text =  getText (_config >> "text");
			_script =  getText (_config >> "script");
			_height = _height + (0.025 * safezoneH);
			uiNamespace setVariable ['uiControl', _control];
			_menu ctrlSetText _text;
			_menu ctrlSetEventHandler ["ButtonClick",_script];
		};
	};
	//EXTRA_RC

	// Begin: Vehicle remote lock/unlock
	_itemsPlayer = items player;
	
	_temp_keys = [];
	_temp_keys_names = [];
	// find available keys
	_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
	if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
		_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
		_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
		_temp_keys_names set [_ownerKeyId,_ownerKeyName];
		
		_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
		_i = 0;
		{
			if (alive _x) then {
				_ownerID = _x getVariable ["CharacterID", "0"];
				_hasKey = (_ownerID == str(_ownerKeyId));
				_oldOwner = (_ownerID == dayz_playerUID);

				if(_hasKey or _oldOwner) then {
					if(locked _x) then {
						//Unlock
						_menu =  _parent displayCtrl (1600 + _numActions);
						_menu ctrlShow true;
						_text =  "Unlock";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					} else {
						//Lock
						_menu =  _parent displayCtrl (1600 + _numActions);
						_menu ctrlShow true;
						_text =  "Lock";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					//Engine start
					_menu =  _parent displayCtrl (1600 + _numActions + 1);
					_menu ctrlShow true;
					_text =  "Engine";
					_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
					_height = _height + (0.025 * safezoneH);
					uiNamespace setVariable ['uiControl', _control];
					_menu ctrlSetText _text;
					_menu ctrlSetEventHandler ["ButtonClick",_script];
				};
				_i = _i + 1;
			};
		} forEach _objects;
	};
	// End: Vehicle remote lock/unlock

	_pos set [3,_height];

	//hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];

	_group ctrlShow true;
	ctrlSetFocus _group;
	_group ctrlSetPosition _pos;
	_group ctrlCommit 0;
};

 

4. remote_lock.sqf:

Spoiler

(FindDisplay 106) closeDisplay 1;
private ["_ownerID","_objects","_i","_ownerID2","_vehicle","_sounddist"];

_ownerID = _this select 0;
_sounddist 	= 20;
_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
_i = 0;
{
	_vehicle = _x;
	if (alive _vehicle) then {
		_ownerID2 = _vehicle getVariable ["CharacterID", "0"];

		if(_ownerID == _ownerID2) then {
		
			if(!locked _vehicle) then {
				if(player distance _vehicle < 50) then {
			
					dayz_actionInProgress = true;
					{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
					s_player_lockUnlock_crtl = 1;

					PVDZE_veh_Lock = [_vehicle,true];
					if (local _vehicle) then {
						PVDZE_veh_Lock spawn local_lockUnlock
					} else {
						publicVariable "PVDZE_veh_Lock";
					};
					player action["lightOn",_vehicle];
					_null = [objNull,_vehicle,rSAY,"lockOn",_sounddist] call RE;
					sleep 0.5;
					player action["lightOff",_vehicle];
					
					systemChat("Vehicle has been locked");
					s_player_lockUnlock_crtl = -1;
					dayz_actionInProgress = false;
				};
			};
		};
		
		_i = _i + 1;
	};
} forEach _objects;

 

So, if I shooting on locked vehicle it gets damage in any case.

Of course, remote_key folder is in MPMissions\DayZ_Epoch_11.Chernarus\ folder, and no any errors in both RPTs.

Link to comment
Share on other sites

@WLF yup, yours steps are well.  i just update the main post. with new steps and new download folder.  fixing the issues. try with new files.

Try lock/unlock the vehicle and shoot on them.

about the engine.... youre right... but if u get into the car and start the engine, and stop the engine.. the engine do not stop again.

Link to comment
Share on other sites

19 hours ago, kingpapawawa said:

veh_handleDam.sqf is also being called in your safezone script im guessing, this has been addressed in some other god mode vehicle thereads. I think you need to edit the path for that one also.

 

as for the heli turning off i think it does this until you get in it the first time because of ownership of vehicle. 

Arghh! You are right! And first and second.

Changing path in safezone.sqf to a custom veh_handleDam.sqf solved the problem. Thanx!

Remote engine start on heli (and car too) works after starting it "manually".

Link to comment
Share on other sites

  • 3 weeks later...

Anyone have this working with the Call Vehicle mod ? I've tried installing both and can only get the call vehicle option. So I tried changing up how it shows in ui_selectslot but then nothing worked lol. So I reverted back and still stuck at just call vehicle. Any help would be greatly appreciated!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...